(PHP 5, PHP 7, PHP 8, PECL OCI8 >= 1.1.0)
oci_statement_type — 返回语句的类型
返回 statement
类型,可能为以下字符串之一。
返回字符串 | 说明 |
---|---|
ALTER |
|
BEGIN |
|
CALL |
|
CREATE |
|
DECLARE |
|
DELETE |
|
DROP |
|
INSERT |
|
SELECT |
|
UPDATE |
|
UNKNOWN |
错误时返回 false
。
示例 #1 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); // delete the row
}
oci_free_statement($stid);
oci_close($conn);
?>