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

From: David Goodman (dtzgdman_at_yahoo.com)
Date: 02/09/05


Date: Wed, 9 Feb 2005 12:07:28 -0800 (PST)
To: dbi-users@perl.org

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