}
if ($db->Sql("Select * FROM foo")){
$db->DumpError;
}
Back to the top
DumpData
Dump to the screen all field names and the data in all rows of the current dataset. This is used primarily for debugging.
Example:
$db->Sql("Select * FROM foo");
$db->DumpData;
Back to the top
Error
Returns the last recorded error in the form of an array or string (depending upon the context) containing the error number, error text and the ODBC connection that caused the error (if there is one).
Example:
die $db->Error(), qq(\n);
($ErrNum, $ErrText, $ErrConn) = $db->Error();
Back to the top
FetchRow
Fetches the next row of data from the previous specified SQL statement. You would then call Data or DataHash to actually retrieve the individual elements of data. Returns undef if there's an error, TRUE otherwise.
Example:
$db->Sql("SELECT * FROM foo");
$db->FetchRow() || die qq(Fetch error: ), $db->Error(), qq(\n);
$f1 = $db->Data("f1");
See also: Sql, Data, DataHash
Back to the top
FieldNames
Returns a list of field names extracted from the current dataset. This is used mostly for testing/debugging. FieldNames returns the data in an array, with no guarantee of the order of the names.
Example:
$db->Sql("SELECT * FROM foo");
$db->FetchRow();
foreach $fd ($db->FieldNames()) print qq($fd: "), $db->Data($fd), qq("\n);
Back to the top
GetConnections
Returns an array of connection numbers for all objects.
Example:
@cnums = $db->GetConnections;
Back to the top
GetDSN
GetDSN conn
Returns the DSN (Data Source Name) or the ODBCDriverConnect string for the connection conn, or the current connection if not specified.
Example:
print LOG qq(Current connection: "), $db->GetDSN, qq("\n);
Back to the top
GetMaxBufSize
Returns the current maximum single field data size, in bytes.
Example:
$max = $db->GetMaxBufSize;
$db->SetMaxBufSize($needed) if ($max < $needed);
See also: SetMaxBufSize