Oci预处理语句

属性
命名空间 fize\db\realization\oracle\mode\driver\oci
类名 Statement
属性:
名称 说明
mode 执行模式
方法:
方法名 说明
__construct() 构造
__destruct() 析构时释放预处理语句
prototype() 返回资源原型,用于原始操作
bindArrayByName() 将PHP数组var_array绑定到Oracleplaceholder名称,该名称指向Oracle PL/SQLarray。它是用于输入还是用于输出将在运行时确定。
bindByName() 绑定一个 PHP 变量到一个 Oracle 位置标志符
cancel() 中断游标读取数据
defineByName() 在 SELECT 中使用 PHP 变量作为定义的步骤
execute() 执行一条语句
fetchAll() 获取结果数据的所有行到一个数组
fetchArray() 以关联数组或数字数组的形式返回查询的下一行
fetchAssoc() 以关联数组的形式返回查询的下一行
fetchObject() 以对象形式返回查询的下一行
fetchRow() 以数字数组的形式返回查询的下一行
fetch() 获取下一行(对于 SELECT 语句)到内部结果缓冲区。
fieldIsNull() 检查字段是否为 NULL
fieldName() 返回与字段数字索引(从 1 开始)相对应的字段名
fieldPrecision() 返回字段精度
fieldScale() 返回字段范围
fieldSize() 返回字段大小
fieldTypeRaw() 返回字段的原始 Oracle 数据类型
fieldType() 返回字段的数据类型
freeStatement() 释放预备语句
getImplicitResultset() 从具有Oracle数据库12c隐式结果集的父语句资源中返回下一个子语句资源
numFields() 返回结果列的数目
numRows() 返回语句执行后受影响的行数
result() 返回所取得行中字段的值
setPrefetch() 设置预提取行数
statementType() 返回 OCI 语句的类型

属性

mode

修饰符:public
类型:int
默认值:32

方法

__construct()

构造

public function __construct (

    resource &$statement,

    int $mode = null

)
参数:
名称 说明
statement 预处理语句资源对象
mode 执行模式

__destruct()

析构时释放预处理语句

public function __destruct ()

prototype()

返回资源原型,用于原始操作

public function prototype () : resource

bindArrayByName()

将PHP数组var_array绑定到Oracleplaceholder名称,该名称指向Oracle PL/SQLarray。它是用于输入还是用于输出将在运行时确定。

public function bindArrayByName (

    string $name,

    array &$var_array,

    int $max_table_length,

    int $max_item_length = -1,

    int $type = 96

) : bool
参数:
名称 说明
name 占位符
var_array 数组
max_table_length 设置传入和结果数组的最大长度。
max_item_length 设置数组项的最大长度。如果未指定或等于-1,oci_bind_array_by_name()将在传入数组中查找longestelement,并将其用作最大长度。
type 应该用于设置PL/SQL数组项的类型

bindByName()

绑定一个 PHP 变量到一个 Oracle 位置标志符

public function bindByName (

    string $bv_name,

    mixed $variable,

    int $maxlength = -1,

    int $type = 1

) : bool
参数:
名称 说明
bv_name 占位符
variable 变量
maxlength 设置最大长度。
type 要使用什么样的描述符

cancel()

中断游标读取数据

public function cancel () : bool

defineByName()

在 SELECT 中使用 PHP 变量作为定义的步骤

public function defineByName (

    string $column_name,

    mixed &$variable,

    int $type = null

) : bool
参数:
名称 说明
column_name 列名
variable 要绑定的变量
type 列类型

execute()

执行一条语句

public function execute (

    int $mode = null

) : bool
参数:
名称 说明
mode 执行模式

fetchAll()

获取结果数据的所有行到一个数组

public function fetchAll (

    array &$output,

    int $skip = 0,

    int $maxrows = -1,

    int $flags = 16

) : int
参数:
名称 说明
output 得到的数据数组
skip 偏移量
maxrows 返回数量,-1表示不显示
flags 标识参数
返回值:

失败时返回false

fetchArray()

以关联数组或数字数组的形式返回查询的下一行

public function fetchArray (

    int $mode = 3

) : array
参数:
名称 说明
mode 模式

fetchAssoc()

以关联数组的形式返回查询的下一行

public function fetchAssoc () : array

fetchObject()

以对象形式返回查询的下一行

public function fetchObject () : object

fetchRow()

以数字数组的形式返回查询的下一行

public function fetchRow () : array

fetch()

获取下一行(对于 SELECT 语句)到内部结果缓冲区。

public function fetch () : bool

fieldIsNull()

检查字段是否为 NULL

public function fieldIsNull (

    mixed $field

) : bool
参数:
名称 说明
field 字段的索引或字段名(大写字母)。

fieldName()

返回与字段数字索引(从 1 开始)相对应的字段名

public function fieldName (

    int $field

) : string
参数:
名称 说明
field 字段数字索引(从 1 开始)

fieldPrecision()

返回字段精度

public function fieldPrecision (

    int $field

) : int
参数:
名称 说明
field 索引(从 1 开始)

fieldScale()

返回字段范围

public function fieldScale (

    int $field

) : int
参数:
名称 说明
field 索引(从 1 开始)

fieldSize()

返回字段大小

public function fieldSize (

    int $field

) : int
参数:
名称 说明
field 索引(从 1 开始)

fieldTypeRaw()

返回字段的原始 Oracle 数据类型

public function fieldTypeRaw (

    int $field

) : int
参数:
名称 说明
field 索引(从 1 开始)

fieldType()

返回字段的数据类型

public function fieldType (

    int $field

) : mixed
参数:
名称 说明
field 索引(从 1 开始)

freeStatement()

释放预备语句

public function freeStatement () : bool

getImplicitResultset()

从具有Oracle数据库12c隐式结果集的父语句资源中返回下一个子语句资源

public function getImplicitResultset () : $this|bool
返回值:没有下一个语句时返回false

numFields()

返回结果列的数目

public function numFields () : int

numRows()

返回语句执行后受影响的行数

public function numRows () : int

result()

返回所取得行中字段的值

public function result (

    mixed $field

) : mixed
参数:
名称 说明
field 字段名或下标(从1开始)

setPrefetch()

设置预提取行数

public function setPrefetch (

    int $rows

) : bool
参数:
名称 说明
rows 预提取行数

statementType()

返回 OCI 语句的类型

public function statementType () : string