Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Yet Another Stored Procedure Question

by one4k4 (Hermit)
on Jun 24, 2003 at 14:27 UTC ( [id://268521]=note: print w/replies, xml ) Need Help??


in reply to Yet Another Stored Procedure Question

The replies above are great, but I wanted to show you some psuedo code for what I do when executing Stored Procs on Sybase. Mind you, this is untested and straight from the fingertips..
my $sth->prepare("exec DBname..stored_proc_name ?,?"); $sth->execute($var1,'var2'); while ($sth->fetchrow_hashref){..... ... }
And in the SP, according to what it sounds like you're doing.
..spcode.. declare @var int select @var = 42 select @var as var_name_for_hash end ..endofsp..
The last select statement will be returned to the calling Perl code. And simply running select @var=42 might not do it.. so I used the @var as .. moniker. I don't now, maybe I'm misreading your post and if I am, let me know! :)

I hope this helps.

P.S. Why would binding an output value be used? Isn't "output value" really "whatever the SP returns.. list of employees, paychecks, candy bar names"?

One4k4 - perlmonks@poorheart.com (www.poorheart.com)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://268521]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-25 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found