oci_execute()
oci_execute - Executes a statement
Syntax
bool oci_execute (
resource $statement,
int $mode)
Arguments
- statement - A valid OCI statement identifier.
- mode - An optional second parameter can be one of the following constants: Execution Modes Constant Description OCI_COMMIT_ON_SUCCESS Automatically commit all outstanding changes for this connection when the statement has succeeded. This is the default. OCI_DEFAULT Obsolete as of PHP 5.3.2 (PECL OCI8 1.4) but still available for backward compatibility. Use the equivalent OCI_NO_AUTO_COMMIT in new code. OCI_DESCRIBE_ONLY Make query meta data available to functions like oci_field_name() but do not create a result set. Any subsequent fetch call such as oci_fetch_array() will fail. OCI_NO_AUTO_COMMIT Do not automatically commit changes. Prior to PHP 5.3.2 (PECL OCI8 1.4) use OCI_DEFAULT which is an alias for OCI_NO_AUTO_COMMIT. Using OCI_NO_AUTO_COMMIT mode starts a transaction. Transactions are automatically rolled back when the connection is closed, or when the script ends. Explicitly call oci_commit() to commit a transaction, or oci_rollback() to abort it. When inserting or updating data, using transactions is recommended for relational data consistency and for performance reasons. If OCI_NO_AUTO_COMMIT mode is used for any statement including queries, and oci_commit() or oci_rollback() is not subsequently called, then OCI8 will perform a rollback at the end of the script even if no data was changed. To avoid an unnecessary rollback, many scripts do not use OCI_NO_AUTO_COMMIT mode for queries or PL/SQL. Be careful to ensure the appropriate transactional consistency for the application when using oci_execute() with different modes in the same script.
Description
Executes a statement previously returned from oci_parse().
Version
PHP 5, PECL OCI8 >= 1.1.0
Return value
Returns TRUE on success or FALSE on failure.