SYBPERL

Section: User Commands (1)
Updated: 3 September 1991
Index Return to Main Contents
 

NAME

sybperl - Perl access to Sybase databases  

SYNOPSIS

$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
 

DESCRIPTION

Sybperl is a version of Perl which has been extended (via the usersubs feature) to allow access to Sybase databases.  

Functions

Sybperl basically maps the calls existing in the Sybase DB-Library to Perl. The usage of these fcuntions is the same as in DB-Library, unless specifically noted.

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).

 

UNIMPLEMENTED FEATURES

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.

 

OPTIONS

See the Perl(1) manual page.

 

FILES

$PERLLIB/sybperl.pl should be called in all sybperl scripts to set the correct environment variables used by DB-Library.

 

SEE ALSO

Perl(1), Sybase Open Client DB Library Reference Manual.

 

AUTHOR

Michael Peppler, ITF Management SA - mpeppler@itf.ch


 

Index

NAME
SYNOPSIS
DESCRIPTION
Functions
UNIMPLEMENTED FEATURES
OPTIONS
FILES
SEE ALSO
AUTHOR

This document was created by man2html, using the manual pages.
Time: 21:53:52 GMT, February 02, 2023