Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: Problems using ct_command()
Date: Mar 19 2001 9:00PM

Trond Straume writes:
 > I am having trouble using the ct_command()/ct_execute(), but not using 
 > ct_sql(). I am getting this errormessage from the commandprompt when 
 > executing the script.
 > Open Client Message:
 > Message number: LAYER = (1) ORIGIN = (1) SEVERITY = (1) NUMBER = (16)
 > Message String: ct_cmd_drop(): user api layer: external error: This routine 
 > cannot be called while results are pending for a command that has been sent 
 > to the server.
 > This is my perl code, generating the error. Any suggestions to what I can 
 > do to resolve this problem?

You need to call ct_results() in a loop until it stops returning
CS_SUCCEED, and you need to fetch all the results (or call
ct_cancel()) for all fetchable results.

I suggest looking at some of the sample code, and reading the Sybase
OpenClient manuals.

Michael Peppler - Data Migrations Inc. - -
International Sybase User Group -
Sybase on Linux mailing list: