(PHP 5, PHP 7, PHP 8, PECL OCI8 >= 1.1.0)
oci_statement_type — Retorna o tipo de uma instrução
Retorna uma palavra-chave que identifica o tipo da
instrução do OCI8 informada em statement
.
Retorna o tipo da instrução informada em statement
como uma das
seguintes strings.
String de retorno | Notas |
---|---|
ALTER |
|
BEGIN |
|
CALL |
|
CREATE |
|
DECLARE |
|
DELETE |
|
DROP |
|
INSERT |
|
SELECT |
|
UPDATE |
|
UNKNOWN |
Retorna false
em caso de erro.
Exemplo #1 Exemplo 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); // exclui a linha
}
oci_free_statement($stid);
oci_close($conn);
?>