Oracle
in package
Oracle support code for VTLS Virtua Driver
Tags
Table of Contents
- $dbHandle : resource
- Database Handle
- $lastError : string
- Error information - message
- $lastErrorFields : array<string|int, mixed>
- Error information - bind params
- $lastErrorType : string
- Error information - type
- $lastSql : string
- Error information - SQL attempted
- __construct() : mixed
- Constructor -- connect to database.
- __destruct() : void
- Destructor
- bindParam() : bool
- Wrapper around oci_bind_by_name.
- commit() : bool
- Wrapper around oci_commit.
- exec() : bool
- Wrapper around oci_execute.
- free() : bool
- Wrapper around oci_free_statement.
- getHandle() : resource
- Get access to the Oracle handle.
- getHtmlError() : string
- Error Retrieval -- full details formatted as HTML.
- getLastError() : string
- Error Retrieval -- last error message.
- getLastErrorType() : string
- Error Retrieval -- last error type.
- getLastSql() : string
- Error Retrieval -- SQL that triggered last error.
- prepare() : mixed
- Wrapper around oci_parse.
- prepRowId() : mixed
- Wrapper around oci_new_descriptor.
- returnParam() : bool
- Same as bindParam(), but variable is parsed by reference to allow for correct functioning of the 'RETURNING' sql statement. Annoying, but putting it in two separate functions allows the user to pass string literals into bindParam without a fatal error.
- rollback() : bool
- Wrapper around oci_rollback.
- simpleDelete() : bool
- Delete row(s) from a table.
- simpleInsert() : bool
- Insert a row into a table.
- simpleSelect() : array<string|int, mixed>|bool
- Execute a SQL statement and return the results.
- simpleSql() : bool
- Execute a simple SQL statement.
- clearError() : void
- Clear out internal error tracking details.
- getDataTypeConstant() : int
- Convert data type name into constant
- handleError() : void
- Store information about an error.
Properties
$dbHandle
Database Handle
protected
resource
$dbHandle
$lastError
Error information - message
protected
string
$lastError
$lastErrorFields
Error information - bind params
protected
array<string|int, mixed>
$lastErrorFields
$lastErrorType
Error information - type
protected
string
$lastErrorType
$lastSql
Error information - SQL attempted
protected
string
$lastSql
Methods
__construct()
Constructor -- connect to database.
public
__construct(string $username, string $password, string $tns) : mixed
Parameters
- $username : string
-
Username for connection
- $password : string
-
Password for connection
- $tns : string
-
TNS specification for connection
Return values
mixed —__destruct()
Destructor
public
__destruct() : void
Return values
void —bindParam()
Wrapper around oci_bind_by_name.
public
bindParam(resource $parsed, string $place_holder, string $data[, string $data_type = 'string' ][, int $length = -1 ]) : bool
Parameters
- $parsed : resource
-
Result returned by prepare() method.
- $place_holder : string
-
The colon-prefixed bind variable placeholder used in the statement.
- $data : string
-
The PHP variable to be associated with $place_holder
- $data_type : string = 'string'
-
The type of $data (string, integer, float, long, date, row_id, clob, or blob)
- $length : int = -1
-
Sets the maximum length for the data. If you set it to -1, this function will use the current length of variable to set the maximum length.
Return values
bool —commit()
Wrapper around oci_commit.
public
commit() : bool
Return values
bool —exec()
Wrapper around oci_execute.
public
exec(resource $parsed) : bool
Parameters
- $parsed : resource
-
Result returned by prepare() method.
Return values
bool —free()
Wrapper around oci_free_statement.
public
free(resource $parsed) : bool
Parameters
- $parsed : resource
-
Result returned by prepare() method.
Return values
bool —getHandle()
Get access to the Oracle handle.
public
getHandle() : resource
Return values
resource —getHtmlError()
Error Retrieval -- full details formatted as HTML.
public
getHtmlError() : string
Return values
string —getLastError()
Error Retrieval -- last error message.
public
getLastError() : string
Return values
string —getLastErrorType()
Error Retrieval -- last error type.
public
getLastErrorType() : string
Return values
string —getLastSql()
Error Retrieval -- SQL that triggered last error.
public
getLastSql() : string
Return values
string —prepare()
Wrapper around oci_parse.
public
prepare(string $sql) : mixed
Parameters
- $sql : string
-
SQL statement to prepare.
Return values
mixed —SQL resource on success, boolean false otherwise.
prepRowId()
Wrapper around oci_new_descriptor.
public
prepRowId() : mixed
Return values
mixed —New descriptor on success, boolean false otherwise.
returnParam()
Same as bindParam(), but variable is parsed by reference to allow for correct functioning of the 'RETURNING' sql statement. Annoying, but putting it in two separate functions allows the user to pass string literals into bindParam without a fatal error.
public
returnParam(resource $parsed, string $place_holder, string &$data[, string $data_type = 'string' ][, int $length = -1 ]) : bool
Parameters
- $parsed : resource
-
Result returned by prepare() method.
- $place_holder : string
-
The colon-prefixed bind variable placeholder used in the statement.
- $data : string
-
The PHP variable to be associated with $place_holder
- $data_type : string = 'string'
-
The type of $data (string, integer, float, long, date, row_id, clob, or blob)
- $length : int = -1
-
Sets the maximum length for the data. If you set it to -1, this function will use the current length of variable to set the maximum length.
Return values
bool —rollback()
Wrapper around oci_rollback.
public
rollback() : bool
Return values
bool —simpleDelete()
Delete row(s) from a table.
public
simpleDelete(string $table[, array<string|int, mixed> $fields = [] ]) : bool
Parameters
- $table : string
-
Table to update.
- $fields : array<string|int, mixed> = []
-
Fields to use to match rows to delete.
Return values
bool —simpleInsert()
Insert a row into a table.
public
simpleInsert(string $table[, array<string|int, mixed> $fields = [] ]) : bool
Parameters
- $table : string
-
Table to append to.
- $fields : array<string|int, mixed> = []
-
Data to write to table.
Return values
bool —simpleSelect()
Execute a SQL statement and return the results.
public
simpleSelect(string $sql[, array<string|int, mixed> $fields = [] ]) : array<string|int, mixed>|bool
Parameters
- $sql : string
-
SQL to execute
- $fields : array<string|int, mixed> = []
-
Bind parameters (optional)
Return values
array<string|int, mixed>|bool —Results on success, false on error.
simpleSql()
Execute a simple SQL statement.
public
simpleSql(string $sql[, array<string|int, mixed> $fields = [] ]) : bool
Parameters
- $sql : string
-
SQL to execute
- $fields : array<string|int, mixed> = []
-
Bind parameters (optional)
Return values
bool —clearError()
Clear out internal error tracking details.
protected
clearError() : void
Return values
void —getDataTypeConstant()
Convert data type name into constant
protected
getDataTypeConstant(string $data_type) : int
Parameters
- $data_type : string
-
Data type (string, integer, float, long, date, row_id, clob, or blob)
Return values
int —handleError()
Store information about an error.
protected
handleError(string $type, string $error[, string $sql = '' ]) : void
Parameters
- $type : string
-
Type of error
- $error : string
-
Detailed error message
- $sql : string = ''
-
SQL statement that caused error