PHP 8.6.0 Beta 1 is available for testing

oci_statement_type

(PHP 5, PHP 7, PHP 8, PECL OCI8 >= 1.1.0)

oci_statement_typeDevuelve el tipo de consulta Oracle

Descripción

function oci_statement_type(resource $statement): string |false

Devuelve una palabra clave que identifica el tipo de la consulta statement OCI8.

Parámetros

statement

Un identificador de consulta OCI válido, devuelto por la función oci_parse() .

Valores devueltos

Devuelve el tipo de consulta statement en forma de una de las siguientes cadenas.

Tipo de consulta
Cadena devuelta Notas
ALTER
BEGIN
CALL
CREATE
DECLARE
DELETE
DROP
INSERT
SELECT
UPDATE
UNKNOWN

Devuelve false si ocurre un error.

Ejemplos

Ejemplo #1 Ejemplo con 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('No se está autorizado a borrar líneas en esta tabla', E_USER_ERROR);
}
else {
 oci_execute($stid); // borra la línea
}
oci_free_statement($stid);
oci_close($conn);
?>

Found A Problem?

Learn How To Improve This PageSubmit a Pull RequestReport a Bug
+add a note

User Contributed Notes

There are no user contributed notes for this page.

AltStyle によって変換されたページ (->オリジナル) /