|
SQL Relay PHP API
|
| sqlrcon_alloc | ( | $server, | |
| $port, | |||
| $socket, | |||
| $user, | |||
| $password, | |||
| $retrytime, | |||
| $tries ) |
Initiates a connection to "server" on "port" or to the unix "socket" on the local machine and auths with "user" and "password". Failed connections will be retried for "tries" times, waiting "retrytime" seconds between each try. If "tries" is 0 then retries will continue forever. If "retrytime" is 0 then retries will be attempted on a default interval.
If "server" is a comma-separated list of hosts, then an attempt will be made to connect to each until the attempt succeeds, or there are no more hosts left to try.
If the "socket" parameter is neither NULL nor "" then an attempt will be made to connect through it before attempting to connect to "server" on "port". If it is NULL or "" then no attempt will be made to connect through the socket.
| sqlrcon_autoCommitOff | ( | $sqlrconref | ) |
Instructs the database to wait for the client to tell it when to commit.
| sqlrcon_autoCommitOn | ( | $sqlrconref | ) |
Instructs the database to perform a commit after every successful query.
| sqlrcon_begin | ( | $sqlrconref | ) |
Begins a transaction. Returns 1 if the begin succeeded, 0 if it failed. If the database automatically begins a new transaction when a commit or rollback is issued then this doesn't do anything unless SQL Relay is faking transaction blocks.
| sqlrcon_bindFormat | ( | $sqlrconref | ) |
Returns a string representing the bind variable format used by the database. For example:
? - database uses a ? to represent a bind variable @* - database uses a @ followed by any characters to represent a bind variable $1 - database uses a $ followed by a number to represent a bind variable :* - database uses a : followed by any characters to represent a bind variable
| sqlrcon_clientVersion | ( | $sqlrconref | ) |
Returns the version of the sqlrelay client software.
| sqlrcon_commit | ( | $sqlrconref | ) |
Commits a transaction. Returns 1 if the commit succeeded, 0 if it failed.
| sqlrcon_dbHostName | ( | $sqlrconref | ) |
Returns the host name of the database
| sqlrcon_dbIpAddress | ( | $sqlrconref | ) |
Returns the ip address of the database
| sqlrcon_dbVersion | ( | $sqlrconref | ) |
Returns the version of the database
| sqlrcon_debugOff | ( | $sqlrconref | ) |
Turns debugging off.
| sqlrcon_debugOn | ( | $sqlrconref | ) |
Causes verbose debugging information to be sent to standard output. Another way to do this is to start a query with "-- debug\n". Yet another way is to set the environment variable SQLR_CLIENT_DEBUG to "ON"
| sqlrcon_disableEncryption | ( | $sqlrconref | ) |
Disables encryption.
| sqlrcon_enableKerberos | ( | $sqlrconref, | |
| $service, | |||
| $mech, | |||
| $flags ) |
Enables Kerberos authentication and encryption.
"service" indicates the Kerberos service name of the SQL Relay server. If left empty or NULL then the service name "sqlrelay" will be used. "sqlrelay" is the default service name of the SQL Relay server. Note that on Windows platforms the service name must be fully qualified, including the host and realm name. For example: "sqlrelay/sqlrserver.firstworks.com@AD.FIRSTWORKS.COM".
"mech" indicates the specific Kerberos mechanism to use. On Linux/Unix platforms, this should be a string representation of the mechnaism's OID, such as: { 1 2 840 113554 1 2 2 } On Windows platforms, this should be a string like: Kerberos If left empty or NULL then the default mechanism will be used. Only set this if you know that you have a good reason to.
"flags" indicates what Kerberos flags to use. Multiple flags may be specified, separated by commas. If left empty or NULL then a defalt set of flags will be used. Only set this if you know that you have a good reason to.
Valid flags include:
For a full list of flags, consult the GSSAPI documentation, though note that only the flags listed above are supported on Windows.
| sqlrcon_enableTls | ( | $sqlrconref, | |
| $version, | |||
| $cert, | |||
| $password, | |||
| $ciphers, | |||
| $validate, | |||
| $ca, | |||
| $depth ) |
Enables TLS/SSL encryption, and optionally authentication.
"version" specifies the TLS/SSL protocol version that the client will attempt to use. Valid values include SSL2, SSL3, TLS1, TLS1.1, TLS1.2 or any more recent version of TLS, as supported by and enabled in the underlying TLS/SSL library. If left blank or empty then the highest supported version will be negotiated.
"cert" is the file name of the certificate chain file to send to the SQL Relay server. This is only necessary if the SQL Relay server is configured to authenticate and authorize clients by certificate.
If "cert" contains a password-protected private key, then "password" may be supplied to access it. If the private key is not password-protected, then this argument is ignored, and may be left empty or NULL.
"ciphers" is a list of ciphers to allow. Ciphers may be separated by spaces, commas, or colons. If "ciphers" is empty or NULL then a default set is used. Only set this if you know that you have a good reason to.
For a list of valid ciphers on Linux/Unix platforms, see: man ciphers
For a list of valid ciphers on Windows platforms, see: https://msdn.microsoft.com/en-us/library/windows/desktop/aa375549%28v=vs.85%29.aspx On Windows platforms, the ciphers (alg_id's) should omit CALG_ and may be given with underscores or dashes. For example: 3DES_112
"validate" indicates whether to validate the SQL Relay's server certificate, and may be set to one of the following: "no" - Don't validate the server's certificate. "ca" - Validate that the server's certificate was signed by a trusted certificate authority. "ca+host" - Perform "ca" validation and also validate that one of the subject altenate names (or the common name if no SANs are present) in the certificate matches the host parameter. (Falls back to "ca" validation when a unix socket is used.) "ca+domain" - Perform "ca" validation and also validate that the domain name of one of the subject alternate names (or the common name if no SANs are present) in the certificate matches the domain name of the host parameter. (Falls back to "ca" validation when a unix socket is used.)
"ca" is the location of a certificate authority file to use, in addition to the system's root certificates, when validating the SQL Relay server's certificate. This is useful if the SQL Relay server's certificate is self-signed.
On Windows, "ca" must be a file name.
On non-Windows systems, "ca" can be either a file or directory name. If it is a directory name, then all certificate authority files found in that directory will be used. If it a file name, then only that file will be used.
Note that the supported "cert" and "ca" file formats may vary between platforms. A variety of file formats are generally supported on Linux/Unix platfoms (.pem, .pfx, etc.) but only the .pfx format is currently supported on Windows.
| sqlrcon_endSession | ( | $sqlrconref | ) |
Ends the session.
| sqlrcon_errorMessage | ( | $sqlrconref | ) |
If an operation failed and generated an error, the error message is available here. If there is no error then this method returns NULL.
| sqlrcon_errorNumber | ( | $sqlrconref | ) |
If an operation failed and generated an error, the error number is available here. If there is no error then this method returns 0.
| sqlrcon_free | ( | $sqlrconref | ) |
Disconnects and ends the session if it hasn't been ended already.
| sqlrcon_getAutoCommit | ( | $sqlrconref | ) |
Returns 1 if auto-commit is currently on, 0 otherwise.
| sqlrcon_getBindVariableDelimiterAtSignSupported | ( | $sqlrconref | ) |
Returns 1 if at-signs (@) are considered to be valid bind variable delimiters and 0 otherwise.
| sqlrcon_getBindVariableDelimiterColonSupported | ( | $sqlrconref | ) |
Returns 1 if colons (:) are considered to be valid bind variable delimiters and 0 otherwise.
| sqlrcon_getBindVariableDelimiterDollarSignSupported | ( | $sqlrconref | ) |
Returns 1 if dollar signs ($) are considered to be valid bind variable delimiters and 0 otherwise.
| sqlrcon_getBindVariableDelimiterQuestionMarkSupported | ( | $sqlrconref | ) |
Returns 1 if question marks (?) are considered to be valid bind variable delimiters and 0 otherwise.
| sqlrcon_getClientInfo | ( | $sqlrconref | ) |
Returns the string that was set by setClientInfo().
| sqlrcon_getConnectionPort | ( | $sqlrconref | ) |
Returns the inet port that the connection is communicating over. This parameter may be passed to another connection for use in the resumeSession() method. Note: The value this method returns is only valid after a call to suspendSession().
| sqlrcon_getConnectionSocket | ( | $sqlrconref | ) |
Returns the unix socket that the connection is communicating over. This parameter may be passed to another connection for use in the resumeSession() method. Note: The value this method returns is only valid after a call to suspendSession().
| sqlrcon_getConnectTimeoutMicroseconds | ( | $sqlrconref | ) |
Gets the server connect timeout in microseconds.
| sqlrcon_getConnectTimeoutSeconds | ( | $sqlrconref | ) |
Gets the server connect timeout in seconds.
| sqlrcon_getCurrentCatalog | ( | $sqlrconref | ) |
Returns the catalog that is currently in use.
| sqlrcon_getCurrentDatabase | ( | $sqlrconref | ) |
Returns the database that is currently in use.
May return the current catalog or schema, depending on whether the backend database equates "database" with catalog or schema.
See getDatabaseIsSchema().
| sqlrcon_getCurrentSchema | ( | $sqlrconref | ) |
Returns the schema that is currently in use.
| sqlrcon_getCurrentUser | ( | $sqlrconref | ) |
Returns the user that sqlrelay is currently logged in to the database as, or NULL if no user could be determined or if an error occurred.
| sqlrcon_getDatabaseFeature | ( | $sqlrconref, | |
| $feature ) |
Returns the value of the specified database "feature".
Valid features include:
Returns the value of the feature as a string, or NULL if an error occurred or an invalid feature was requested.
| sqlrcon_getDatabaseIsSchema | ( | $sqlrconref | ) |
Returns 1 if the backend database equates "database" with "schema", and 0 if it equates "database" with "catalog".
| sqlrcon_getDebug | ( | $sqlrconref | ) |
Returns false if debugging is off and true if debugging is on.
| sqlrcon_getDefaultIsolationLevel | ( | $sqlrconref | ) |
Returns the database-specific default isolation level, or NULL if an error occurred.
| sqlrcon_getDefaultTransactionModel | ( | $sqlrconref | ) |
Returns the database's native transaction model. See setTranscationModel() for a list of potential return values. Returns NULL if an error occurred.
| sqlrcon_getInTransaction | ( | $sqlrconref | ) |
Returns 1 if the session is currently inside a transaction, 0 otherwise.
| sqlrcon_getIsolationLevel | ( | $sqlrconref | ) |
Returns the database-specific isolation level, "unknown" if the isolation level is unknown, or NULL if an error occurred.
| sqlrcon_getLastInsertId | ( | $sqlrconref | ) |
Returns the value of the autoincrement column for the last insert
| sqlrcon_getResponseTimeoutMicroseconds | ( | $sqlrconref | ) |
Gets the response timeout in microseconds.
| sqlrcon_getResponseTimeoutSeconds | ( | $sqlrconref | ) |
Gets the response timeout in seconds.
| sqlrcon_getTransactionModel | ( | $sqlrconref | ) |
Returns the current transaction model. See setTranscationModel() for a list of potential return values. Returns NULL if an error occurred.
| sqlrcon_identify | ( | $sqlrconref | ) |
Returns the type of database: oracle, postgresql, mysql, etc.
| sqlrcon_nextvalFormat | ( | $sqlrconref | ) |
Returns a string representing the format of the sequence nextval command used in the database. The format will contain a s in place of the sequence name. For example:
(nextval for s) next value for s nextval('s') s.nextval
Returns an empty string if the database does not support sequences.
| sqlrcon_ping | ( | $sqlrconref | ) |
Returns 1 if the database is up and 0 if it's down.
| sqlrcon_resumeSession | ( | $sqlrconref, | |
| $port, | |||
| $socket ) |
Resumes a session previously left open using suspendSession(). Returns 1 on success and 0 on failure.
| sqlrcon_rollback | ( | $sqlrconref | ) |
Rolls back a transaction. Returns 1 if the rollback succeeded, 0 if it failed.
| sqlrcon_selectCatalog | ( | $sqlrconref, | |
| $catalog ) |
Sets the current catalog to "catalog"
| sqlrcon_selectDatabase | ( | $sqlrconref, | |
| $database ) |
Sets the current database to "database".
May set the current catalog or schema, depending on whether the backend database equates "database" with catalog or schema.
See getDatabaseIsSchema().
| sqlrcon_selectSchema | ( | $sqlrconref, | |
| $schema ) |
Sets the current schema to "schema"
| sqlrcon_serverVersion | ( | $sqlrconref | ) |
Returns the version of the sqlrelay server software.
| sqlrcon_setBindVariableDelimiters | ( | $sqlrconref, | |
| $delimiters ) |
Sets which delimiters are used to identify bind variables in countBindVariables() and validateBinds(). Valid delimiters include ?,:,@, and $. Defaults to "?:@$"
| sqlrcon_setClientInfo | ( | $sqlrconref, | |
| $clientinfo ) |
Allows you to set a string that will be passed to the server and ultimately included in server-side logging along with queries that were run by this instance of the client.
| sqlrcon_setConnectTimeout | ( | $sqlrconref, | |
| $timeoutsec, | |||
| $timeoutusec ) |
Sets the server connect timeout in seconds and microseconds. Setting either parameter to -1 disables the timeout. You can also set this timeout using the SQLR_CLIENT_CONNECT_TIMEOUT environment variable.
| sqlrcon_setDebugFile | ( | $sqlrconref, | |
| $filename ) |
Allows you to specify a file to write debug to. Setting "filename" to NULL or an empty string causes debug to be written to standard output (the default).
| sqlrcon_setIsolationLevel | ( | $sqlrconref, | |
| $isolationlevel ) |
Sets the transaction isolation level to "isolationlevel". The string is the database-specific (native) name and is matched case-insensitively.
Valid isolation levels include:
For PostgreSQL:
For MySQL/MariaDB:
For Oracle:
For DB2:
For MS SQL Server (via FreeTDS):
For SAP ASE (Sybase):
For Informix:
For Firebird:
For SQLite:
For ODBC:
(whether a given level is actually supported depends on the underlying ODBC driver and target database). The generic ODBC backend also accepts the database-specific native names listed above for any of the other backends, as well as the JDBC TRANSACTION_* names, and maps them to the closest of the four ODBC levels above.
For other databases, the string is passed through to the backend as the argument to "set transaction isolation level".
Returns 1 if setting the isolation level succeeded, 0 if it failed.
| sqlrcon_setResponseTimeout | ( | $sqlrconref, | |
| $timeoutsec, | |||
| $timeoutusec ) |
Sets the response timeout (for queries, commits, rollbacks, pings, etc.) in seconds and microseconds. Setting either parameter to -1 disables the timeout. You can also set this timeout using the SQLR_CLIENT_RESPONSE_TIMEOUT environment variable.
| sqlrcon_setTransactionModel | ( | $sqlrconref, | |
| $txmodel ) |
Sets the current transaction model to "txmodel" which should be one of:
Returns 1 on success and 0 on failure.
| sqlrcon_suspendSession | ( | $sqlrconref | ) |
Disconnects this connection from the current session but leaves the session open so that another connection can connect to it using resumeSession().
| sqlrcur_affectedRows | ( | $sqlrcurref | ) |
Returns the number of rows that were updated, inserted or deleted by the query. Not all databases support this call. Don't use it for applications which are designed to be portable across databases. 0 is returned by databases which don't support this option.
| sqlrcur_alloc | ( | $sqlrconref | ) |
Creates a cursor to run queries and fetch result sets using connection "sqlrconref"
| sqlrcur_cacheOff | ( | $sqlrcurref | ) |
Sets query caching off.
| sqlrcur_cacheToFile | ( | $sqlrcurref, | |
| $filename ) |
Sets query caching on. Future queries will be cached to the file "filename".
A default time-to-live of 10 minutes is also set.
Note that once cacheToFile() is called, the result sets of all future queries will be cached to that file until another call to cacheToFile() changes which file to cache to or a call to cacheOff() turns off caching.
| sqlrcur_clearBinds | ( | $sqlrcurref | ) |
Clears all bind variables.
| sqlrcur_closeResultSet | ( | $sqlrcurref | ) |
Closes the current result set, if one is open. Data that has been fetched already is still available but no more data may be fetched. Server side resources for the result set are freed as well.
| sqlrcur_colCount | ( | $sqlrcurref | ) |
Returns the number of columns in the current result set.
| sqlrcur_countBindVariables | ( | $sqlrcurref | ) |
Parses the previously prepared query, counts the number of bind variables defined in it and returns that number.
| sqlrcur_defineOutputBindBlob | ( | $sqlrcurref, | |
| $variable ) |
Defines a binary lob output bind variable.
| sqlrcur_defineOutputBindClob | ( | $sqlrcurref, | |
| $variable ) |
Defines a character lob output bind variable.
| sqlrcur_defineOutputBindCursor | ( | $sqlrcurref, | |
| $variable ) |
Defines a cursor output bind variable.
| sqlrcur_defineOutputBindDate | ( | $sqlrcurref, | |
| $variable ) |
Defines a date output bind variable.
| sqlrcur_defineOutputBindDouble | ( | $sqlrcurref, | |
| $variable ) |
Defines a decimal output bind variable.
| sqlrcur_defineOutputBindInteger | ( | $sqlrcurref, | |
| $variable ) |
Defines an integer output bind variable.
| sqlrcur_defineOutputBindString | ( | $sqlrcurref, | |
| $variable, | |||
| $length ) |
Defines an output bind variable. "bufferlength" bytes will be reserved to store the value.
| sqlrcur_dontGetColumnInfo | ( | $sqlrcurref | ) |
Tells the server not to send any column info (names, types, sizes). If you don't need that info, you should call this function to improve performance.
| sqlrcur_endOfResultSet | ( | $sqlrcurref | ) |
Returns 0 if part of the result set is still pending on the server and 1 if not. This function can only return 0 if setResultSetBufferSize() has been called with a parameter other than 0.
| sqlrcur_errorMessage | ( | $sqlrcurref | ) |
If a query failed and generated an error, the error message is available here. If the query succeeded then this method returns NULL.
| sqlrcur_errorNumber | ( | $sqlrcurref | ) |
If a query failed and generated an error, the error number is available here. If there is no error then this method returns 0.
| sqlrcur_executeQuery | ( | $sqlrcurref | ) |
Execute the query that was previously prepared and bound.
| sqlrcur_fetchFromBindCursor | ( | $sqlrcurref | ) |
Fetch from a cursor that was returned as an output bind variable.
| sqlrcur_firstRowIndex | ( | $sqlrcurref | ) |
Returns the index of the first buffered row. This is useful when buffering only part of the result set at a time.
| sqlrcur_free | ( | $sqlrcurref | ) |
Destroys the cursor and cleans up all associated result set data.
| sqlrcur_getCacheFileName | ( | $sqlrcurref | ) |
Returns the name of the file containing the cached result set.
| sqlrcur_getCatalogList | ( | $sqlrcurref, | |
| $wild ) |
Generates a result set containing catalogs that match the pattern "catalog".
The result set will contain the following columns:
If "catalog" is empty or NULL then a result set containing all catalogs will be returned.
If SQL Relay doesn't support getting a list of catalogs for the current database backend (or the database doesn't) then an empty result set will be returned.
| sqlrcur_getColumnInfo | ( | $sqlrcurref | ) |
Tells the server to send column info.
| sqlrcur_getColumnIsAutoIncrement | ( | $sqlrcurref, | |
| $col ) |
Returns 1 if the specified column auto-increments and 0 otherwise. "col" may be specified as the column name or number.
| sqlrcur_getColumnIsBinary | ( | $sqlrcurref, | |
| $col ) |
Returns 1 if the specified column contains binary data and 0 otherwise. "col" may be specified as the column name or number.
| sqlrcur_getColumnIsNullable | ( | $sqlrcurref, | |
| $col ) |
Returns 1 if the specified column can contain nulls and 0 otherwise. "col" may be specified as the column name or number.
| sqlrcur_getColumnIsPartOfKey | ( | $sqlrcurref, | |
| $col ) |
Returns 1 if the specified column is part of a composite key and 0 otherwise. "col" may be specified as the column name or number.
| sqlrcur_getColumnIsPrimaryKey | ( | $sqlrcurref, | |
| $col ) |
Returns 1 if the specified column is a primary key and 0 otherwise. "col" may be specified as the column name or number.
| sqlrcur_getColumnIsUnique | ( | $sqlrcurref, | |
| $col ) |
Returns 1 if the specified column is unique and 0 otherwise. "col" may be specified as the column name or number.
| sqlrcur_getColumnIsUnsigned | ( | $sqlrcurref, | |
| $col ) |
Returns 1 if the specified column is an unsigned number and 0 otherwise. "col" may be specified as the column name or number.
| sqlrcur_getColumnIsZeroFilled | ( | $sqlrcurref, | |
| $col ) |
Returns 1 if the specified column was created with the zero-fill flag and 0 otherwise. "col" may be specified as the column name or number.
| sqlrcur_getColumnLength | ( | $sqlrcurref, | |
| $col ) |
Returns the number of bytes required on the server to store the data for the specified column. "col" may be specified as the column name or number.
| sqlrcur_getColumnList | ( | $sqlrcurref, | |
| $table, | |||
| $wild ) |
Generates a result set containing the columns of "table", which match the pattern "columns".
The result set will contain the following columns:
If "columns" is empty or NULL then a list of all columns of "table" will be returned.
If SQL Relay doesn't support getting a list of columns for the current database backend (or the database doesn't) then an empty result set will be returned.
| sqlrcur_getColumnName | ( | $sqlrcurref, | |
| $col ) |
Returns the name of the specified column.
| sqlrcur_getColumnNames | ( | $sqlrcurref | ) |
Returns an array of the column names of the current result set.
| sqlrcur_getColumnPrecision | ( | $sqlrcurref, | |
| $col ) |
Returns the precision of the specified column. Precision is the total number of digits in a number. eg: 123.45 has a precision of 5. For non-numeric types, it's the number of characters in the string. "col" may be specified as the column name or number.
| sqlrcur_getColumnScale | ( | $sqlrcurref, | |
| $col ) |
Returns the scale of the specified column. Scale is the total number of digits to the right of the decimal point in a number. eg: 123.45 has a scale of 2. "col" may be specified as the column name or number.
| sqlrcur_getColumnType | ( | $sqlrcurref, | |
| $col ) |
Returns the type of the specified column. "col" may be specified as the column name or number.
| sqlrcur_getDatabaseList | ( | $sqlrcurref, | |
| $wild ) |
Generates a result set containing databases that match the pattern "databases".
The result set will contain the following columns:
If "databases" is empty or NULL then a result set containing all databases will be returned.
May actually return a result set of catalogs or schemas, depending on whether the backend database equates "database" with catalog or schema.
See getDatabaseIsSchema().
If SQL Relay doesn't support getting a list of databases for the current database backend (or the database doesn't) then an empty result set will be returned.
| sqlrcur_getField | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Returns the specified field as a string. "col" may be specified as the column name or number.
| sqlrcur_getFieldAsBoolean | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Returns the specified field as a boolean. "col" may be specified as the column name or number.
| sqlrcur_getFieldAsBooleanIgnoringCase | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Returns the specified field as a boolean, ignoring case of "col".
| sqlrcur_getFieldAsDateDay | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Interprets the specified field as a date and returns the day component. "col" may be specified as the column name or number.
| sqlrcur_getFieldAsDateDayIgnoringCase | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Interprets the specified field as a date and returns the day component, ignoring case of "col".
| sqlrcur_getFieldAsDateHour | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Interprets the specified field as a date and returns the hour component. "col" may be specified as the column name or number.
| sqlrcur_getFieldAsDateHourIgnoringCase | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Interprets the specified field as a date and returns the hour component, ignoring case of "col".
| sqlrcur_getFieldAsDateIsNegative | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Interprets the specified field as a date and returns whether the hour component is negative. "col" may be specified as the column name or number.
| sqlrcur_getFieldAsDateIsNegativeIgnoringCase | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Interprets the specified field as a date and returns whether the hour component is negative, ignoring case of "col".
| sqlrcur_getFieldAsDateMicrosecond | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Interprets the specified field as a date and returns the microsecond component. "col" may be specified as the column name or number.
| sqlrcur_getFieldAsDateMicrosecondIgnoringCase | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Interprets the specified field as a date and returns the microsecond component, ignoring case of "col".
| sqlrcur_getFieldAsDateMinute | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Interprets the specified field as a date and returns the minute component. "col" may be specified as the column name or number.
| sqlrcur_getFieldAsDateMinuteIgnoringCase | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Interprets the specified field as a date and returns the minute component, ignoring case of "col".
| sqlrcur_getFieldAsDateMonth | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Interprets the specified field as a date and returns the month component. "col" may be specified as the column name or number.
| sqlrcur_getFieldAsDateMonthIgnoringCase | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Interprets the specified field as a date and returns the month component, ignoring case of "col".
| sqlrcur_getFieldAsDateSecond | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Interprets the specified field as a date and returns the second component. "col" may be specified as the column name or number.
| sqlrcur_getFieldAsDateSecondIgnoringCase | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Interprets the specified field as a date and returns the second component, ignoring case of "col".
| sqlrcur_getFieldAsDateYear | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Interprets the specified field as a date and returns the year component. "col" may be specified as the column name or number.
| sqlrcur_getFieldAsDateYearIgnoringCase | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Interprets the specified field as a date and returns the year component, ignoring case of "col".
| sqlrcur_getFieldAsDouble | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Returns the specified field as a decimal. "col" may be specified as the column name or number.
| sqlrcur_getFieldAsDoubleIgnoringCase | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Returns the specified field as a decimal, ignoring case of "col".
| sqlrcur_getFieldAsInteger | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Returns the specified field as an integer. "col" may be specified as the column name or number.
| sqlrcur_getFieldAsIntegerIgnoringCase | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Returns the specified field as an integer, ignoring case of "col".
| sqlrcur_getFieldIgnoringCase | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Returns the specified field as a string, ignoring the case of "col". "col" must be a column name.
| sqlrcur_getFieldLength | ( | $sqlrcurref, | |
| $row, | |||
| $col ) |
Returns the length of the specified field. "col" may be specified as the column name or number.
| sqlrcur_getKeyAndIndexList | ( | $sqlrcurref, | |
| $table, | |||
| $wild ) |
Generates a result set containing the keys and indexes of "table", which match the pattern "qualifier".
The result set will contain the following columns:
If "qualifier" is empty or NULL then a result set containing all keys and indexes of "table" will be returned.
If SQL Relay doesn't support getting a list of keys and indexes for the current database backend (or the database doesn't) then an empty result set will be returned.
| sqlrcur_getLongest | ( | $sqlrcurref, | |
| $col ) |
Returns the length of the longest field in the specified column. "col" may be specified as the column name or number.
| sqlrcur_getNullsAsEmptyStrings | ( | $sqlrcurref | ) |
Tells the connection to return NULL fields and output bind variables as empty strings. This is the default.
| sqlrcur_getNullsAsNulls | ( | $sqlrcurref | ) |
Tells the connection to return NULL fields and output bind variables as NULL's rather than as empty strings.
| sqlrcur_getOutputBindBlob | ( | $sqlrcurref, | |
| $variable ) |
Get the value stored in a previously defined binary lob output bind variable.
| sqlrcur_getOutputBindClob | ( | $sqlrcurref, | |
| $variable ) |
Get the value stored in a previously defined character lob output bind variable.
| sqlrcur_getOutputBindCursor | ( | $sqlrcurref, | |
| $variable ) |
Get the cursor associated with a previously defined output bind variable.
| sqlrcur_getOutputBindDateDay | ( | $sqlrcurref, | |
| $variable ) |
Get the day from a previously defined date output bind variable.
| sqlrcur_getOutputBindDateHour | ( | $sqlrcurref, | |
| $variable ) |
Get the hour from a previously defined date output bind variable.
| sqlrcur_getOutputBindDateIsNegative | ( | $sqlrcurref, | |
| $variable ) |
Get whether the value is negative from a previously defined date output bind variable.
| sqlrcur_getOutputBindDateMicrosecond | ( | $sqlrcurref, | |
| $variable ) |
Get the microsecond from a previously defined date output bind variable.
| sqlrcur_getOutputBindDateMinute | ( | $sqlrcurref, | |
| $variable ) |
Get the minute from a previously defined date output bind variable.
| sqlrcur_getOutputBindDateMonth | ( | $sqlrcurref, | |
| $variable ) |
Get the month from a previously defined date output bind variable.
| sqlrcur_getOutputBindDateSecond | ( | $sqlrcurref, | |
| $variable ) |
Get the second from a previously defined date output bind variable.
| sqlrcur_getOutputBindDateTz | ( | $sqlrcurref, | |
| $variable ) |
Get the time zone from a previously defined date output bind variable.
| sqlrcur_getOutputBindDateYear | ( | $sqlrcurref, | |
| $variable ) |
Get the year from a previously defined date output bind variable.
| sqlrcur_getOutputBindDouble | ( | $sqlrcurref, | |
| $variable ) |
Get the value stored in a previously defined decimal output bind variable.
| sqlrcur_getOutputBindInteger | ( | $sqlrcurref, | |
| $variable ) |
Get the value stored in a previously defined integer output bind variable.
| sqlrcur_getOutputBindLength | ( | $sqlrcurref, | |
| $variable ) |
Get the length of the value stored in a previously defined output bind variable.
| sqlrcur_getOutputBindString | ( | $sqlrcurref, | |
| $variable ) |
Get the value stored in a previously defined string output bind variable.
| sqlrcur_getPrimaryKeysList | ( | $sqlrcurref, | |
| $table, | |||
| $wild ) |
Generates a result set containing the primary keys of "table", which match the pattern "columns".
The result set will contain the following columns:
If "columns" is empty or NULL then a result set containing all primary keys of "table" will be returned.
If SQL Relay doesn't support getting a list of primary keys for the current database backend (or the database doesn't) then an empty result set will be returned.
| sqlrcur_getProcedureList | ( | $sqlrcurref, | |
| $wild ) |
Generates a result set containing procedures that match the pattern "procedures".
The result set will contain the following columns:
If "procedures" is empty or NULL then a result set containing all procedures in the current database/schema will be returned.
If SQL Relay doesn't support getting a list of procedures for the current database backend (or the database doesn't) then an empty result set will be returned.
| sqlrcur_getProcedureParameterList | ( | $sqlrcurref, | |
| $procedure, | |||
| $wild ) |
Generates a result set containing the parameters of "procedure", which match the pattern "parameters".
The result set will contain the following columns:
If "parameters" is empty or NULL then a result set containing all parameters of "procedure" will be returned.
If SQL Relay doesn't support getting a list of procedure parameters for the current database backend (or the database doesn't) then an empty result set will be returned.
| sqlrcur_getResultSetBufferSize | ( | $sqlrcurref | ) |
Returns the number of result set rows that will be buffered at a time or 0 for the entire result set.
| sqlrcur_getResultSetId | ( | $sqlrcurref | ) |
Returns the internal ID of this result set. This parameter may be passed to another cursor for use in the resumeResultSet() method. Note: The value this method returns is only valid after a call to suspendResultSet().
| sqlrcur_getRow | ( | $sqlrcurref, | |
| $row ) |
Returns an array of the values of the fields in the specified row.
| sqlrcur_getRowAssoc | ( | $sqlrcurref, | |
| $row ) |
Returns an associative array of the values of the fields in the specified row.
| sqlrcur_getRowLengths | ( | $sqlrcurref, | |
| $row ) |
Returns an array of the lengths of the fields in the specified row.
| sqlrcur_getRowLengthsAssoc | ( | $sqlrcurref, | |
| $row ) |
Returns an associative array of the lengths of the fields in the specified row.
| sqlrcur_getSchemaList | ( | $sqlrcurref, | |
| $wild ) |
Generates a result set containing schemas that match the pattern "schemas".
The result set will contain the following columns:
(The column name is a bit of a misnomer, the results are schemas, not databases.)
If "schemas" is empty or NULL then a result set containing all schemas in the current database will be returned.
If SQL Relay doesn't support getting a list of schemas for the current database backend (or the database doesn't) then an empty result set will be returned.
| sqlrcur_getTableList | ( | $sqlrcurref, | |
| $wild ) |
Generates a result set containing the tables in the current database and schema that match the pattern "tables".
The result set will contain the following columns:
If "tables" is empty or NULL then a result set containing all tables in the current database/schema will be returned.
If SQL Relay doesn't support getting a list of tables for the current database backend (or the database doesn't) then an empty result set will be returned.
| sqlrcur_getTableTypeList | ( | $sqlrcurref | ) |
Generates a result set containing supported table types.
The result set will contain the following columns:
If SQL Relay doesn't support getting a list of table types for the current database backend (or the database doesn't) then an empty result set will be returned.
| sqlrcur_getTypeInfoList | ( | $sqlrcurref, | |
| $type ) |
Generates a result set containing data type information for "type".
The result set will contain the following columns:
If "type" is empty or NULL then a result set containing all data types in the current databas/schema will be returned.
If SQL Relay doesn't support getting type info for the current database backend (or the database doesn't) then an empty result set will be returned.
| sqlrcur_inputBind | ( | $sqlrcurref, | |
| $variable, | |||
| $value, | |||
| $precision, | |||
| $scale ) |
Defines an input bind variable. The value may be a string, integer or decimal. If the value is a decimal, then precision and scale may also be specified. If you don't have the precision and scale then set them both to 0. However in that case you may get unexpected rounding behavior if the server is faking binds.
| sqlrcur_inputBindBlob | ( | $sqlrcurref, | |
| $variable, | |||
| $value, | |||
| $size ) |
Defines a binary lob input bind variable.
| sqlrcur_inputBindClob | ( | $sqlrcurref, | |
| $variable, | |||
| $value, | |||
| $size ) |
Defines a character lob input bind variable.
| sqlrcur_inputBindDate | ( | $sqlrcurref, | |
| $variable, | |||
| $year, | |||
| $month, | |||
| $day, | |||
| $hour, | |||
| $minute, | |||
| $second, | |||
| $microsecond, | |||
| $tz, | |||
| $isnegative ) |
Defines a date input bind variable. "day" and "month" are 1-based.
Some databases distinguish between date, time, and datetime types. For those databases...
"tz" is the timezone abbreviation, and may be left NULL. Most databases ignore "tz".
Set "isnegative" may be set to true to represent a negative time interval. However, few databases support negative time intervals and ignore "isnegative".
| sqlrcur_inputBinds | ( | $sqlrcurref, | |
| $variables, | |||
| $values, | |||
| $precisions, | |||
| $scales ) |
Defines an array of input bind variables. The values may be strings, integers or decimals. If they are decimals, then precisions and scales may also be specified
| sqlrcur_lowerCaseColumnNames | ( | $sqlrcurref | ) |
Columns names are converted to lower case.
| sqlrcur_mixedCaseColumnNames | ( | $sqlrcurref | ) |
Columns names are returned in the same case as they are defined in the database. This is the default.
| sqlrcur_nextResultSet | ( | $sqlrcurref | ) |
Returns 1 and acts like executeQuery() when there is another result set available from the server, 0 otherwise.
| sqlrcur_openCachedResultSet | ( | $sqlrcurref, | |
| $filename ) |
Opens a cached result set. Returns 1 on success and 0 on failure.
| sqlrcur_prepareFileQuery | ( | $sqlrcurref, | |
| $path, | |||
| $filename ) |
Prepare to execute the contents of "path"/"filename". Returns 1 on success and 0 if the file couldn't be opened.
| sqlrcur_prepareQuery | ( | $sqlrcurref, | |
| $query ) |
Prepare to execute "query".
| sqlrcur_prepareQueryWithLength | ( | $sqlrcurref, | |
| $query, | |||
| $length ) |
Prepare to execute "query" with length "length". This function must be used if the query contains binary data.
| sqlrcur_resumeCachedResultSet | ( | $sqlrcurref, | |
| $id, | |||
| $filename ) |
Resumes a result set previously left open using suspendSession() and continues caching the result set to "filename". Returns 1 on success and 0 on failure.
| sqlrcur_resumeResultSet | ( | $sqlrcurref, | |
| $id ) |
Resumes a result set previously left open using suspendSession(). Returns 1 on success and 0 on failure.
| sqlrcur_rowCount | ( | $sqlrcurref | ) |
Returns the number of rows in the current result set (if the result set is being stepped through, this returns the number of rows processed so far).
| sqlrcur_sendFileQuery | ( | $sqlrcurref, | |
| $path, | |||
| $filename ) |
Sends the query in file "path"/"filename" directly and gets a result set.
| sqlrcur_sendQuery | ( | $sqlrcurref, | |
| $query ) |
Sends "query" directly and gets a result set.
| sqlrcur_sendQueryWithLength | ( | $sqlrcurref, | |
| $query, | |||
| $length ) |
Sends "query" with length "length" directly and gets a result set. This function must be used if the query contains binary data.
| sqlrcur_setCacheTtl | ( | $sqlrcurref, | |
| $ttl ) |
Sets the time-to-live for cached result sets. The sqlr-cachemanger will remove each cached result set "ttl" seconds after it's created, provided it's scanning the directory containing the cache files.
| sqlrcur_setResultSetBufferSize | ( | $sqlrcurref, | |
| $rows ) |
Sets the number of rows of the result set to buffer at a time. 0 (the default) means buffer the entire result set.
| sqlrcur_substitution | ( | $sqlrcurref, | |
| $variable, | |||
| $value, | |||
| $precision, | |||
| $scale ) |
Defines a substitution variable. The value may be a string, integer or decimal. If it is a decimal, then precision and scale may also be specified
| sqlrcur_substitutions | ( | $sqlrcurref, | |
| $variables, | |||
| $values, | |||
| $precisions, | |||
| $scales ) |
Defines an array of substitution variables. The values may be strings, integers or decimals. If they are decimals, then precisions and scales may also be specified
| sqlrcur_suspendResultSet | ( | $sqlrcurref | ) |
Tells the server to leave this result set open when the connection calls suspendSession() so that another connection can connect to it using resumeResultSet() after it calls resumeSession().
| sqlrcur_totalRows | ( | $sqlrcurref | ) |
Returns the total number of rows that will be returned in the result set. Not all databases support this call. Don't use it for applications which are designed to be portable across databases. 0 is returned by databases which don't support this option.
| sqlrcur_upperCaseColumnNames | ( | $sqlrcurref | ) |
Columns names are converted to upper case.
| sqlrcur_validateBinds | ( | $sqlrcurref | ) |
If you are binding to any variables that might not actually be in your query, call this to ensure that the database won't try to bind them unless they really are in the query. There is a performance penalty for calling this function
| sqlrcur_validBind | ( | $sqlrcurref, | |
| $variable ) |
Returns 1 if "variable" was a valid bind variable of the query and 0 otherwise.