PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at MBAY dot NET>
Subject: fetchrow_hashref in DBD::Sybase
Date: May 28 1998 5:20PM

Ken Fasman writes:
 > We have been experimenting with the hashref version of fetchrow, which is
 > quite useful when processing the results of a stored procedure with multiple
 > result sets returned (e.g. multiple SELECTS), plus return code, plus output
 > parameters.
 > 
 > Michael, if we can be permitted to make a suggestion/inquiry:
 > 
 > Would it be possible to return something more informative than "COL(1)" in 
 > the hash key for the stored proc's return code in result set N-1, and to 
 > use the output parameter names (I believe that they're available to you 
 > via CT-Lib calls) as the hash keys in result set N (rather than COL(1), 
 > COL(2), etc.)?

To get valid the output param names you should use the fully qualified 
form of the stored proc calls:

declare @foo int
exec my_proc @param1 = 'abcd', @param2=@foo output

This will give you a column called '@param2' in the output (assuming
your sproc actually has an input param called @param2 :-)

You can try this in isql and see the difference (this is in sqsh):

[42] KIOSK.prog: 1> declare @s int
[42] KIOSK.prog: 2> exec get_symbol_id SYBS, @s out
[42] KIOSK.prog: 3> go
(return status = 0)
 
            
 -----------
        8379
 
(1 row affected)
[44] KIOSK.prog: 1> declare @s int
[44] KIOSK.prog: 2> exec get_symbol_id @symbol = SYBS, @symbol_id = @s out
[44] KIOSK.prog: 3> go
(return status = 0)
 
 @symbol_id 
 -----------
        8379
 
(1 row affected)


For the status return I agree and will make that change.

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@datamig.com    -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com