oci_statement_type

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

oci_statement_type锟斤拷锟斤拷 OCI 锟斤拷锟斤拷锟斤拷锟斤拷

说锟斤拷

oci_statement_type ( resource $statement ) : string

oci_statement_type() 锟斤拷锟斤拷锟斤拷锟� statement 锟侥诧拷询锟斤拷锟酵o拷锟斤拷值为锟斤拷锟斤拷之一锟斤拷

  1. SELECT
  2. UPDATE
  3. DELETE
  4. INSERT
  5. CREATE
  6. DROP
  7. ALTER
  8. BEGIN
  9. DECLARE
  10. UNKNOWN

statement 锟斤拷锟斤拷锟斤拷一锟斤拷锟斤拷 oci_parse() 锟斤拷锟斤拷锟截碉拷锟斤拷效锟斤拷 OCI 锟斤拷锟斤拷识锟斤拷锟斤拷

Example #1 oci_statement_type() 锟斤拷锟斤拷

<?php
    $conn 
oci_connect("scott""tiger");
    
$sql  "delete from emp where deptno = 10";

    
$stmt oci_parse($conn$sql);
    if (
oci_statement_type($stmt) == "DELETE") {
        die(
"You are not allowed to delete from this table<br />");
    }

    
oci_close($conn);
?>

oci_statement_type() 锟节筹拷锟斤拷时锟斤拷锟斤拷 FALSE锟斤拷

Note:

锟斤拷 PHP 5.0.0 之前锟侥版本锟斤拷锟斤拷使锟斤拷 ocistatementtype() 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷煤锟斤拷锟斤拷锟斤拷锟饺伙拷锟斤拷茫锟轿拷锟斤拷录锟斤拷锟斤拷锟轿� oci_statement_type() 锟侥憋拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟窖憋拷锟斤拷锟斤拷锟斤拷锟斤拷锟狡硷拷使锟矫★拷