array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'function.oci-statement-type.php', 1 => 'oci_statement_type', ), 'up' => array ( 0 => 'ref.oci8.php', 1 => 'OCI8 Funktionen', ), 'prev' => array ( 0 => 'function.oci-set-prefetch.php', 1 => 'oci_set_prefetch', ), 'next' => array ( 0 => 'function.oci-unregister-taf-callback.php', 1 => 'oci_unregister_taf_callback', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/oci8/functions/oci-statement-type.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5, PHP 7, PHP 8, PECL OCI8 >= 1.1.0)
oci_statement_type — Returns the type of a statement
Returns a keyword identifying the type of the
OCI8 statement
.
Returns the type of statement
as one of the
following strings.
Return String | Notes |
---|---|
ALTER |
|
BEGIN |
|
CALL |
|
CREATE |
|
DECLARE |
|
DELETE |
|
DROP |
|
INSERT |
|
SELECT |
|
UPDATE |
|
UNKNOWN |
Returns false
on error.
Beispiel #1 oci_statement_type() example
<?php
$conn = oci_connect('hr', 'welcome', 'localhost/XE');
$stid = oci_parse($conn, 'DELETE FROM departments WHERE department_id = 130;');
if (oci_statement_type($stid) == "DELETE") {
trigger_error('You are not allowed to delete from this table', E_USER_ERROR);
}
else {
oci_execute($stid); // delete the row
}
oci_free_statement($stid);
oci_close($conn);
?>