Table 1: Summary of Perl functions
Database Connections
$retval = oraconnect($connect_string [,$pwd]); -- set
up connection to
local database or to remote database using SQL*Net connect
string
$retval = oradisconnect(); -- close connection to database
Select Statement Functions
($retval, $cursor) = oracursor($sql_stmt); -- parse SQL
select
statement, allocate buffers
$retval = orabind($cursor, $var, $val [,$len]); -- bind
value or
variable reference to SQL substitution variable
$retval = oraopen($cursor); -- execute select statement
using actual values
for substituted variables
($retval, $field [,$field...]) = orafetch($cursor);
-- fetch a row
from the database
$retval = oraclose($cursor); -- inform Oracle that you
are finished using
this cursor; allow Oracle to free up some resources
Nonselect Statements
($retval, $cursor) = oracursor($sql_stmt); -- parse DML,
DDL, or
PL/SQL block
$retval = orabind($cursor, $var, $val [,len]); -- bind
value or variable
reference to SQL substitution variable
$retval = oraexec($cursor); -- execute the statement
using actual values for
substituted variables
Commit and Rollback
$retval = oracommit(); -- commit transaction
$retval = orarollback(); -- rollback transaction
Variables
$oerr -- Oracle numeric result code of last operation
$oermsg -- text description of results of last operation
These variables are set after every OCI call. They contain
the Oracle result code and message. The $retval returned
by each call is TRUE if the function succeeded, and
FALSE otherwise.
|