Retrieve the number of rows affected by the last query.
After calling query() to perform an update statement, this method will return the number of rows that was updated.
API Tags:
| Return: | The number of affected rows |
Redefinition of:
- atkDb::affected_rows()
- Retrieve the number of rows affected by the last query.
Commit the current transaction.
Redefinition of:
- atkDb::commit()
- Commit the current transaction.
Connect to the database.
API Tags:
| Return: | One of the generic DB_ connection statusses. |
Redefinition of:
- atkDb::connect()
- Connect to the database.
Redefined in descendants as:
String escapeSQL(
String
$string, [boolean
$wildcard = false]
)
|
|
Escape a string for use in SQL queries.
This driver's implementation escapes single quotes and optionally, wildcards. Wildcards should be escaped if they appear as regular characters inside a string. When actually searching for wildcards, those wildcards should not be escaped.
Parameters:
|
String |
$string: |
The string to escape. |
|
boolean |
$wildcard: |
Set to true to convert wildcard chars ('%'). False will leave them unescaped. |
API Tags:
| Return: | A SQL compatible version of the input string. |
Redefinition of:
- atkDb::escapeSQL()
- escapes quotes for use in SQL: ' -> '' (and sometimes % -> %%)
unknown func_concat(
array
$fields
)
|
|
Retrieve this drivers' specific SQL implementation of a concat() function.
Parameters:
API Tags:
Redefinition of:
- atkDb::func_concat()
- Get CONCAT() equivalent for the current database.
Retrieve this drivers' specific SQL implementation of a now() function.
Redefinition of:
- atkDb::func_now()
- get NOW() or SYSDATE() equivalent for the current database
void func_substring(
String
$fieldname, [int
$startat = 0], [int
$length = 0]
)
|
|
Retrieve this drivers' specific SQL implementation of a substring function.
Note that this function does not actually perform a substring operation. It just returns a piece of valid SQL code that can be used in a query.
Parameters:
|
String |
$fieldname: |
The name of the field to perform a substring operation on. |
|
int |
$startat: |
The character at which to start. |
|
int |
$length: |
The number of charachters to retrieve. |
Redefinition of:
- atkDb::func_substring()
- get SUBSTRING() equivalent for the current database.
Get last error code.
If an error occurred, this method can be called to retrieve the generic error code.
API Tags:
| Return: | One of the generic DB_* statusses. |
Redefinition of:
- atkDb::getAtkDbErrno()
- Get generic atk errorccode
boolean lock(
String
$table, [String
$mode = "write"]
)
|
|
Lock a table in the database.
Parameters:
|
String |
$table: |
The name of the table to lock. |
|
String |
$mode: |
The lock type. Note that this driver only supports "write". |
API Tags:
| Return: | True if succesful, false if not. |
Redefinition of:
- atkDb::lock()
- Lock a table in the database.
int maxIdentifierLength(
)
|
|
Returns the maximum length an identifier (tablename, columnname, etc) for this driver may have.
Redefinition of:
- atkDb::maxIdentifierLength()
- Returns the maximum length an identifier (tablename, columnname, etc) may have
array metadata(
String
$table, [boolean
$full = false]
)
|
|
Return the meta data of a certain table
Parameters:
|
String |
$table: |
The name of the table |
|
boolean |
$full: |
If set to true, more metadata is retrieved than when set to false. |
API Tags:
| Return: | The retrieved metadata. See documentation for atkDb::metadata() for information about the structure of the returned array. |
Redefinition of:
- atkDb::metadata()
- Return the meta data of a certain table HIE GEBLEVEN
int nextid(
string
$sequence
)
|
|
Get the next sequence number of a certain sequence.
If the sequence does not exist, it is created automatically. For this to work, the database user should have the 'create sequence' privilege. The name of the sequence in the database is prefixed with the string that's configured in $config_database_sequenceprefix.
Example If the database contains a sequence named "seq_employees", the following call will retrieve the next value from the sequence:
$id =
$db->nextid("employees");
Parameters:
|
string |
$sequence: |
The sequence name |
API Tags:
| Return: | The next sequence value |
Redefinition of:
- atkDb::nextid()
- Get the next sequence number of a certain sequence.
Retrieve the next record in the resultset.
API Tags:
| Return: | An array containing the record, or 0 if there are no more records to retrieve. |
Redefinition of:
- atkDb::next_record()
- Retrieve the next record in the resultset.
Evaluatie the result; how many fields where affected by the query.
API Tags:
| Return: | of affected fields |
Retrieve the number of rows in the resultset.
After calling query() to perform a select statement, this method will return the number of rows in the resultset.
API Tags:
| Return: | The number of rows in the resultset. |
void query(
String
$query, [int
$offset = -1], [int
$limit = -1]
)
|
|
Parse and execute a query.
If the query is a select query, the rows can be retrieved using the next_record() method.
Parameters:
|
String |
$query: |
The SQL query to execute |
|
int |
$offset: |
Retrieve the results starting at the specified record number. Pass -1 or 0 to start at the first record. |
|
int |
$limit: |
Indicates how many rows to retrieve. Pass -1 to retrieve all rows. |
Redefinition of:
- atkDb::query()
- Parse and execute a query.
Redefined in descendants as:
Bool rollback(
[String
$savepoint = ""]
)
|
|
Rollback the the current transaction.
Parameters:
API Tags:
Redefinition of:
- atkDb::rollback()
- Rollback the current transaction.
void savepoint(
string
$name
)
|
|
Set savepoint with the given name.
Parameters:
|
string |
$name: |
savepoint name |
API Tags:
Redefinition of:
- atkDb::savepoint()
- Set savepoint with the given name.
void seek(
[int
$position = 0]
)
|
|
Skip to a certain position in the result set for subsequent calls to next_record().
Calling seek() with no parameters places the pointer to the first record in the resultset.
Parameters:
|
int |
$position: |
The number of the record to skip to. |
void setSequenceValue(
string
$sequence, int
$value
)
|
|
Set sequence value.
Parameters:
|
string |
$sequence: |
|
|
int |
$value: |
|
Redefinition of:
- atkDb::setSequenceValue()
- Set database sequence value.
boolean tableExists(
String
$table
)
|
|
This function checks in the database if a table exists.
Parameters:
|
String |
$table: |
The name of the table to check. |
API Tags:
| Return: | True if the table exists, false if not. |
Redefinition of:
- atkDb::tableExists()
- This function checks the database for a table with the provide name
Return a list of all table names in the current connection.
API Tags:
| Return: | The array containing the names of the tables. |
Redefinition of:
- atkDb::table_names()
- Return the available table names
void toggleForeignKeys(
bool
$enable
)
|
|
Enable/disable all foreign key constraints.
Parameters:
|
bool |
$enable: |
enable/disable foreign keys? |
Redefinition of:
- atkDb::toggleForeignKeys()
- Enable/disable all foreign key constraints.
Relieve all locks.
The oracle 8i driver has no way to unlock other than committing the current transaction. So be careful with calling this function; any outstanding transaction will be committed.
API Tags:
| Return: | True if succesful, false if not. |
Redefinition of:
- atkDb::unlock()
- Relieve all locks.
int _translateError(
Array
$err
)
|
|
Translate a driver specific error to a generic ATK db error code.
Parameters:
API Tags:
| Return: | One of the generic DB_* constants |
| Access: | private |
Redefinition of:
- atkDb::_translateError()
- Translate database-vendor dependent error messages into an ATK generic error code.