array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'es', ), 'this' => array ( 0 => 'function.oci-statement-type.php', 1 => 'oci_statement_type', ), 'up' => array ( 0 => 'ref.oci8.php', 1 => 'Funciones de OCI8', ), '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' => 'es', '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 — Devuelve el tipo de una sentencia
Devuelve una palabra clave que identifica el tipo de la sentencia de
OCI8 dada por statement
.
Devuelve el tipo de statement
como una de las
siguientes cadenas.
Cadena devuelta | Notas |
---|---|
ALTER |
|
BEGIN |
|
CALL |
Introducido en PHP 5.2.1 (PECL OCI8 1.2.3) |
CREATE |
|
DECLARE |
|
DELETE |
|
DROP |
|
INSERT |
|
SELECT |
|
UPDATE |
|
UNKNOWN |
Devuelve false
en caso de error.
Ejemplo #1 Ejemplo de oci_statement_type()
<?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); // eliminar la fila
}
oci_free_statement($stid);
oci_close($conn);
?>