I have writen a websql script (pinching lots from the Sybase docco) which
calls a stored procedure which returns 0, 1 or more rows.
I call the store procedure like this :
if (($rc = ct_sql( $ws_db, "exec schema..getDailyMaxStatistics
\"$dateFrom\",\"$dateTo\"" ) ) != CS_SUCCEED)
{
ws_error ("Unable to process database request.");
}
Then I process the results like this :
while (($ret = ct_results($ws_db, $result_type)) == CS_SUCCEED)
{
# Equivalent of switch statement in Perl.
RESULTS: {
# Check CS_CMD_DONE
# Check CS_CMD_FAIL
# Check CS_ROW_RESULT
etc etc
I get an error message which says "! 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".
Does anyone know what I am doing wrong here? UI'd really appreciate somem
help on this one because I've been through the manuals and am using the code
provided in them.
Any help much appreciated.
Thanks,
-- Phill Edwards --