|
|
sybperl-l Archive
Up Prev Next
From: "Patrick S dot Leung" <pleung at easygroup dot com>
Subject: exec stored proc returns one extra row
Date: Apr 20 2000 6:14AM
Hi,
I implemented a complex select statement using a stored proc, and I use
sybperl to exec that stored proc. However, the result array has one
additional empty row, compared with the right number of rows if I would
have execute the query ad hoc. Would anyone has an idea?
for example:
$query_string = "EXEC my_stored_proc "
$X->ct_execute($query_string);
while(($rc = $X->ct_results($restype)) == CS_SUCCEED) {
next unless($X->ct_fetchable($restype));
while(@dat1 = $X->ct_fetch) {
print $dat[0];
}
}
$query_string = complex query;
$X->ct_execute($query_string);
while(($rc = $X->ct_results($restype)) == CS_SUCCEED) {
next unless($X->ct_fetchable($restype));
while(@dat1 = $X->ct_fetch) {
print $dat[0];
}
}
The first one would print one more time than the second one.
thanks, Patrick
|