|
|
sybperl-l Archive
Up Prev Next
From: Salvatore Sferrazza <ssferraz at jcrew dot com>
Subject: ct_fetch()
Date: Oct 14 1998 3:21PM
So I recently decided to give up old faithful (DBlib) and start doing
all new applications in CTlib. It's working out OK with the exception
of ct_fetch. Here is some sample code I have that seems to be
misbehaving:
################################################################
$sql = "SELECT name FROM eng_key WHERE _eng_tname='$table'";
$dbh->ct_execute($sql);
while ($dbh->ct_results(CS_ROW_RESULT) == CS_SUCCEED) {
next unless $dbh->ct_fetchable(CS_ROW_RESULT);
my %rec;
while (%rec = $dbh->ct_fetch(1)) {
push(@eng_indices, $rec{name});
}
}
$dbh->ct_cancel(CS_CANCEL_ALL);
#################################################################
The error I am getting back is:
Open Client Message:
Message number: LAYER = (1) ORIGIN = (1) SEVERITY = (1) NUMBER = (158)
Message String: ct_fetch(): user api layer: external error: This routine
can be called only if fetchable results are available to be read.
I though that the ct_fetchable line would cover this condition.
I checked and the query returns several rows back.. but even if it
didn't, that shouldn't be an issue because of the CS_SUCCEED, n'est pas?
Thanks in advance.. I miss DBLib already :)
--
Salvatore Sferrazza
Internet Developer
http://jcrew.com - sal@jcrew.com
212.209.2764
|