PHP Function OCI_Execute
php function oci_execute is an OCI8 extension module call that executes an SQL statement in the database. It sends the result of the query to the Web server and returns an HTML message if it was successful.
You must first connect to the database using the oci_connect() function and prepare an Oracle statement to select rows of data by calling the oci_parse(connection, query) function. Then, you can bind the SQL statement to PHP variables using the oci_bind_by_name() function. After binding the variable to the :journal bind variable, you can run the SQL statement by calling the oci_execute(statement) function. After the statement has executed, you can fetch all of the rows that the statement returned to PHP with the oci_fetch_all() function.
When you bind an IN or OUT parameter to a PHP variable with oci_bind_by_name(), the length of the data that you bind must match or exceed the size of the corresponding column in the Oracle database. Otherwise, unexpected results may occur when you run the procedure in PHP.
In some cases, you can use the oci_error() function to obtain an array with error code, message, offset and SQL text. You can also get the error for a particular session or cursor handle by supplying that handle to the oci_error() function.
When you execute a statement in the database, the oci_execute() function automatically commits any outstanding transaction on the connection it uses. However, you can prevent it from doing that by specifying OCI_COMMIT_ON_SUCCESS or OCI_DEFAULT as the second argument of oci_execute(). You can then use the oci_commit() and oci_rollback() functions to control the behavior of the transaction.