Hello Jones,
Friday, June 15, 2001, 5:54:56 PM, you wrote:
Yep, but i already wrote about this as an unsuitable
solution, cos in real project i have to prepare all
$sth's and only then do smth with them.
JRC8CS> Will this work if you change the order like so:
JRC8CS> my $sth1 = $dbh->prepare("call sp_Get_Buildings()");
JRC8CS> $sth1->execute();
JRC8CS> print "1st sth" while($sth1->fetch);
JRC8CS> my $sth2 = $dbh->prepare("call sp_Get_Streets()");
JRC8CS> $sth2->execute();
JRC8CS> print "2nd sth" while($sth2->fetch);
JRC8CS> -----Original Message-----
JRC8CS> From: Alex Dedul [mailto:[EMAIL PROTECTED]]
JRC8CS> Sent: Friday, June 15, 2001 9:42 AM
JRC8CS> To: [EMAIL PROTECTED]
JRC8CS> Subject: DB2 and "Function sequence error"
JRC8CS> Hello,
JRC8CS> I'm trying to fetch data from 2 stored procedures one after
JRC8CS> another and i'm getting weird error message when it start to
JRC8CS> fetch from second one. Here is a code snippet
JRC8CS> ----
JRC8CS> my $sth1 = $dbh->prepare("call sp_Get_Buildings()");
JRC8CS> $sth1->execute();
JRC8CS> my $sth2 = $dbh->prepare("call sp_Get_Streets()");
JRC8CS> $sth2->execute();
JRC8CS> print "1st sth" while($sth1->fetch);
JRC8CS> print "2nd sth" while($sth2->fetch);
JRC8CS> ----
JRC8CS> On last line it writes
JRC8CS> ---
JRC8CS> DBD::DB2::st fetch failed: [IBM][CLI Driver] CLI0125E Function se
JRC8CS> quence error. SQLSTATE=HY010 at 1.pl line 12.
JRC8CS> ---
JRC8CS> I already found several solutions for this - place each out after
JRC8CS> corresponding while($sth->fetch), but it isn't suit for me, cos in
JRC8CS> real project i have to at first prepare each $sth and only then do
JRC8CS> smth with them. Another solution is to replace call to stored
JRC8CS> procedure by SQL statement itself, but i think it's not good...
JRC8CS> So, here are a couple of questions:
JRC8CS> 1. What does that error message mean ?
JRC8CS> 2. How i can get rid of it ?
JRC8CS> Thanks in advance.
--
Best regards,
Alex mailto:[EMAIL PROTECTED]
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com