Allocates and initializes a dbChannel, which is the connection used to communicate with the database. You can open several dbChannels, each pointing to a different database or even the same database. If you open more than one dbChannel to the same database, however, you may find that you are deadlocked against yourself. This method corresponds to the VTXINIT call in VORTEXcli.
Allocates a connection with an 8Kb fetch buffer.
$db = new dbChannel(256,64,128,8192);
Connects to a remote database. Returns false on success, true on failure. The complete connection syntax is described in the VORTEX Installation and Operations Manual available at www.trifox.com.
hostName(uid/pwd)
Connects to an Oracle database on a Unix machine.
$db->dbConnect(``orahost'',1958,``VTX0'', ``scott/tiger'', ``ORACLE_HOME=/usr/local/oracle,ORACLE_SID=A'');
Connects to a SQL Server on an NT machine.
$db->dbConnect(``sqlnt'',1958,``vtx12'',``sa/sa/master2/SQLNT'',``'');
Connects to a DB2 database on MVS with authentication.
$db->dbConnect(``sys1(SYS1/SYSPWD)'',1958,``7'',``/'',``'');
Associates a SQL statement to a dbCursor.
This method simply caches the SQL statement and other information. If the dbCursor was previously used, its database cursor is hard closed and all resources are freed. The new SQL statement is not sent to the database until either a fetch() or execute() is performed. If you use parameters in your SQL, you do not have to call sql() again for this SQL statement. You merely use the setIntParam(), setCharParam(), and setBlobParam() methods to change the parameter values. This approach is much more efficient than creating unique SQL strings.
Prepares a SELECT statment with no parameters.
$db->sql($cursor,``select * from staff'',0,0);
Prepares a bulk INSERT statement with 7 parameters in batches of 50.
$db->sql($cursor,``insert into staff values (:1,:2,:3,:4,:5,:6,:7)'',50,7);
Executes a non-SELECT dbCursor. Returns false on success, true on failure. You must bind all the parameters specified in the sql() method using either setCharParam(), setIntParam(), or setBlobParam(). The SQL statement is only sent to the database the first time. On subsequent calls only the parameters (if any) are sent.
Executes a stored procedure dbCursor. Returns false on success, true on failure.
You must bind all the parameters specified in the sql method using
setCharParam() or setIntParam(). Note that output parameters must set
the flag parameter with setCharParam() and setIntParam.
If the database's stored procedure facility supports a function return value, this
value is located in the message buffer. Use sqlError()
to retrieve the
value. The SQL statement is only sent to the database the first time.
On subsequent calls only the parameters (if any) are sent.
Closes a dbCursor. Returns false on success, true on failure.
Opens and fetches from a SELECT dbCursor. Returns false on success, true on failure. You must bind all the parameters specified in the sql() method using setIntParam() and setCharParam(). The SQL statement is only sent to the database the first time. On subsequent calls only the parameters (if any) are sent.
Data is automatically retrieved into a fetch buffer (using the fetch buffer size specified when the dbChannel was created). The number of rows per fetch varies depending upon the total length of a row.
The column data must be retrieved sequentially using the getString() method.
Gets the next column as a string. Numeric and datetime data are automatically converted to a string representation. Returns ($errorcode,$string). Errorcode is false on success, true on failure.
Skips (passes over) columns. A large numColsToSkip with stopOnColZero set to true advances to the next row. Returns false on success, true on failure.
Gets the next row of data and return an array of data items. Returns ($errorcode,$row). Errorcode is false on success, true on failure.
Gets the next stored procedure column as a string. Numeric data is automatically converted to a string representation. Returns ($errorcode,$string). Errorcode is false on success, true on failure.
Cancels an outstanding request. This method is typically called after a user interrupt. Returns false on success, true on failure.
Gets the number of rows affected by the last execute() call. This value is valid only for INSERT, UPDATE, and DELETE statements. If you are performing a bulk operation that fails due to a uniqueness violation for example, getRowsAffected returns the number of rows that were successfully executed before the error.
Sends a database-specific command. A description of the supported commands is located in the VORTEXcli Reference Manual in the VTXCMD section.
Sets the resource timeout value to 5 seconds.
$db->command($cursor,TDB_CMD_TIMEOUT(),``5'');
Commits a transaction.
Rolls back a transaction.
Sends a temporary release, used with VORTEXweb. Returns false on success, true on failure.
Resynchronize a cursor after a release2/connect. Used only with VORTEXweb. Returns false on success, true on failure.
Releases a connected database. Returns false on success, true on failure. A rollback takes place before the actual database release request is sent.
Returns the last SQL error code and message
Sends BLOB data. The VORTEXperl blob/clob interface is rather involved. To bind a blob/clob parameter, you must first call setBlobParam() with the length of the blob/clob. Then you use putBlob to send the blob/clob parameter. Please refer to the sample3.pl program enclosed in the VORTEXperl download.
Turns on/off diagnostics messages.