array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'function.oci-statement-type.php', 1 => 'oci_statement_type', ), 'up' => array ( 0 => 'ref.oci8.php', 1 => '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' => 'ja', '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 — ステートメントの種類を返す
ステートメント 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('このテーブルを削除する権限がありません', E_USER_ERROR);
}
else {
oci_execute($stid); // 行を削除します
}
oci_free_statement($stid);
oci_close($conn);
?>