
Sybperl documentation / using stored procedures
Quote:
> I've been searching the net for some info on Sybperl in general and
> about using/calling stored procedures.....i didn't find much
> information on these subjects....can anyone point me to some
> interesting sites?
You probably need to read up on calling stored procs via OpenCLient in
the Sybase manuals (available at http://sybooks.sybase.com)
Sybperl is a thin layer between Sybase OPenCLient (either DBlibrary or
Client Library), so nearly everything that is documented in the Sybase
manuals works the same way for sybperl.
In short however:
You can execute a stored proc just like any other SQL call. If the
proc returns OUTPUT parameters then it gets just a little more tricky, as you
need to declare the Sybase T-SQL variables before calling the procs, or
use the RPC calls (dbrpc*() or ct_command()/ct_param()). Something like:
$sql = "
";
$dbh->ct_execute($sql);
while($dbh->ct_results($restype) == CS_SUCCEED) {
next unless $dbh->ct_fetchable($restype);
if($restype == CS_PARAM_RESULT) { # It's the OUTPUT param....
$return_val = $d[0];
}
} else {
# It's something else...
... # do something here!
}
}
Quote:
}
There are examples for the rpc calls in the eg/ directory of the sybperl
distribution.
Michael
--
Michael Peppler -||- Data Migrations Inc.
Int. Sybase User Group -||- http://www.isug.com