OCIStatementType

OCIStatementType -- OCI 命令の型を返す

説明

string OCIStatementType(int stmt);

OCIStatementType() は次の値のどれかを返します。

  1. "SELECT"

  2. "UPDATE"

  3. "DELETE"

  4. "INSERT"

  5. "CREATE"

  6. "DROP"

  7. "ALTER"

  8. "BEGIN"

  9. "DECLARE"

  10. "UNKNOWN"

例 1. コーディング例

  1 
  2 <?php
  3     print "<HTML><PRE>";
  4     $conn = OCILogon("scott","tiger");
  5     $sql  = "delete from emp where deptno = 10";
  6    
  7     $stmt = OCIParse($conn,$sql);
  8     if ( OCIStatementType($stmt) == "DELETE" ) {
  9         die "You are not allowed to delete from this table<BR>";
 10     }
 11    
 12     OCILogoff($conn);
 13     print "</PRE></HTML>";
 14 ?>
 15