*oci_statement_type* -- Returns the type of a statement

  string oci_statement_type(resource statement)~

Returns a keyword identifying the type of the OCI8 {statement}.

{statement} A valid OCI8 statement identifier from |oci_parse|.

Returns the type of {statement} as one of the following strings. Statement
type Return String Notes ALTER &nbsp; BEGIN &nbsp; CALL Introduced in PHP
5.2.1 (PECL OCI8 1.2.3) CREATE &nbsp; DECLARE &nbsp; DELETE &nbsp; DROP &nbsp;
INSERT &nbsp; SELECT &nbsp; UPDATE &nbsp; UNKNOWN &nbsp;

Returns FALSE on error.

|oci_statement_type| example

<?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);
?>





In PHP versions before 5.0.0 you must use |ocistatementtype| instead. The old
function name can still be used in current versions, however it is deprecated
and not recommended.

vim:ft=help:
