Home > PHP > Function > OCI8 > oci_define_by_name()

oci_define_by_name()

oci_define_by_name - Associates a PHP variable with a column for query fetches

Syntax

bool oci_define_by_name (resource $statement, string $column_name, mixed &$variable, int $type)

Arguments

  • statement - A valid OCI8 statement identifier created by oci_parse() and executed by oci_execute(), or a REF CURSORstatement identifier.
  • column_name - 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.
  • variable - 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_INTwill 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.

Description

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

Version

PHP 5, PECL OCI8 >= 1.1.0

Return value

Returns TRUE on success or FALSE on failure.