Back to the top
GetStmtCloseType
Returns the current ODBC close type setting. This is used mainly for debugging. Type will be one of: SQL_CLOSE, SQL_DROP, SQL_UNBIND, or SQL_RESET_PARAMS. See SetStmtCloseType for more info on what each of the types mean, and how they are used.
Example:
$oldct = $db->GetStmtCloseType;
$db->SetStmtCloseType(SQL_DROP);
...
$db->SetStmtCloseType($oldct);
See also: SetStmtCloseType
Back to the top
MoreResults
Sees if more result sets are present and initializes for fetching rows from next result set. You would then call FetchRow to actually fetch the next row of the next result set. Returns undef if there's an error, TRUE otherwise.
Example:
$db->Sql("SELECT * FROM foo\n SELECT * FROM bar");
$db->FetchRow() || die qq(Fetch error: ), $db->Error(), qq(\n);
$f1 = $db->Data("f1");
$db->MoreResults() || die qq(Error checking for more result sets: ), $db->Error(), qq(\n);
$db->FetchRow() || die qq(Fetch error: ), $db->Error(), qq(\n);
$f1 = $db->Data("f1");
See also: Sql, Data
Back to the top
new Win32::ODBC(DSN)
new Win32::ODBC(ODBCDriverConnect)
Creates a new ODBC object, given a DSN (Data Source Name) or a properly formatted ODBCDriverConnect string. Returns the created ODBC object or undef if there is an error.
Example:
$DSN = "MyDSN";
$db = new Win32::ODBC($DSN);
die qq(Cannot open new ODBC\n) if ! $db;
or
$db = new Win32::ODBC("dsn=FOO;UID=BAR;PWD=FUBAR");
die qq(Cannot open new ODBC\n) if ! $db;
Back to the top
RowCount
Returns the number of rows that were affected by the previous SQL command. Note: This does not work on all ODBC connections.
Example:
$db->Sql("SELECT * FROM foo");
print DBG q(# of records: ), $db->RowCount(), qq(\n);
Back to the top
Run
stmt
Submit the SQL statement stmt and print data about it. This is used only in debugging.
Example:
$db->Run("SELECT * FROM foo");
See also: Sql
Back to the top
SetMaxBufSize
size
Sets the maximum buffer size that a single field can allocate when executing a FetchRow. The default limit is 10240 bytes and the absolute maximum is set to 2147483647 bytes. This absolute maximum can be reset by recompiling the module. Returns undef if successful.