develooper Front page | perl.dbi.users | Postings from February 2005

Mixing select and print statements using DBI, DBD::Sybase

Thread Next
From:
David Goodman
Date:
February 9, 2005 12:07
Subject:
Mixing select and print statements using DBI, DBD::Sybase
Message ID:
20050209200729.18397.qmail@web41101.mail.yahoo.com
Here is my simple, syntactically correct test case:

select ONE=1
print "hello world!"
select TWO=2

Using isql I get the results in the expected order:

 ONE
 -----------
           1

(1 row affected)
hello world!
 TWO
 -----------
           2

(1 row affected)

Using perl with DBI, DBD::Sybase the message "hello
world!" comes back first. I have permuted other print
and select statements and I find that my perl program
returns the messages first when the statements are run
in one batch. I find the same thing is true when my
perl program executes a stored procedure.

My program catches messages with an error handler
installed by setting the attribute
$dbconn->{"dbhandle"}->{syb_err_handler}. The rows are
retrieved using DBI call fetchall_arrayref.

Questions:
1. Can I get the results back in the expected order
when executing multiple statements from
perl/DBI/DBD::Sybase?
2. Can I suppress the result status of a stored
procedure from coming back as a row when using
fetchall_arrayref?

Thanks for your help.

regards,

David


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About