oci_define_by_name

PHP 5, PHP 7, PHP 8, PECL OCI8 >= 1.1.0
oci_define_by_name - Associates a PHP variable with a column for query fetches
Manual
Code Examples

oci_define_by_name( resource$statement, string$column, mixedvar, [int$type = 0] ): bool

Associates a PHP variable with a column for query fetches using oci_fetch.

The oci_define_by_name call must occur before executing oci_execute.

Parameters

statement

A valid OCI8 statement identifier created by oci_parse and executed by oci_execute, or a REF CURSOR statement identifier.

column

The column name used in the query.

Use uppercase for Oracle's default, non-case sensitive column names. Use the exact column name case for case-sensitive column names.

var

The PHP variable that will contain the returned column value.

type

The data type to be returned. Generally not needed. Note that Oracle-style data conversions are not performed. For example, SQLT_INT will be ignored and the returned data type will still be SQLT_CHR.

You can optionally use oci_new_descriptor to allocate LOB/ROWID/BFILE descriptors.

Return Values

Returns true on success or false on failure.

Related Functions

Example of oci_define_by_name

Show all examples for oci_define_by_name

PHP Version:


Function oci_define_by_name:

Oracle OCI8 Functions

Most used PHP functions