Websql Output

Websql Output

Post by Jermaine Lindsa » Fri, 09 May 1997 04:00:00



I am having problems with a websql code that allows access to a sybase
database via a browser. I keep getting the error message below above
from the code.

[ERROR MESSAGE]

This shows up in the middle of the data being returned.
        ct_cmd_drop() failed during global destruction.

and then this shows up at the end

! Open Client Error: 163 (Layer 1, Origin 1, Severity 1)

     ct_results(): user api layer: external error: This routine cannot
be called until all fetchable results have been completely processed.

! Open Client Error: 159 (Layer 1, Origin 1, Severity 1)

     ct_cmd_drop(): user api layer: external error: This routine can be
called only if the command structure is idle.

[CODE]

ws_content_type("text/html");
print qq!
<HTML>
<HEAD>
<TITLE> NCSA Staff Search Form </TITLE>
</HEAD>
<BODY>
<img src="ncsa.gif">
!;
$ws_db = ct_connect("$login", "$password", "SYBASE");

#This blcok of code allows the users to type or select the procedure
thay wish to run
if ($procedure eq "other"){
        $procedure = $text_stmt;}

        $rc = ct_sql($ws_db, "$procedure");

if ($rc != CS_SUCCEED) {ws_error("ct_sql() failed");}

while ($ret=ct_results($ws_db, $result_type) == CS_SUCCEED) {
        if ($result_type == CS_ROW_RESULT) {
                print "<TABLE BORDER>\n";


                }
                print "</TABLE>\n";
        }

Quote:}

print qq!

</BODY>
</HTML>
!;

 
 
 

Websql Output

Post by Daniel Pas » Fri, 09 May 1997 04:00:00



> I am having problems with a websql code that allows access to a sybase
> database via a browser. I keep getting the error message below above
> from the code.
> ! Open Client Error: 163 (Layer 1, Origin 1, Severity 1)
>      ct_results(): user api layer: external error: This routine cannot
> be called until all fetchable results have been completely processed.

Ya gotta fetch everything returned or it will do that...

> while ($ret=ct_results($ws_db, $result_type) == CS_SUCCEED) {
>    if ($result_type == CS_ROW_RESULT) {
>            print "<TABLE BORDER>\n";


>            }
>            print "</TABLE>\n";
>    }
> }

There are several different result types you may need to be fetching but
you are only getting data rows.  If anything else is being returned you
will get the above error message since you are not handling that case.
Not knowing what SQL you are likely to be calling, my first guess would
have to be a status is being returned.  Try adding inside the while loop:

        elsif ($result_type == CS_STATUS_RESULT) {
           $status = ct_fetch ($ws_db);
           ct_fetch ($ws_db);
        }

and/or you might want a prettier error message any time you get something
unexpected, so add:

        else {
           ws_error ("Unexpected result type returned from SQL.");
        }

Dan
--
+----------------------------------+-------------------------------------+


+----------------------------------+-------------------------------------+
If you believe I speak for my employer...
   I have some prime oceanfront real estate in Arkansas to sell you.

 
 
 

1. webSQL with NSAPI?

I'm using webSQL 1.1 (CGI) to interface with Sybase.
This works fine, but have not gotten webSQL to work
with NSAPI (Netscape Enterprise Server 2.0 on Solaris 2).
Error message on server:
   'no way to service request for /websql1.1/welcome.hts/'

Any thoughts/experience out there?

                          /FRanco

--
Franco C. Maras
Ericsson Data Services Americas

http://www.geocities.com/WallStreet/4605

2. Rename of computer requires reinstall of SQL 7.0

3. WebSQL support for Apache/Stronghold

4. Unspecified Error in query Designer

5. Websql NSAPI for NT

6. Determining date given week and year

7. User authentication with websql

8. Cannot load resource dll:REPLRES.RLL

9. Problem using ct_sql with websql

10. Sybase's WebSQL Plans ???

11. WebSQL vs ???

12. Websql Problem with returning data

13. Websql for Sybase SQL server .