导航首页 » 技术教程 » PHP:oci_statement_type()的用法_Oracle函数
PHP:oci_statement_type()的用法_Oracle函数 152 2023-12-12   

oci_statement_type

(PHP 5, PECL OCI8 >= 1.1.0)

oci_statement_type — 返回 OCI 语句的类型

说明

string oci_statement_type ( resource $statement )

oci_statement_type() 返回语句 statement 的查询类型,其值为下列之一: SELECT UPDATE DELETE INSERT CREATE DROP ALTER BEGIN DECLARE 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() 的别名。不过其已被废弃,不推荐使用。


!!!站长长期在线接!!!

网站、小程序:定制开发/二次开发/仿制开发等

各种疑难杂症解决/定制接口/定制采集等

站长微信:lxwl520520

站长QQ:1737366103