$dbproc = &dblogin([$user[, $pwd]]) $dbproc1 = &dbopen() &dbclose($dbproc) $ret = &dbcmd($dbproc, $sql_cmd) $ret = &dbsqlexec($dbproc) $ret = &dbresults($dbproc) @data = &dbnextrow($dbproc) $ret = &dbuse($dbproc, $database) $ret = &dbcancel($dbproc) $ret = &dbcanquery($dbproc) $ret = &dbexit($dbproc) $SUCCEED $FAIL $NO_MORE_ROWS $NO_MORE_RESULTS $ComputeId $SybperlVer
The following functions are provided:
$dbproc = &dblogin([$user[, $pwd]]) &dbproc1 = &dbopen() &dbclose($dbproc) $status = &dbcmd($dbproc, $sql_cmd) $status = &dbsqlexec($dbproc) $status = &dbresults($dbproc) @data = &dbnextrow($dbproc) $status = &dbuse($dbproc, $database) $status = &dbcancel($dbproc) $status = &dbcanquery($dbproc) $status = &dbexit($dbproc)
Differences with DB-Library:
&dblogin takes 2 optional arguements (the userid and the password). These default to the Unix userid, and the null password.
&dblogin returns a DBPROCESS, not a LOGINREC. This simplifies the call to open a connection to a Sybase dataserver somewhat. Further DBPROCESSes can be opened using &dbopen() (No arguments). The number of simultaneous DBPROCESSes is limited to 25 (This can be changed by altering a #define in sybperl.c).
&dbnextrow returns an array of formatted data, based on the datatype of the corresponding columns. &dbnextrow sets the variable $ComputeId when the result row is a computed row (the result of a compute by clause).
The SYBIMAGE and SYBTEXT are not implemented.
&dbfcmd is not implemented, but can be emulated by using sprintf as in &dbcmd($dbproc, sprintf("%d", $num_val));
One cannot log in to a specific server (ie dbopen() is always called with a NULL second parameter.
See the Perl(1) manual page.
$PERLLIB/sybperl.pl should be called in all sybperl scripts to set the correct environment variables used by DB-Library.
Perl(1), Sybase Open Client DB Library Reference Manual.
Michael Peppler, ITF Management SA - mpeppler@itf.ch