PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "Sabherwal, Balvinder (MBS)" <Balvinder dot Sabherwal at mortgagefamily dot com>
Subject: ct-lib error in the perl script
Date: Dec 17 2001 8:55PM

I am getting the error as below :

Open Client Message:
Message number: LAYER = (1) ORIGIN = (1) SEVERITY = (1) NUMBER = (155)
Message String: ct_results(): user api layer: external error: This routine
cannot be called when the command structure i
s idle.
Error!!!! List of table cannot be generated


this is coming during a perl script execution. the script code is as below,
the "Error!!!! List of table cannot be generated" line is getting printed
due to the if condition being true in the code below. Any idea's as how can
I fix this.

Thanks
Bal.

	$dbhndl->ct_sql(print "On the Server");
      $dbhndl->ct_sql("exec sp_who");
	print "Command executed \n";
#        ct_callback(CS_SERVERMSG_CB, "srv_cb");
#        ct_callback(CS_CLIENTMSG_CB, \&msg_cb);
	print "Getting in the while \n";
    while(($rc = $dbhndl->ct_results($restype)) == CS_SUCCEED) 
    {
	print "In the while... \n";
        next if($restype == CS_CMD_DONE || $restype == CS_CMD_FAIL ||
$restype == CS_CMD_SUCCEED);
        while(@dat[$tbcnt] = $dbhndl->ct_fetch) 
        {
	   print "Ct Fetch \n";
	    $tbcnt++;
        
        }
     }

    if($rc == CS_FAIL) {
       print "Error!!!! List of table cannot be generated \n";
       ct_callback(CS_SERVERMSG_CB, "srv_cb");
       ct_callback(CS_CLIENTMSG_CB, \&msg_cb);
       exit 1;
    }

	print "Fetch done, starting for \n";
    foreach $tb (@dat)
    {
	print "in the for \n";
	print "\t\t$tb\n";
    }