mirror of
https://github.com/php/doc-en.git
synced 2026-03-23 23:32:18 +01:00
ibm_db2: fix XML by converting para to simpara tags via script (#5136)
This commit is contained in:
committed by
GitHub
parent
17b3531ad4
commit
020edc73be
@@ -1,28 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<book xml:id="book.ibm-db2" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<book xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="book.ibm-db2">
|
||||
<?phpdoc extension-membership="pecl" ?>
|
||||
<title>IBM DB2, Cloudscape and Apache Derby</title>
|
||||
<titleabbrev>IBM DB2</titleabbrev>
|
||||
|
||||
|
||||
<!-- {{{ preface -->
|
||||
<preface xml:id="intro.ibm-db2">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
<simpara>
|
||||
These functions enable you to access IBM DB2 Universal Database, IBM
|
||||
Cloudscape, and Apache Derby databases using the DB2 Call Level Interface
|
||||
(DB2 CLI).
|
||||
</para>
|
||||
</simpara>
|
||||
</preface>
|
||||
<!-- }}} -->
|
||||
|
||||
|
||||
&reference.ibm-db2.setup;
|
||||
&reference.ibm-db2.constants;
|
||||
&reference.ibm-db2.reference;
|
||||
|
||||
</book>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
@@ -43,4 +41,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!-- $Revision$ -->
|
||||
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="ibm-db2.installation">
|
||||
&reftitle.install;
|
||||
<para>
|
||||
<simpara>
|
||||
To build the ibm_db2 extension, the DB2 application development header files
|
||||
and libraries must be installed on the system.
|
||||
DB2 does not install these by default, so it may be necessary to return to the
|
||||
@@ -10,13 +10,13 @@
|
||||
The DB2 Application Development Client includes the header files and is freely
|
||||
available for download from the IBM DB2 Universal Database
|
||||
<link xlink:href="&url.ibm.db2.client;">support site</link>.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
If the DB2 application development header files and libraries are added to a
|
||||
Linux or Unix operating system on which DB2 was already installed, the command
|
||||
<command>db2iupdt -e</command> must be issued to update the symbolic links to
|
||||
the header files and libraries in the DB2 instances.
|
||||
</para>
|
||||
</simpara>
|
||||
<para>
|
||||
ibm_db2 is a &link.pecl; extension, so follow the instructions in
|
||||
<xref linkend="install.pecl"/> to install the ibm_db2 extension for PHP.
|
||||
@@ -32,10 +32,10 @@ bash$ ./configure --with-IBM_DB2=/path/to/DB2
|
||||
</para>
|
||||
<note>
|
||||
<title>Note for IIS users</title>
|
||||
<para>
|
||||
<simpara>
|
||||
If the ibm_db2 driver is being used with Microsoft Internet Information
|
||||
Server (IIS), it may be necessary to do the following:
|
||||
</para>
|
||||
</simpara>
|
||||
<simplelist>
|
||||
<member>
|
||||
Install DB2 with extended operating system security.
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
<methodparam choice="opt"><type>int</type><parameter>value</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Sets or gets the AUTOCOMMIT behavior of the specified connection resource.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -26,10 +26,10 @@
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid database connection resource variable as returned from
|
||||
<function>db2_connect</function> or <function>db2_pconnect</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
@@ -41,17 +41,17 @@
|
||||
<varlistentry>
|
||||
<term><constant>DB2_AUTOCOMMIT_OFF</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Turns AUTOCOMMIT off.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><constant>DB2_AUTOCOMMIT_ON</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Turns AUTOCOMMIT on.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -62,21 +62,21 @@
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
When <function>db2_autocommit</function> receives only the
|
||||
<parameter>connection</parameter> parameter, it returns the current state
|
||||
of AUTOCOMMIT for the requested connection as an integer value. A value of
|
||||
<constant>DB2_AUTOCOMMIT_OFF</constant> indicates that AUTOCOMMIT is off,
|
||||
while a value of <constant>DB2_AUTOCOMMIT_ON</constant> indicates that
|
||||
AUTOCOMMIT is on.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
When <function>db2_autocommit</function> receives both the
|
||||
<parameter>connection</parameter> parameter and
|
||||
<parameter>autocommit</parameter> parameter, it attempts to set the
|
||||
AUTOCOMMIT state of the requested connection to the corresponding state.
|
||||
&return.success;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
@@ -84,11 +84,11 @@
|
||||
<para>
|
||||
<example>
|
||||
<title>Retrieving the AUTOCOMMIT value for a connection</title>
|
||||
<para>
|
||||
<simpara>
|
||||
In the following example, a connection which has been created with
|
||||
AUTOCOMMIT turned off is tested with the
|
||||
<function>db2_autocommit</function> function.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -112,10 +112,10 @@ if ($ac == DB2_AUTOCOMMIT_OFF) {
|
||||
</example>
|
||||
<example>
|
||||
<title>Setting the AUTOCOMMIT value for a connection</title>
|
||||
<para>
|
||||
<simpara>
|
||||
In the following example, a connection which was initially created with
|
||||
AUTOCOMMIT turned off has its behavior changed to turn AUTOCOMMIT on.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
<methodparam choice="opt"><type>int</type><parameter>scale</parameter><initializer>0</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Binds a PHP variable to an SQL statement parameter in a statement resource
|
||||
returned by <function>db2_prepare</function>. This function gives you more
|
||||
control over the parameter type, data type, precision, and scale for the
|
||||
parameter than simply passing the variable as part of the optional input
|
||||
array to <function>db2_execute</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -35,33 +35,33 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A prepared statement returned from <function>db2_prepare</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>parameter_number</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Specifies the 1-indexed position of the parameter in the prepared
|
||||
statement.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>variable_name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A string specifying the name of the PHP variable to bind to the
|
||||
parameter specified by <parameter>parameter_number</parameter>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>parameter_type</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A constant specifying whether the PHP variable should be bound to the
|
||||
SQL parameter as an input parameter (<constant>DB2_PARAM_IN</constant>),
|
||||
an output parameter (<constant>DB2_PARAM_OUT</constant>), or as a
|
||||
@@ -70,49 +70,49 @@
|
||||
also specify <constant>DB2_PARAM_FILE</constant> to bind the PHP variable
|
||||
to the name of a file that contains large object (BLOB, CLOB, or DBCLOB)
|
||||
data.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>data_type</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A constant specifying the SQL data type that the PHP variable should be
|
||||
bound as: one of <constant>DB2_BINARY</constant>,
|
||||
<constant>DB2_CHAR</constant>, <literal>DB2_DOUBLE</literal>, or
|
||||
<constant>DB2_LONG</constant> .
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>precision</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Specifies the precision with which the variable should be bound to the
|
||||
database. This parameter can also be used for retrieving XML output values
|
||||
from stored procedures. A non-negative value specifies the maximum size of
|
||||
the XML data that will be retrieved from the database. If this parameter
|
||||
is not used, a default of 1MB will be assumed for retrieving the XML
|
||||
output value from the stored procedure.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>scale</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Specifies the scale with which the variable should be bound to the
|
||||
database.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
@@ -120,7 +120,7 @@
|
||||
<para>
|
||||
<example>
|
||||
<title>Binding PHP variables to a prepared statement</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The SQL statement in the following example uses two input parameters in
|
||||
the WHERE clause. We call <function>db2_bind_param</function> to bind two
|
||||
PHP variables to the corresponding SQL parameters. Notice that the PHP
|
||||
@@ -132,7 +132,7 @@
|
||||
<function>db2_bind_param</function>. The variables must be bound and, for
|
||||
parameters that accept input, must have any value assigned, before calling
|
||||
<function>db2_execute</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -175,23 +175,23 @@ Peaches, dog, 12.3
|
||||
three different parameters:
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
an input (IN) parameter that accepts the name of the first animal as
|
||||
input
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
an input-output (INOUT) parameter that accepts the name of the second
|
||||
animal as input and returns the string <literal>TRUE</literal> if an
|
||||
animal in the database matches that name
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
an output (OUT) parameter that returns the sum of the weight of the
|
||||
two identified animals
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
In addition, the stored procedure returns a result set consisting of the
|
||||
@@ -248,14 +248,14 @@ Results:
|
||||
</example>
|
||||
<example>
|
||||
<title>Inserting a binary large object (BLOB) directly from a file</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The data for large objects are typically stored in files, such as XML
|
||||
documents or audio files. Rather than reading an entire file into a PHP
|
||||
variable, and then binding that PHP variable into an SQL statement, you
|
||||
can avoid some memory overhead by binding the file directly to the input
|
||||
parameter of your SQL statement. The following example demonstrates how
|
||||
to bind a file directly into a BLOB column.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -77,25 +77,25 @@
|
||||
<varlistentry>
|
||||
<term>MINIMUM</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Supports the minimum ODBC SQL grammar.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>CORE</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Supports the core ODBC SQL grammar.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>EXTENDED</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Supports extended ODBC SQL grammar.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -124,18 +124,18 @@
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Specifies an active DB2 client connection.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns an object on a successful call,&return.falseforfailure;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<!-- Use when ERRORS exist
|
||||
@@ -175,10 +175,10 @@
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>A <function>db2_client_info</function> example</title>
|
||||
<para>
|
||||
<simpara>
|
||||
To retrieve information about the client, you must pass a valid
|
||||
database connection resource to <function>db2_client_info</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[<?php
|
||||
$conn = db2_connect( 'SAMPLE', 'db2inst1', 'ibmdb2' );
|
||||
|
||||
@@ -15,16 +15,16 @@
|
||||
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
This function closes a DB2 client connection created with
|
||||
<function>db2_connect</function> and returns the corresponding
|
||||
resources to the database server.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
If you attempt to close a persistent DB2 client connection created with
|
||||
<function>db2_pconnect</function>, the close request is ignored and the
|
||||
persistent DB2 client connection remains available for the next caller.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -33,28 +33,28 @@
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Specifies an active DB2 client connection.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Closing a connection</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The following example demonstrates a successful attempt to close a
|
||||
connection to an IBM DB2, Cloudscape, or Apache Derby database.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
</methodsynopsis>
|
||||
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a result set listing the columns and associated privileges for a
|
||||
table.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -32,45 +32,45 @@
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid connection to an IBM DB2, Cloudscape, or Apache Derby database.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>qualifier</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A qualifier for DB2 databases running on OS/390 or z/OS servers. For
|
||||
other databases, pass &null; or an empty string.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>schema</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The schema which contains the tables. To match all schemas, pass &null;
|
||||
or an empty string.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>table_name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The name of the table or view. To match all tables in the database,
|
||||
pass &null; or an empty string.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>column_name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The name of the column. To match all columns in the table, pass &null;
|
||||
or an empty string.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>column_name</parameter><initializer>&null;</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a result set listing the columns and associated metadata for a
|
||||
table.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -31,45 +31,45 @@
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid connection to an IBM DB2, Cloudscape, or Apache Derby database.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>qualifier</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A qualifier for DB2 databases running on OS/390 or z/OS servers. For
|
||||
other databases, pass &null; or an empty string.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>schema</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The schema which contains the tables. To match all schemas, pass
|
||||
<literal>'%'</literal>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>table_name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The name of the table or view. To match all tables in the database,
|
||||
pass &null; or an empty string.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>column_name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The name of the column. To match all columns in the table, pass &null;
|
||||
or an empty string.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
</methodsynopsis>
|
||||
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Commits an in-progress transaction on the specified connection resource and
|
||||
begins a new transaction. PHP applications normally default to AUTOCOMMIT
|
||||
mode, so <function>db2_commit</function> is not necessary unless AUTOCOMMIT
|
||||
has been turned off for the connection resource.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -30,19 +30,19 @@
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid database connection resource variable as returned from
|
||||
<function>db2_connect</function> or <function>db2_pconnect</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<!-- Use when examples exist
|
||||
|
||||
@@ -16,18 +16,18 @@
|
||||
</methodsynopsis>
|
||||
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
<function>db2_conn_error</function> returns an SQLSTATE value representing
|
||||
the reason the last attempt to connect to a database failed. As
|
||||
<function>db2_connect</function> returns &false; in the event of a failed
|
||||
connection attempt, you do not pass any parameters to
|
||||
<function>db2_conn_error</function> to retrieve the SQLSTATE value.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
If, however, the connection was successful but becomes invalid over time,
|
||||
you can pass the <parameter>connection</parameter> parameter to retrieve
|
||||
the SQLSTATE value for a specific connection.
|
||||
</para>
|
||||
</simpara>
|
||||
<para>
|
||||
To learn what the SQLSTATE value means, you can issue the following command
|
||||
at a DB2 Command Line Processor prompt:
|
||||
@@ -42,32 +42,32 @@
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A connection resource associated with a connection that initially
|
||||
succeeded, but which over time became invalid.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns the SQLSTATE value resulting from a failed connection attempt.
|
||||
Returns an empty string if there is no error associated with the last
|
||||
connection attempt.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Retrieving an SQLSTATE value for a failed connection attempt</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The following example demonstrates how to return an SQLSTATE value
|
||||
after deliberately passing invalid parameters to
|
||||
<function>db2_connect</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -15,19 +15,19 @@
|
||||
<methodparam choice="opt"><type class="union"><type>resource</type><type>null</type></type><parameter>connection</parameter><initializer>&null;</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
<function>db2_conn_errormsg</function> returns an error message and SQLCODE
|
||||
value representing the reason the last database connection attempt failed.
|
||||
As <function>db2_connect</function> returns &false; in the event of a failed
|
||||
connection attempt, do not pass any parameters to
|
||||
<function>db2_conn_errormsg</function> to retrieve the associated error
|
||||
message and SQLCODE value.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
If, however, the connection was successful but becomes invalid over time,
|
||||
you can pass the <parameter>connection</parameter> parameter to retrieve
|
||||
the associated error message and SQLCODE value for a specific connection.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
@@ -35,33 +35,33 @@
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A connection resource associated with a connection that initially
|
||||
succeeded, but which over time became invalid.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a string containing the error message and SQLCODE value resulting
|
||||
from a failed connection attempt. If there is no error associated with the last
|
||||
connection attempt, <function>db2_conn_errormsg</function> returns an empty
|
||||
string.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Retrieving the error message returned by a failed connection attempt</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The following example demonstrates how to return an error message and
|
||||
SQLCODE value after deliberately passing invalid parameters to
|
||||
<function>db2_connect</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
<methodparam choice="opt"><type>array</type><parameter>options</parameter><initializer>[]</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Creates a new connection to an IBM DB2 Universal Database, IBM Cloudscape,
|
||||
or Apache Derby database.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -30,10 +30,10 @@
|
||||
<varlistentry>
|
||||
<term><parameter>database</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
For a cataloged connection to a database, <parameter>database</parameter>
|
||||
represents the database alias in the DB2 client catalog.
|
||||
</para>
|
||||
</simpara>
|
||||
<para>
|
||||
For an uncataloged connection to a database,
|
||||
<parameter>database</parameter> represents a complete connection
|
||||
@@ -54,43 +54,43 @@
|
||||
<varlistentry>
|
||||
<term><parameter>database</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The name of the database.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>hostname</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The hostname or IP address of the database server.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>port</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The TCP/IP port on which the database is listening for
|
||||
requests.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>username</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The username with which you are connecting to the
|
||||
database.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>password</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The password with which you are connecting to the database.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -100,25 +100,25 @@
|
||||
<varlistentry>
|
||||
<term><parameter>username</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The username with which you are connecting to the database.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
For uncataloged connections, you must pass a &null; value or empty
|
||||
string.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>password</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The password with which you are connecting to the database.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
For uncataloged connections, you must pass a &null; value or empty
|
||||
string.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
@@ -131,47 +131,47 @@
|
||||
<varlistentry>
|
||||
<term><parameter>autocommit</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Passing the <constant>DB2_AUTOCOMMIT_ON</constant> value turns
|
||||
autocommit on for this connection handle.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Passing the <constant>DB2_AUTOCOMMIT_OFF</constant> value turns
|
||||
autocommit off for this connection handle.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>DB2_ATTR_CASE</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Passing the <constant>DB2_CASE_NATURAL</constant> value specifies
|
||||
that column names are returned in natural case.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Passing the <constant>DB2_CASE_LOWER</constant> value specifies
|
||||
that column names are returned in lower case.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Passing the <constant>DB2_CASE_UPPER</constant> value specifies
|
||||
that column names are returned in upper case.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>CURSOR</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Passing the <constant>DB2_FORWARD_ONLY</constant> value specifies a
|
||||
forward-only cursor for a statement resource. This is the default
|
||||
cursor type and is supported on all database servers.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Passing the <constant>DB2_SCROLLABLE</constant> value specifies a
|
||||
scrollable cursor for a statement resource. This mode enables
|
||||
random access to rows in a result set, but currently is supported
|
||||
only by IBM DB2 Universal Database.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -182,19 +182,19 @@
|
||||
<varlistentry>
|
||||
<term><parameter>trustedcontext</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Passing the DB2_TRUSTED_CONTEXT_ENABLE value turns trusted context
|
||||
on for this connection handle. This parameter cannot be set using
|
||||
<function>db2_set_option</function>.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
This key works only if the database is cataloged (even if the
|
||||
database is local), or if you specify the full DSN when you create
|
||||
the connection.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
To catalog the database, use following commands:
|
||||
</para>
|
||||
</simpara>
|
||||
<literallayout>db2 catalog tcpip node loopback remote <SERVERNAME> server <SERVICENAME>
|
||||
db2 catalog database <LOCALDBNAME> as <REMOTEDBNAME> at node loopback
|
||||
db2 "update dbm cfg using svcename <SERVICENAME>"
|
||||
@@ -210,27 +210,27 @@ db2set DB2COMM=TCPIP</literallayout>
|
||||
<varlistentry>
|
||||
<term><parameter>i5_lib</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A character value that indicates the default library that will be
|
||||
used for resolving unqualified file references. This is not valid
|
||||
if the connection is using system naming mode.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>i5_naming</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
<literal>DB2_I5_NAMING_ON</literal> value turns on DB2 UDB CLI iSeries
|
||||
system naming mode. Files are qualified using the slash (/) delimiter.
|
||||
Unqualified files are resolved using the library list for the job.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_NAMING_OFF</literal> value turns off DB2 UDB CLI default
|
||||
naming mode, which is SQL naming. Files are qualified using the period (.)
|
||||
delimiter. Unqualified files are resolved using either the default library
|
||||
or the current user ID.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
@@ -243,191 +243,191 @@ db2set DB2COMM=TCPIP</literallayout>
|
||||
source, the change does not take effect until the next successful
|
||||
<function>db2_connect</function> for the connection handle.
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
The php.ini setting <parameter>ibm_db2.i5_allow_commit</parameter>==0
|
||||
or <literal>DB2_I5_TXN_NO_COMMIT</literal> is the default, but may be
|
||||
overridden with the <parameter>i5_commit</parameter> option.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</para>
|
||||
<para>
|
||||
<simpara>
|
||||
<literal>DB2_I5_TXN_NO_COMMIT</literal> - Commitment control is not used.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_TXN_READ_UNCOMMITTED</literal> - Dirty reads, nonrepeatable
|
||||
reads, and phantoms are possible.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_TXN_READ_COMMITTED</literal> - Dirty reads are not possible.
|
||||
Nonrepeatable reads, and phantoms are possible.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_TXN_REPEATABLE_READ</literal> - Dirty reads and nonrepeatable
|
||||
reads are not possible. Phantoms are possible.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_TXN_SERIALIZABLE</literal> - Transactions are serializable.
|
||||
Dirty reads, non-repeatable reads, and phantoms are not possible
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>i5_query_optimize</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
<literal>DB2_FIRST_IO</literal> All queries are optimized with the goal of
|
||||
returning the first page of output as fast as possible. This goal works well
|
||||
when the output is controlled by a user who is most likely to cancel the query
|
||||
after viewing the first page of output data. Queries coded with an
|
||||
OPTIMIZE FOR nnn ROWS clause honor the goal specified by the clause.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_ALL_IO</literal> All queries are optimized with the goal of running
|
||||
the entire query to completion in the shortest amount of elapsed time. This is a
|
||||
good option when the output of a query is being written to a file or report, or
|
||||
the interface is queuing the output data. Queries coded with an OPTIMIZE FOR nnn
|
||||
ROWS clause honor the goal specified by the clause. This is the default.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>i5_dbcs_alloc</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
<literal>DB2_I5_DBCS_ALLOC_ON</literal> value turns on DB2 6X allocation scheme
|
||||
for DBCS translation column size growth.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_DBCS_ALLOC_OFF</literal> value turns off DB2 6X allocation scheme
|
||||
for DBCS translation column size growth.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Note: php.ini setting <parameter>ibm_db2.i5_dbcs_alloc</parameter>==0 or
|
||||
<literal>DB2_I5_DBCS_ALLOC_OFF</literal> is the default, but may be overridden
|
||||
with the <parameter>i5_dbcs_alloc</parameter> option.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>i5_date_fmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_ISO</literal> - The International Organization for Standardization
|
||||
(ISO) date format yyyy-mm-dd is used. This is the default.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_USA</literal> - The United States date format mm/dd/yyyy is used.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_EUR</literal> - The European date format dd.mm.yyyy is used.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_JIS</literal> - The Japanese Industrial Standard date format
|
||||
yyyy-mm-dd is used.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_MDY</literal> - The date format mm/dd/yyyy is used.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_DMY</literal> - The date format dd/mm/yyyy is used.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_YMD</literal> - The date format yy/mm/dd is used.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_JUL</literal> - The Julian date format yy/ddd is used.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_JOB</literal> - The job default is used.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>i5_date_sep</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_SLASH</literal> - A slash ( / ) is used as the date separator.
|
||||
This is the default.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_DASH</literal> - A dash ( - ) is used as the date separator.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_PERIOD</literal> - A period ( . ) is used as the date
|
||||
separator.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_COMMA</literal> - A comma ( , ) is used as the date separator.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_BLANK</literal> - A blank is used as the date separator.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_JOB</literal> - The job default is used
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>i5_time_fmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_ISO</literal> - The International Organization for
|
||||
Standardization (ISO) time format hh.mm.ss is used. This is the default.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_USA</literal> - The United States time format
|
||||
hh:mmxx is used, where xx is AM or PM.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_EUR</literal> - The European time format hh.mm.ss
|
||||
is used.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_JIS</literal> - The Japanese Industrial Standard
|
||||
time format hh:mm:ss is used.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_HMS</literal> - The hh:mm:ss format is used.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>i5_time_sep</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_COLON</literal> - A colon ( : ) is used as the time
|
||||
separator. This is the default.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_PERIOD</literal> - A period ( . ) is used as the time
|
||||
separator.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_COMMA</literal> - A comma ( , ) is used as the time
|
||||
separator.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_BLANK</literal> - A blank is used as the time separator.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_JOB</literal> - The job default is used.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>i5_decimal_sep</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_PERIOD</literal> - A period ( . ) is used as
|
||||
the decimal separator. This is the default.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_COMMA</literal> - A comma ( , ) is used as the
|
||||
decimal separator.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_JOB</literal> - The job default is used.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -439,16 +439,16 @@ db2set DB2COMM=TCPIP</literallayout>
|
||||
<varlistentry>
|
||||
<term><parameter>i5_libl</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A character value that indicates the library list that will be used for
|
||||
resolving unqualified file references. Specify the library list
|
||||
elements separated by blanks 'i5_libl'=>"MYLIB YOURLIB ANYLIB".
|
||||
</para>
|
||||
</simpara>
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
<parameter>i5_libl</parameter> calls qsys2/qcmdexc('cmd',cmdlen), which is only
|
||||
available in i5/OS V5R4 and later.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -460,11 +460,11 @@ db2set DB2COMM=TCPIP</literallayout>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a connection handle resource if the connection attempt is
|
||||
successful. If the connection attempt fails, <function>db2_connect</function>
|
||||
returns &false;.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
@@ -472,11 +472,11 @@ db2set DB2COMM=TCPIP</literallayout>
|
||||
<para>
|
||||
<example>
|
||||
<title>Creating a cataloged connection</title>
|
||||
<para>
|
||||
<simpara>
|
||||
Cataloged connections require you to have previously cataloged the target
|
||||
database through the DB2 Command Line Processor (CLP) or DB2
|
||||
Configuration Assistant.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -505,10 +505,10 @@ Connection succeeded.
|
||||
</example>
|
||||
<example>
|
||||
<title>Creating an uncataloged connection</title>
|
||||
<para>
|
||||
<simpara>
|
||||
An uncataloged connection enables you to dynamically connect to a
|
||||
database.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -541,10 +541,10 @@ Connection succeeded.
|
||||
</example>
|
||||
<example>
|
||||
<title>Creating a connection with autocommit off by default</title>
|
||||
<para>
|
||||
<simpara>
|
||||
Passing an array of options to <function>db2_connect</function> enables
|
||||
you to modify the default behavior of the connection handle.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -581,11 +581,11 @@ Autocommit is off.
|
||||
</example>
|
||||
<example>
|
||||
<title>i5/OS best performance</title>
|
||||
<para>
|
||||
<simpara>
|
||||
To achieve best performance for your i5/OS ibm_db2 1.5.1 PHP application
|
||||
use the default host, userid, and password for your
|
||||
<function>db2_connect</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -611,10 +611,10 @@ PICTURES
|
||||
</example>
|
||||
<example>
|
||||
<title>Using trusted context</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The following example shows how to enable trusted context, switch
|
||||
users, and get the current user ID.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
<methodparam><type>resource</type><parameter>stmt</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns the cursor type used by a statement resource. Use this to determine
|
||||
if you are working with a forward-only cursor or scrollable cursor.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -27,20 +27,20 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid statement resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns either <constant>DB2_FORWARD_ONLY</constant> if the statement
|
||||
resource uses a forward-only cursor or <constant>DB2_SCROLLABLE</constant> if
|
||||
the statement resource uses a scrollable cursor.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<!-- Use when examples exist
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
<type>string</type><methodname>db2_escape_string</methodname>
|
||||
<methodparam><type>string</type><parameter>string_literal</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<simpara>
|
||||
Prepends backslashes to special characters in the string argument.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
@@ -25,12 +25,12 @@
|
||||
<varlistentry>
|
||||
<term><parameter>string_literal</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The string that contains special characters that need to be modified.
|
||||
Characters that are prepended with a backslash are <literal>\x00</literal>,
|
||||
<literal>\n</literal>, <literal>\r</literal>, <literal>\</literal>,
|
||||
<literal>'</literal>, <literal>"</literal> and <literal>\x1a</literal>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -38,19 +38,19 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns <parameter>string_literal</parameter> with the special characters
|
||||
noted above prepended with backslashes.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>A <function>db2_escape_string</function> example</title>
|
||||
<para>
|
||||
<simpara>
|
||||
Result of using the <function>db2_escape_string</function> function
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -18,22 +18,22 @@
|
||||
</methodsynopsis>
|
||||
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Executes an SQL statement directly.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
If you plan to interpolate PHP variables into the SQL statement, understand
|
||||
that this is one of the more common security exposures. Consider calling
|
||||
<function>db2_prepare</function> to prepare an SQL statement with parameter
|
||||
markers for input values. Then you can call <function>db2_execute</function>
|
||||
to pass in the input values and avoid SQL injection attacks.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
If you plan to repeatedly issue the same SQL statement with different
|
||||
parameters, consider calling <function>db2_prepare</function> and
|
||||
<function>db2_execute</function> to enable the database server to reuse its
|
||||
access plan and increase the efficiency of your database access.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -42,42 +42,42 @@
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid database connection resource variable as returned from
|
||||
<function>db2_connect</function> or <function>db2_pconnect</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>statement</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
An SQL statement. The statement cannot contain any parameter markers.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>options</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
An associative array containing statement options. You can use this
|
||||
parameter to request a scrollable cursor on database servers that
|
||||
support this functionality.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
For a description of valid statement options, see
|
||||
<function>db2_set_option</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a statement resource if the SQL statement was issued successfully,
|
||||
or &false; if the database failed to execute the SQL statement.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
@@ -85,10 +85,10 @@
|
||||
<para>
|
||||
<example>
|
||||
<title>Creating a table with <function>db2_exec</function></title>
|
||||
<para>
|
||||
<simpara>
|
||||
The following example uses <function>db2_exec</function> to issue a set
|
||||
of DDL statements in the process of creating a table.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -134,10 +134,10 @@ Insert... Insert... Insert... Insert... Insert... Insert... Insert...
|
||||
|
||||
<example>
|
||||
<title>Executing a SELECT statement with a scrollable cursor</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The following example demonstrates how to request a scrollable cursor for
|
||||
an SQL statement issued by <function>db2_exec</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -167,12 +167,12 @@ Rickety Ride
|
||||
</example>
|
||||
<example>
|
||||
<title>Returning XML data as an SQL ResultSet</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The following example demonstrates how to work with documents stored
|
||||
in a XML column using the SAMPLE database. Using some pretty simple
|
||||
SQL/XML, this example returns some of the nodes in a XML document in
|
||||
an SQL ResultSet format that most users are familiar with.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -209,13 +209,13 @@ db2_close($conn);
|
||||
</example>
|
||||
<example>
|
||||
<title>Performing a "JOIN" with XML data</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The following example works with documents stored in 2 different
|
||||
XML columns in the SAMPLE database. It creates 2 temporary
|
||||
tables from the XML documents from 2 different columns and
|
||||
returns an SQL ResultSet with information regarding shipping
|
||||
status for the customer.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -266,11 +266,11 @@ db2_close($conn);
|
||||
</example>
|
||||
<example>
|
||||
<title>Returning SQL data as part of a larger XML document</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The following example works with a portion of the PRODUCT.DESCRIPTION
|
||||
documents in the SAMPLE database. It creates a XML document containing
|
||||
product description (XML data) and pricing info (SQL data).
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
</methodsynopsis>
|
||||
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
<function>db2_execute</function> executes an SQL statement that was
|
||||
prepared by <function>db2_prepare</function>.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
If the SQL statement returns a result set, for example, a SELECT statement
|
||||
or a CALL to a stored procedure that returns one or more result sets, you
|
||||
can retrieve a row as an array from the <literal>stmt</literal> resource
|
||||
@@ -31,12 +31,12 @@
|
||||
<function>db2_fetch_row</function> to move the result set pointer to the
|
||||
next row and fetch a column at a time from that row with
|
||||
<function>db2_result</function>.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Refer to <function>db2_prepare</function> for a brief discussion of the
|
||||
advantages of using <function>db2_prepare</function> and
|
||||
<function>db2_execute</function> rather than <function>db2_exec</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -45,27 +45,27 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A prepared statement returned from <function>db2_prepare</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>parameters</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
An array of input parameters matching any parameter markers contained
|
||||
in the prepared statement.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
@@ -73,11 +73,11 @@
|
||||
<para>
|
||||
<example>
|
||||
<title>Preparing and executing an SQL statement with parameter markers</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The following example prepares an INSERT statement that accepts four
|
||||
parameter markers, then iterates over an array of arrays containing the
|
||||
input values to be passed to <function>db2_execute</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -105,7 +105,7 @@ Successfully added new pet.
|
||||
</example>
|
||||
<example>
|
||||
<title>Calling a stored procedure with an OUT parameter</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The following example prepares a CALL statement that accepts one
|
||||
parameter marker representing an OUT parameter, binds the PHP variable
|
||||
<literal>$my_pets</literal> to the parameter using
|
||||
@@ -114,7 +114,7 @@ Successfully added new pet.
|
||||
CALL to the stored procedure has been made, the value of
|
||||
<literal>$num_pets</literal> changes to reflect the value returned by the
|
||||
stored procedure for that OUT parameter.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -135,12 +135,12 @@ I have 7 pets!
|
||||
</example>
|
||||
<example>
|
||||
<title>Returning XML data as an SQL ResultSet</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The following example demonstrates how to work with documents stored
|
||||
in a XML column using the SAMPLE database. Using some pretty simple
|
||||
SQL/XML, this example returns some of the nodes in a XML document in
|
||||
an SQL ResultSet format that most users are familiar with.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -185,13 +185,13 @@ db2_close($conn);
|
||||
</example>
|
||||
<example>
|
||||
<title>Performing a "JOIN" with XML data</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The following example works with documents stored in 2 different
|
||||
XML columns in the SAMPLE database. It creates 2 temporary
|
||||
tables from the XML documents from 2 different columns and
|
||||
returns an SQL ResultSet with information regarding shipping
|
||||
status for the customer.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -249,11 +249,11 @@ db2_close($conn);
|
||||
</example>
|
||||
<example>
|
||||
<title>Returning SQL data as part of a larger XML document</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The following example works with a portion of the PRODUCT.DESCRIPTION
|
||||
documents in the SAMPLE database. It creates a XML document containing
|
||||
product description (XML data) and pricing info (SQL data).
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
</methodsynopsis>
|
||||
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns an array, indexed by column position, representing a row in a result
|
||||
set. The columns are 0-indexed.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -29,31 +29,31 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid <literal>stmt</literal> resource containing a result set.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>row_number</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Requests a specific 1-indexed row from the result set. Passing this
|
||||
parameter results in a PHP warning if the result set uses a
|
||||
forward-only cursor.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a 0-indexed array with column values indexed by the column position
|
||||
representing the next or requested row in the result set. Returns &false; if
|
||||
there are no rows left in the result set, or if the row requested by
|
||||
<parameter>row_number</parameter> does not exist in the result set.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
@@ -61,10 +61,10 @@
|
||||
<para>
|
||||
<example>
|
||||
<title>Iterating through a forward-only cursor</title>
|
||||
<para>
|
||||
<simpara>
|
||||
If you call <function>db2_fetch_array</function> without a specific row
|
||||
number, it automatically retrieves the next row in the result set.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -93,12 +93,12 @@ while ($row = db2_fetch_array($stmt)) {
|
||||
<example>
|
||||
<title>Retrieving specific rows with <function>db2_fetch_array</function>
|
||||
from a scrollable cursor</title>
|
||||
<para>
|
||||
<simpara>
|
||||
If your result set uses a scrollable cursor, you can call
|
||||
<function>db2_fetch_array</function> with a specific row number. The
|
||||
following example retrieves every other row in the result set, starting
|
||||
with the second row.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
</methodsynopsis>
|
||||
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns an array, indexed by column name, representing a row in a result
|
||||
set.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -29,31 +29,31 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid <literal>stmt</literal> resource containing a result set.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>row_number</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Requests a specific 1-indexed row from the result set. Passing this
|
||||
parameter results in a PHP warning if the result set uses a
|
||||
forward-only cursor.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns an associative array with column values indexed by the column name
|
||||
representing the next or requested row in the result set. Returns &false; if
|
||||
there are no rows left in the result set, or if the row requested by
|
||||
<parameter>row_number</parameter> does not exist in the result set.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
@@ -61,10 +61,10 @@
|
||||
<para>
|
||||
<example>
|
||||
<title>Iterating through a forward-only cursor</title>
|
||||
<para>
|
||||
<simpara>
|
||||
If you call <function>db2_fetch_assoc</function> without a specific row
|
||||
number, it automatically retrieves the next row in the result set.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -93,12 +93,12 @@ while ($row = db2_fetch_assoc($stmt)) {
|
||||
<example>
|
||||
<title>Retrieving specific rows with <function>db2_fetch_assoc</function>
|
||||
from a scrollable cursor</title>
|
||||
<para>
|
||||
<simpara>
|
||||
If your result set uses a scrollable cursor, you can call
|
||||
<function>db2_fetch_assoc</function> with a specific row number. The
|
||||
following example retrieves every other row in the result set, starting
|
||||
with the second row.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
</methodsynopsis>
|
||||
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns an array, indexed by both column name and position, representing a
|
||||
row in a result set. Note that the row returned by
|
||||
<function>db2_fetch_both</function> requires more memory than the
|
||||
single-indexed arrays returned by <function>db2_fetch_assoc</function> or
|
||||
<function>db2_fetch_array</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -32,32 +32,32 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid <literal>stmt</literal> resource containing a result set.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>row_number</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Requests a specific 1-indexed row from the result set. Passing this
|
||||
parameter results in a PHP warning if the result set uses a
|
||||
forward-only cursor.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns an associative array with column values indexed by both the column
|
||||
name and 0-indexed column number. The array represents the next or
|
||||
requested row in the result set. Returns &false; if there are no rows left
|
||||
in the result set, or if the row requested by
|
||||
<parameter>row_number</parameter> does not exist in the result set.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
@@ -65,12 +65,12 @@
|
||||
<para>
|
||||
<example>
|
||||
<title>Iterating through a forward-only cursor</title>
|
||||
<para>
|
||||
<simpara>
|
||||
If you call <function>db2_fetch_both</function> without a specific row
|
||||
number, it automatically retrieves the next row in the result set. The
|
||||
following example accesses columns in the returned array by both column
|
||||
name and by numeric index.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -99,12 +99,12 @@ while ($row = db2_fetch_both($stmt)) {
|
||||
<example>
|
||||
<title>Retrieving specific rows with <function>db2_fetch_both</function>
|
||||
from a scrollable cursor</title>
|
||||
<para>
|
||||
<simpara>
|
||||
If your result set uses a scrollable cursor, you can call
|
||||
<function>db2_fetch_both</function> with a specific row number. The
|
||||
following example retrieves every other row in the result set, starting
|
||||
with the second row.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
</methodsynopsis>
|
||||
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns an object in which each property represents a column returned in
|
||||
the row fetched from a result set.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -29,57 +29,57 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid <literal>stmt</literal> resource containing a result set.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>row_number</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Requests a specific 1-indexed row from the result set. Passing this
|
||||
parameter results in a PHP warning if the result set uses a
|
||||
forward-only cursor.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns an object representing a single row in the result set. The
|
||||
properties of the object map to the names of the columns in the result set.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
The IBM DB2, Cloudscape, and Apache Derby database servers typically fold
|
||||
column names to upper-case, so the object properties will reflect that case.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
If your SELECT statement calls a scalar function to modify the value
|
||||
of a column, the database servers return the column number as the name of
|
||||
the column in the result set. If you prefer a more descriptive column name
|
||||
and object property, you can use the AS clause to assign a name to the
|
||||
column in the result set.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Returns &false; if no row was retrieved.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>A <function>db2_fetch_object</function> example</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The following example issues a SELECT statement with a scalar function,
|
||||
RTRIM, that removes whitespace from the end of the column. Rather than
|
||||
creating an object with the properties "BREED" and "2", we use the AS
|
||||
clause in the SELECT statement to assign the name "name" to the modified
|
||||
column. The database server folds the column names to upper-case,
|
||||
resulting in an object with the properties "BREED" and "NAME".
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -17,22 +17,22 @@
|
||||
</methodsynopsis>
|
||||
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Use <function>db2_fetch_row</function> to iterate through a result set, or
|
||||
to point to a specific row in a result set if you requested a scrollable
|
||||
cursor.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
To retrieve individual fields from the result set, call the
|
||||
<function>db2_result</function> function.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Rather than calling <function>db2_fetch_row</function> and
|
||||
<function>db2_result</function>, most applications will call one of
|
||||
<function>db2_fetch_assoc</function>, <function>db2_fetch_both</function>,
|
||||
or <function>db2_fetch_array</function> to advance the result set pointer
|
||||
and return a complete row as an array.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -41,28 +41,28 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid <literal>stmt</literal> resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>row_number</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
With scrollable cursors, you can request a specific row number in the
|
||||
result set. Row numbering is 1-indexed.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns &true; if the requested row exists in the result set. Returns
|
||||
&false; if the requested row does not exist in the result set.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
@@ -70,11 +70,11 @@
|
||||
<para>
|
||||
<example>
|
||||
<title>Iterating through a result set</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The following example demonstrates how to iterate through a result set
|
||||
with <function>db2_fetch_row</function> and retrieve columns from the
|
||||
result set with <function>db2_result</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -101,7 +101,7 @@ goat Rickety Ride
|
||||
</example>
|
||||
<example>
|
||||
<title>i5/OS recommended alternatives to db2_fetch_row/db2_result</title>
|
||||
<para>
|
||||
<simpara>
|
||||
On i5/OS it is recommended that you use <function>db2_fetch_both</function>,
|
||||
<function>db2_fetch_array</function>, or <function>db2_fetch_object</function>
|
||||
over <function>db2_fetch_row</function>/<function>db2_result</function>. In general
|
||||
@@ -111,7 +111,7 @@ goat Rickety Ride
|
||||
You may also find the performance of <function>db2_fetch_both</function>,
|
||||
<function>db2_fetch_array</function>, and <function>db2_fetch_object</function> to
|
||||
be superior to <function>db2_fetch_row</function>/<function>db2_result</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
<methodparam><type class="union"><type>int</type><type>string</type></type><parameter>column</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns the maximum number of bytes required to display a column in a
|
||||
result set.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -28,30 +28,30 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Specifies a statement resource containing a result set.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>column</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Specifies the column in the result set. This can either be an integer
|
||||
representing the 0-indexed position of the column, or a string
|
||||
containing the name of the column.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns an integer value with the maximum number of bytes required to
|
||||
display the specified column. If the column does not exist in the result
|
||||
set, <function>db2_field_display_size</function> returns &false;.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<!-- Use when examples exist
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
<methodparam><type class="union"><type>int</type><type>string</type></type><parameter>column</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns the name of the specified column in the result set.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -27,30 +27,30 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Specifies a statement resource containing a result set.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>column</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Specifies the column in the result set. This can either be an integer
|
||||
representing the 0-indexed position of the column, or a string
|
||||
containing the name of the column.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a string containing the name of the specified column. If the
|
||||
specified column does not exist in the result
|
||||
set, <function>db2_field_name</function> returns &false;.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<!-- Use when examples exist
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
<methodparam><type class="union"><type>int</type><type>string</type></type><parameter>column</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns the position of the named column in a result set.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -27,30 +27,30 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Specifies a statement resource containing a result set.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>column</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Specifies the column in the result set. This can either be an integer
|
||||
representing the 0-indexed position of the column, or a string
|
||||
containing the name of the column.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns an integer containing the 0-indexed position of the named column in
|
||||
the result set. If the specified column does not exist in the result set,
|
||||
<function>db2_field_num</function> returns &false;.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<!-- Use when examples exist
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
<methodparam><type class="union"><type>int</type><type>string</type></type><parameter>column</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns the precision of the indicated column in a result set.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -27,30 +27,30 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Specifies a statement resource containing a result set.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>column</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Specifies the column in the result set. This can either be an integer
|
||||
representing the 0-indexed position of the column, or a string
|
||||
containing the name of the column.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns an integer containing the precision of the specified column. If the
|
||||
specified column does not exist in the result set,
|
||||
<function>db2_field_precision</function> returns &false;.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<!-- Use when examples exist
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
<methodparam><type class="union"><type>int</type><type>string</type></type><parameter>column</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns the scale of the indicated column in a result set.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -27,30 +27,30 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Specifies a statement resource containing a result set.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>column</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Specifies the column in the result set. This can either be an integer
|
||||
representing the 0-indexed position of the column, or a string
|
||||
containing the name of the column.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns an integer containing the scale of the specified column. If the
|
||||
specified column does not exist in the result set,
|
||||
<function>db2_field_scale</function> returns &false;.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<!-- Use when examples exist
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
<methodparam><type class="union"><type>int</type><type>string</type></type><parameter>column</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns the data type of the indicated column in a result set.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -27,30 +27,30 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Specifies a statement resource containing a result set.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>column</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Specifies the column in the result set. This can either be an integer
|
||||
representing the 0-indexed position of the column, or a string
|
||||
containing the name of the column.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a string containing the defined data type of the specified column.
|
||||
If the specified column does not exist in the result set,
|
||||
<function>db2_field_type</function> returns &false;.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<!-- Use when examples exist
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
<methodparam><type class="union"><type>int</type><type>string</type></type><parameter>column</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns the width of the current value of the indicated column in a result
|
||||
set. This is the maximum width of the column for a fixed-length data type,
|
||||
or the actual width of the column for a variable-length data type.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -29,31 +29,31 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Specifies a statement resource containing a result set.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>column</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Specifies the column in the result set. This can either be an integer
|
||||
representing the 0-indexed position of the column, or a string
|
||||
containing the name of the column.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns an integer containing the width of the specified character or
|
||||
binary data type column in a result set. If the specified column does not
|
||||
exist in the result set, <function>db2_field_width</function> returns
|
||||
&false;.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<!-- Use when examples exist
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
</methodsynopsis>
|
||||
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a result set listing the foreign keys for a table.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -30,36 +30,36 @@
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid connection to an IBM DB2, Cloudscape, or Apache Derby database.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>qualifier</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A qualifier for DB2 databases running on OS/390 or z/OS servers. For
|
||||
other databases, pass &null; or an empty string.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>schema</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The schema which contains the tables. If <parameter>schema</parameter>
|
||||
is &null;, <function>db2_foreign_keys</function> matches the schema for
|
||||
the current connection.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>table_name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The name of the table.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
<methodparam><type>resource</type><parameter>stmt</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Frees the system and database resources that are associated with a result
|
||||
set. These resources are freed implicitly when a script finishes, but you
|
||||
can call <function>db2_free_result</function> to explicitly free the result
|
||||
set resources before the end of the script.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -29,18 +29,18 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid statement resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<!-- Use when examples exist
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
</methodsynopsis>
|
||||
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Frees the system and database resources that are associated with a statement
|
||||
resource. These resources are freed implicitly when a script finishes, but
|
||||
you can call <function>db2_free_stmt</function> to explicitly free the
|
||||
statement resources before the end of the script.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -30,18 +30,18 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid statement resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<!-- Use when examples exist
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
<methodparam><type>resource</type><parameter>resource</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>option</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<simpara>
|
||||
Retrieves the value of a specified option value for a statement resource
|
||||
or a connection resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
@@ -25,12 +25,12 @@
|
||||
<varlistentry>
|
||||
<term><parameter>resource</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid statement resource as returned from
|
||||
<function>db2_prepare</function> or a valid connection resource as
|
||||
returned from <function>db2_connect</function> or
|
||||
<function>db2_pconnect</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
@@ -41,18 +41,18 @@
|
||||
as of ibm_db2 version 1.6.0. They provide useful tracking information
|
||||
that can be set during execution with <function>db2_get_option</function>.
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
Prior versions of ibm_db2 do not support these new options.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
When the value in each option is being set, some servers might not handle
|
||||
the entire length provided and might truncate the value.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
To ensure that the data specified in each option is converted correctly
|
||||
when transmitted to a host system, use only the characters A through Z,
|
||||
0 through 9, and the underscore (_) or period (.).
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
@@ -63,11 +63,11 @@
|
||||
character string used to identify the client user ID sent to the host
|
||||
database server when using DB2 Connect.
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
DB2 for z/OS and OS/390 servers support up to a length of 16 characters.
|
||||
This user-id is not to be confused with the authentication user-id, it is for
|
||||
identification purposes only and is not used for any authorization.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</para>
|
||||
</listitem>
|
||||
@@ -80,9 +80,9 @@
|
||||
character string used to identify the client accounting string sent to the
|
||||
host database server when using DB2 Connect.
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
DB2 for z/OS and OS/390 servers support up to a length of 200 characters.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</para>
|
||||
</listitem>
|
||||
@@ -95,9 +95,9 @@
|
||||
character string used to identify the client application name sent to the
|
||||
host database server when using DB2 Connect.
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
DB2 for z/OS and OS/390 servers support up to a length of 32 characters.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</para>
|
||||
</listitem>
|
||||
@@ -110,9 +110,9 @@
|
||||
character string used to identify the client workstation name sent to the
|
||||
host database server when using DB2 Connect.
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
DB2 for z/OS and OS/390 servers support up to a length of 18 characters.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</para>
|
||||
</listitem>
|
||||
@@ -182,10 +182,10 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns the current setting of the connection attribute provided on success
|
||||
&return.falseforfailure;.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
|
||||
@@ -13,32 +13,32 @@
|
||||
<type class="union"><type>string</type><type>null</type></type><methodname>db2_last_insert_id</methodname>
|
||||
<methodparam><type>resource</type><parameter>resource</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<simpara>
|
||||
Returns the auto generated ID of the last insert query that successfully
|
||||
executed on this connection.
|
||||
</para>
|
||||
</simpara>
|
||||
<para>
|
||||
The result of this function is not affected by any of the following:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A single row INSERT statement with a VALUES clause for a table without an identity column.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A multiple row INSERT statement with a VALUES clause.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
An INSERT statement with a fullselect.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A ROLLBACK TO SAVEPOINT statement.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
@@ -50,11 +50,11 @@
|
||||
<varlistentry>
|
||||
<term><parameter>resource</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid connection resource as returned from <function>db2_connect</function>
|
||||
or <function>db2_pconnect</function>. The value of this parameter cannot be a
|
||||
statement resource or result set resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -62,21 +62,21 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns the auto generated ID of last insert query that successfully
|
||||
executed on this connection.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example xml:id="db2-last-insert-id.example.basic"><!-- {{{ -->
|
||||
<title>A <function>db2_last_insert_id</function> example</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The following example shows how to return the
|
||||
auto generated ID of last insert query that successfully
|
||||
executed on this connection.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
<methodparam><type>int</type><parameter>colnum</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>length</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<simpara>
|
||||
Use <function>db2_lob_read</function> to iterate through a specified column of
|
||||
a result set and retrieve a user defined size of LOB data.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
@@ -29,25 +29,25 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid <literal>stmt</literal> resource containing LOB data.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>colnum</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid column number in the result set of the <literal>stmt</literal> resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>length</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The size of the LOB data to be retrieved from the <literal>stmt</literal> resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -55,18 +55,18 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns the amount of data the user specifies. Returns
|
||||
&false; if the data cannot be retrieved.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Iterating through different types of data</title>
|
||||
<para>
|
||||
</para>
|
||||
<simpara>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
</methodsynopsis>
|
||||
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
A stored procedure can return zero or more result sets. While you handle
|
||||
the first result set in exactly the same way you would handle the results
|
||||
returned by a simple SELECT statement, to fetch the second and subsequent
|
||||
result sets from a stored procedure you must call the
|
||||
<function>db2_next_result</function> function and return the result to a
|
||||
uniquely named PHP variable.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -32,35 +32,35 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A prepared statement returned from <function>db2_exec</function> or
|
||||
<function>db2_execute</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a new statement resource containing the next result set if the
|
||||
stored procedure returned another result set. Returns &false; if the stored
|
||||
procedure did not return another result set.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Calling a stored procedure that returns multiple result sets</title>
|
||||
<para>
|
||||
<simpara>
|
||||
In the following example, we call a stored procedure that returns three
|
||||
result sets. The first result set is fetched directly from the same
|
||||
statement resource on which we invoked the CALL statement, while the
|
||||
second and third result sets are fetched from statement resources
|
||||
returned from our calls to the <function>db2_next_result</function>
|
||||
function.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
</methodsynopsis>
|
||||
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns the number of fields contained in a result set. This is most useful
|
||||
for handling the result sets returned by dynamically generated queries, or
|
||||
for result sets returned by stored procedures, where your application cannot
|
||||
otherwise know how to retrieve and use the results.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -30,30 +30,30 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid statement resource containing a result set.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns an integer value representing the number of fields in the result
|
||||
set associated with the specified statement resource. Returns &false; if
|
||||
the statement resource is not a valid input value.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Retrieving the number of fields in a result set</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The following example demonstrates how to retrieve the number of fields
|
||||
returned in a result set.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -16,26 +16,26 @@
|
||||
</methodsynopsis>
|
||||
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns the number of rows deleted, inserted, or updated by an SQL
|
||||
statement.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
To determine the number of rows that will be returned by a SELECT
|
||||
statement, issue SELECT COUNT(*) with the same predicates as your
|
||||
intended SELECT statement and retrieve the value.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
If your application logic checks the number of rows returned by a SELECT
|
||||
statement and branches if the number of rows is 0, consider modifying your
|
||||
application to attempt to return the first row with one of
|
||||
<function>db2_fetch_assoc</function>, <function>db2_fetch_both</function>,
|
||||
<function>db2_fetch_array</function>, or <function>db2_fetch_row</function>,
|
||||
and branch if the fetch function returns &false;.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
If you issue a SELECT statement using a scrollable cursor,
|
||||
<function>db2_num_rows</function> returns the number of rows returned by
|
||||
the SELECT statement. However, the overhead associated with scrollable
|
||||
@@ -44,7 +44,7 @@
|
||||
you should use a forward-only cursor and either call SELECT COUNT(*) or
|
||||
rely on the <type>bool</type> return value of the fetch functions to
|
||||
achieve the equivalent functionality with much better performance.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
|
||||
</refsect1>
|
||||
@@ -54,19 +54,19 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid <literal>stmt</literal> resource containing a result set.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns the number of rows affected by the last SQL statement issued by
|
||||
the specified statement handle,&return.falseforfailure;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<!-- Use when examples exist
|
||||
|
||||
@@ -17,20 +17,20 @@
|
||||
<function>db2_pconnect</function> and returns the corresponding resources
|
||||
to the database server.
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
This function is only available on i5/OS in response to i5/OS system
|
||||
administration requests.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</para>
|
||||
<para>
|
||||
<simpara>
|
||||
If you have a persistent DB2 client connection created with
|
||||
<function>db2_pconnect</function>, you may use this function to close the
|
||||
connection. To avoid substantial connection performance penalties, this
|
||||
function should only be used in rare cases when the persistent connection
|
||||
has become unresponsive or the persistent connection will not be needed for
|
||||
a long period of time.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
@@ -39,9 +39,9 @@
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Specifies an active DB2 client connection.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -49,19 +49,19 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example xml:id="db2-pclose.example.basic"><!-- {{{ -->
|
||||
<title>Closing a persistent connection</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The following example demonstrates a successful attempt to close a
|
||||
connection to an IBM DB2 i5/OS database.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -19,30 +19,30 @@
|
||||
</methodsynopsis>
|
||||
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a persistent connection to an IBM DB2 Universal Database, IBM
|
||||
Cloudscape, or Apache Derby database.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
For more information on persistent
|
||||
connections, refer to <xref linkend="features.persistent-connections"/>.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Calling <function>db2_close</function> on a persistent connection always
|
||||
returns &true;, but the underlying DB2 client connection remains open and
|
||||
waiting to serve the next matching <function>db2_pconnect</function>
|
||||
request.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Users running version 1.9.0 or later of ibm_db2 should be aware that the
|
||||
extension will perform a transaction rollback on persistent connections at
|
||||
the end of a request, thus ending the transaction. This prevents the
|
||||
transaction block from carrying over to the next request which uses that
|
||||
connection if script execution ends before the transaction block does.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -51,10 +51,10 @@
|
||||
<varlistentry>
|
||||
<term><parameter>database</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
For a cataloged connection to a database, <parameter>database</parameter>
|
||||
represents the database alias in the DB2 client catalog.
|
||||
</para>
|
||||
</simpara>
|
||||
<para>
|
||||
For an uncataloged connection to a database,
|
||||
<parameter>database</parameter> represents a complete connection
|
||||
@@ -75,43 +75,43 @@
|
||||
<varlistentry>
|
||||
<term><parameter>database</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The name of the database.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>hostname</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The hostname or IP address of the database server.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>port</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The TCP/IP port on which the database is listening for
|
||||
requests.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>username</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The username with which you are connecting to the
|
||||
database.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>password</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The password with which you are connecting to the database.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -121,17 +121,17 @@
|
||||
<varlistentry>
|
||||
<term><parameter>username</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The username with which you are connecting to the database.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>password</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The password with which you are connecting to the database.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
@@ -144,47 +144,47 @@
|
||||
<varlistentry>
|
||||
<term><parameter>autocommit</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Passing the <constant>DB2_AUTOCOMMIT_ON</constant> value turns
|
||||
autocommit on for this connection handle.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Passing the <constant>DB2_AUTOCOMMIT_OFF</constant> value turns
|
||||
autocommit off for this connection handle.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>DB2_ATTR_CASE</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Passing the <constant>DB2_CASE_NATURAL</constant> value specifies
|
||||
that column names are returned in natural case.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Passing the <constant>DB2_CASE_LOWER</constant> value specifies
|
||||
that column names are returned in lower case.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Passing the <constant>DB2_CASE_UPPER</constant> value specifies
|
||||
that column names are returned in upper case.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>CURSOR</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Passing the <constant>DB2_FORWARD_ONLY</constant> value specifies a
|
||||
forward-only cursor for a statement resource. This is the default
|
||||
cursor type and is supported on all database servers.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Passing the <constant>DB2_SCROLLABLE</constant> value specifies a
|
||||
scrollable cursor for a statement resource. This mode enables
|
||||
random access to rows in a result set, but currently is supported
|
||||
only by IBM DB2 Universal Database.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -196,19 +196,19 @@
|
||||
<varlistentry>
|
||||
<term><parameter>trustedcontext</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Passing the DB2_TRUSTED_CONTEXT_ENABLE value turns trusted context
|
||||
on for this connection handle. This parameter cannot be set using
|
||||
<function>db2_set_option</function>.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
This key works only if the database is cataloged (even if the
|
||||
database is local), or if you specify the full DSN when you create
|
||||
the connection.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
To catalog the database, use following commands:
|
||||
</para>
|
||||
</simpara>
|
||||
<literallayout>db2 catalog tcpip node loopback remote <SERVERNAME> server <SERVICENAME>
|
||||
db2 catalog database <LOCALDBNAME> as <REMOTEDBNAME> at node loopback
|
||||
db2 "update dbm cfg using svcename <SERVICENAME>"
|
||||
@@ -222,37 +222,37 @@ db2set DB2COMM=TCPIP</literallayout>
|
||||
The following new i5/OS options are available in ibm_db2 version 1.5.1
|
||||
and later.
|
||||
<tip>
|
||||
<para>Conflicting connection attributes used in conjunction with persistent
|
||||
<simpara>Conflicting connection attributes used in conjunction with persistent
|
||||
connections can produce indeterminate results on i5/OS. Site policies should
|
||||
be establish for all applications using each persistent connection user
|
||||
profile. The default DB2_AUTOCOMMIT_ON is suggested when using persistent connections.
|
||||
</para>
|
||||
</simpara>
|
||||
</tip>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>i5_lib</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A character value that indicates the default library that will be
|
||||
used for resolving unqualified file references. This is not valid
|
||||
if the connection is using system naming mode.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>i5_naming</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
<literal>DB2_I5_NAMING_ON</literal> value turns on DB2 UDB CLI iSeries
|
||||
system naming mode. Files are qualified using the slash (/) delimiter.
|
||||
Unqualified files are resolved using the library list for the job.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_NAMING_OFF</literal> value turns off DB2 UDB CLI default
|
||||
naming mode, which is SQL naming. Files are qualified using the period (.)
|
||||
delimiter. Unqualified files are resolved using either the default library
|
||||
or the current user ID.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
@@ -265,69 +265,69 @@ db2set DB2COMM=TCPIP</literallayout>
|
||||
source, the change does not take effect until the next successful
|
||||
<function>db2_pconnect</function> for the connection handle.
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
The php.ini setting <parameter>ibm_db2.i5_allow_commit</parameter>==0
|
||||
or <literal>DB2_I5_TXN_NO_COMMIT</literal> is the default, but may be
|
||||
overridden with the <parameter>i5_commit</parameter> option.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</para>
|
||||
<para>
|
||||
<simpara>
|
||||
<literal>DB2_I5_TXN_NO_COMMIT</literal> - Commitment control is not used.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_TXN_READ_UNCOMMITTED</literal> - Dirty reads, nonrepeatable
|
||||
reads, and phantoms are possible.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_TXN_READ_COMMITTED</literal> - Dirty reads are not possible.
|
||||
Nonrepeatable reads, and phantoms are possible.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_TXN_REPEATABLE_READ</literal> - Dirty reads and nonrepeatable
|
||||
reads are not possible. Phantoms are possible.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_TXN_SERIALIZABLE</literal> - Transactions are serializable.
|
||||
Dirty reads, non-repeatable reads, and phantoms are not possible
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>i5_query_optimize</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
<literal>DB2_FIRST_IO</literal> All queries are optimized with the goal of
|
||||
returning the first page of output as fast as possible. This goal works well
|
||||
when the output is controlled by a user who is most likely to cancel the query
|
||||
after viewing the first page of output data. Queries coded with an
|
||||
OPTIMIZE FOR nnn ROWS clause honor the goal specified by the clause.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_ALL_IO</literal> All queries are optimized with the goal of running
|
||||
the entire query to completion in the shortest amount of elapsed time. This is a
|
||||
good option when the output of a query is being written to a file or report, or
|
||||
the interface is queuing the output data. Queries coded with an OPTIMIZE FOR nnn
|
||||
ROWS clause honor the goal specified by the clause. This is the default.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>i5_dbcs_alloc</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
<literal>DB2_I5_DBCS_ALLOC_ON</literal> value turns on DB2 6X allocation scheme
|
||||
for DBCS translation column size growth.
|
||||
</para>
|
||||
</simpara>
|
||||
<para>
|
||||
<literal>DB2_I5_DBCS_ALLOC_OFF</literal> value turns off DB2 6X allocation scheme
|
||||
for DBCS translation column size growth.
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
The php.ini setting <parameter>ibm_db2.i5_dbcs_alloc</parameter>==0 or
|
||||
<literal>DB2_I5_DBCS_ALLOC_OFF</literal> is the default, but may be overridden
|
||||
with the <parameter>i5_dbcs_alloc</parameter> option.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</para>
|
||||
</listitem>
|
||||
@@ -335,123 +335,123 @@ db2set DB2COMM=TCPIP</literallayout>
|
||||
<varlistentry>
|
||||
<term><parameter>i5_date_fmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_ISO</literal> - The International Organization for Standardization
|
||||
(ISO) date format yyyy-mm-dd is used. This is the default.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_USA</literal> - The United States date format mm/dd/yyyy is used.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_EUR</literal> - The European date format dd.mm.yyyy is used.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_JIS</literal> - The Japanese Industrial Standard date format
|
||||
yyyy-mm-dd is used.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_MDY</literal> - The date format mm/dd/yyyy is used.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_DMY</literal> - The date format dd/mm/yyyy is used.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_YMD</literal> - The date format yy/mm/dd is used.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_JUL</literal> - The Julian date format yy/ddd is used.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_JOB</literal> - The job default is used.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>i5_date_sep</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_SLASH</literal> - A slash ( / ) is used as the date separator.
|
||||
This is the default.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_DASH</literal> - A dash ( - ) is used as the date separator.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_PERIOD</literal> - A period ( . ) is used as the date
|
||||
separator.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_COMMA</literal> - A comma ( , ) is used as the date separator.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_BLANK</literal> - A blank is used as the date separator.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_JOB</literal> - The job default is used
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>i5_time_fmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_ISO</literal> - The International Organization for
|
||||
Standardization (ISO) time format hh.mm.ss is used. This is the default.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_USA</literal> - The United States time format
|
||||
hh:mmxx is used, where xx is AM or PM.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_EUR</literal> - The European time format hh.mm.ss
|
||||
is used.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_JIS</literal> - The Japanese Industrial Standard
|
||||
time format hh:mm:ss is used.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FMT_HMS</literal> - The hh:mm:ss format is used.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>i5_time_sep</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_COLON</literal> - A colon ( : ) is used as the time
|
||||
separator. This is the default.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_PERIOD</literal> - A period ( . ) is used as the time
|
||||
separator.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_COMMA</literal> - A comma ( , ) is used as the time
|
||||
separator.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_BLANK</literal> - A blank is used as the time separator.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_JOB</literal> - The job default is used.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>i5_decimal_sep</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_PERIOD</literal> - A period ( . ) is used as
|
||||
the decimal separator. This is the default.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_COMMA</literal> - A comma ( , ) is used as the
|
||||
decimal separator.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_SEP_JOB</literal> - The job default is used.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -468,10 +468,10 @@ db2set DB2COMM=TCPIP</literallayout>
|
||||
resolving unqualified file references. Specify the library list
|
||||
elements separated by blanks 'i5_libl'=>"MYLIB YOURLIB ANYLIB".
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
i5_libl calls qsys2/qcmdexc('cmd',cmdlen), which is only available
|
||||
in i5/OS V5R4 and later.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</para>
|
||||
</listitem>
|
||||
@@ -484,14 +484,14 @@ db2set DB2COMM=TCPIP</literallayout>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a connection handle resource if the connection attempt is
|
||||
successful. <function>db2_pconnect</function> tries to reuse an existing
|
||||
connection resource that exactly matches the
|
||||
<parameter>database</parameter>, <parameter>username</parameter>, and
|
||||
<parameter>password</parameter> parameters. If the connection attempt fails,
|
||||
<function>db2_pconnect</function> returns &false;.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
@@ -549,13 +549,13 @@ db2set DB2COMM=TCPIP</literallayout>
|
||||
<para>
|
||||
<example>
|
||||
<title>A <function>db2_pconnect</function> example</title>
|
||||
<para>
|
||||
<simpara>
|
||||
In the following example, the first call to
|
||||
<function>db2_pconnect</function> returns a new persistent connection
|
||||
resource. The second call to <function>db2_pconnect</function> returns
|
||||
a persistent connection resource that simply reuses the first persistent
|
||||
connection resource.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -592,10 +592,10 @@ Second persistent connection succeeded.
|
||||
</example>
|
||||
<example>
|
||||
<title>Using trusted context</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The following example shows how to enable trusted context, switch
|
||||
users, and get the current user ID.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -18,44 +18,44 @@
|
||||
</methodsynopsis>
|
||||
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
<function>db2_prepare</function> creates a prepared SQL statement which can
|
||||
include 0 or more parameter markers (<literal>?</literal> characters)
|
||||
representing parameters for input, output, or input/output. You can pass
|
||||
parameters to the prepared statement using
|
||||
<function>db2_bind_param</function>, or for input values only, as an array
|
||||
passed to <function>db2_execute</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
<para>
|
||||
There are three main advantages to using prepared statements in your
|
||||
application:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
<emphasis>Performance</emphasis>: when you prepare a statement, the
|
||||
database server creates an optimized access plan for retrieving data with
|
||||
that statement. Subsequently issuing the prepared statement with
|
||||
<function>db2_execute</function> enables the statements to reuse that
|
||||
access plan and avoids the overhead of dynamically creating a new access
|
||||
plan for every statement you issue.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
<emphasis>Security</emphasis>: when you prepare a statement, you can
|
||||
include parameter markers for input values. When you execute a prepared
|
||||
statement with input values for placeholders, the database server checks
|
||||
each input value to ensure that the type matches the column definition or
|
||||
parameter definition.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
<emphasis>Advanced functionality</emphasis>: Parameter markers not only
|
||||
enable you to pass input values to prepared SQL statements, they also
|
||||
enable you to retrieve OUT and INOUT parameters from stored procedures
|
||||
using <function>db2_bind_param</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
@@ -67,55 +67,55 @@
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid database connection resource variable as returned from
|
||||
<function>db2_connect</function> or <function>db2_pconnect</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>statement</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
An SQL statement, optionally containing one or more parameter markers..
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>options</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
An associative array containing statement options. You can use this
|
||||
parameter to request a scrollable cursor on database servers that
|
||||
support this functionality.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
For a description of valid statement options, see
|
||||
<function>db2_set_option</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a statement resource if the SQL statement was successfully parsed and
|
||||
prepared by the database server. Returns &false; if the database server
|
||||
returned an error. You can determine which error was returned by calling
|
||||
<function>db2_stmt_error</function> or <function>db2_stmt_errormsg</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Preparing and executing an SQL statement with parameter markers</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The following example prepares an INSERT statement that accepts four
|
||||
parameter markers, then iterates over an array of arrays containing the
|
||||
input values to be passed to <function>db2_execute</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
<methodparam><type>string</type><parameter>table_name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a result set listing the primary keys for a table.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -29,36 +29,36 @@
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid connection to an IBM DB2, Cloudscape, or Apache Derby database.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>qualifier</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A qualifier for DB2 databases running on OS/390 or z/OS servers. For
|
||||
other databases, pass &null; or an empty string.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>schema</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The schema which contains the tables. If <parameter>schema</parameter>
|
||||
is &null;, <function>db2_primary_keys</function> matches the schema for
|
||||
the current connection.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>table_name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The name of the table.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
<methodparam><type class="union"><type>string</type><type>null</type></type><parameter>parameter</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a result set listing the parameters for one or more stored
|
||||
procedures.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -31,49 +31,49 @@
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid connection to an IBM DB2, Cloudscape, or Apache Derby database.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>qualifier</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A qualifier for DB2 databases running on OS/390 or z/OS servers. For
|
||||
other databases, pass &null; or an empty string.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>schema</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The schema which contains the procedures. This parameter accepts a
|
||||
search pattern containing <literal>_</literal> and <literal>%</literal>
|
||||
as wildcards.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>procedure</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The name of the procedure. This parameter accepts a
|
||||
search pattern containing <literal>_</literal> and <literal>%</literal>
|
||||
as wildcards.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>parameter</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The name of the parameter. This parameter accepts a search pattern
|
||||
containing <literal>_</literal> and <literal>%</literal> as wildcards.
|
||||
If this parameter is &null;, all parameters for the specified stored
|
||||
procedures are returned.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
</methodsynopsis>
|
||||
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a result set listing the stored procedures registered in a
|
||||
database.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -31,38 +31,38 @@
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid connection to an IBM DB2, Cloudscape, or Apache Derby database.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>qualifier</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A qualifier for DB2 databases running on OS/390 or z/OS servers. For
|
||||
other databases, pass &null; or an empty string.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>schema</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The schema which contains the procedures. This parameter accepts a
|
||||
search pattern containing <literal>_</literal> and <literal>%</literal>
|
||||
as wildcards.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>procedure</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The name of the procedure. This parameter accepts a
|
||||
search pattern containing <literal>_</literal> and <literal>%</literal>
|
||||
as wildcards.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
</methodsynopsis>
|
||||
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Use <function>db2_result</function> to return the value of a specified
|
||||
column in the current row of a result set. You must call
|
||||
<function>db2_fetch_row</function> before calling
|
||||
<function>db2_result</function> to set the location of the result set
|
||||
pointer.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -32,39 +32,39 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid <literal>stmt</literal> resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>column</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Either an integer mapping to the 0-indexed field in the result set, or
|
||||
a string matching the name of the column.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns the value of the requested field if the field exists in the result
|
||||
set. Returns &null; if the field does not exist, and issues a warning.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>A <function>db2_result</function> example</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The following example demonstrates how to iterate through a result set
|
||||
with <function>db2_fetch_row</function> and retrieve columns from the
|
||||
result set with <function>db2_result</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Rolls back an in-progress transaction on the specified connection resource and
|
||||
begins a new transaction. PHP applications normally default to AUTOCOMMIT
|
||||
mode, so <function>db2_rollback</function> normally has no effect unless
|
||||
AUTOCOMMIT has been turned off for the connection resource.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -29,26 +29,26 @@
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid database connection resource variable as returned from
|
||||
<function>db2_connect</function> or <function>db2_pconnect</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Rolling back a DELETE statement</title>
|
||||
<para>
|
||||
<simpara>
|
||||
In the following example, we count the number of rows in a table, turn
|
||||
off AUTOCOMMIT mode on a database connection, delete all of the rows in
|
||||
the table and return the count of <literal>0</literal> to prove that the
|
||||
@@ -57,7 +57,7 @@
|
||||
is the same as before we issued the DELETE statement. The return to the
|
||||
original state of the table demonstrates that the roll back of the
|
||||
transaction succeeded.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -66,46 +66,46 @@
|
||||
<varlistentry>
|
||||
<term>UR</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Uncommitted read: changes are immediately visible by all
|
||||
concurrent transactions.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>CS</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Cursor stability: a row read by one transaction can be altered and
|
||||
committed by a second concurrent transaction.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>RS</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Read stability: a transaction can add or remove rows matching a
|
||||
search condition or a pending transaction.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>RR</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Repeatable read: data affected by pending transaction is not
|
||||
available to other transactions.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>NC</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
No commit: any changes are visible at the end of a successful
|
||||
operation. Explicit commits and rollbacks are not allowed.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -222,33 +222,33 @@
|
||||
<varlistentry>
|
||||
<term>ENTRY</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Entry-level SQL-92 compliance.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>FIPS127</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
FIPS-127-2 transitional compliance.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>FULL</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Full level SQL-92 compliance.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>INTERMEDIATE</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Intermediate level SQL-92 compliance.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -267,18 +267,18 @@
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Specifies an active DB2 client connection.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns an object on a successful call,&return.falseforfailure;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<!-- Use when ERRORS exist
|
||||
@@ -320,10 +320,10 @@
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>A <function>db2_server_info</function> example</title>
|
||||
<para>
|
||||
<simpara>
|
||||
To retrieve information about the server, you must pass a valid
|
||||
database connection resource to <function>db2_server_info</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php"><![CDATA[<?php
|
||||
|
||||
$conn = db2_connect('sample', 'db2inst1', 'ibmdb2');
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
<methodparam><type>array</type><parameter>options</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>type</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<simpara>
|
||||
Sets options for a statement resource or a connection resource. You
|
||||
cannot set options for result set resources.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
@@ -24,12 +24,12 @@
|
||||
<varlistentry>
|
||||
<term><parameter>resource</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid statement resource as returned from
|
||||
<function>db2_prepare</function> or a valid connection resource as
|
||||
returned from <function>db2_connect</function> or
|
||||
<function>db2_pconnect</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
@@ -45,86 +45,86 @@
|
||||
<varlistentry>
|
||||
<term><parameter>autocommit</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Passing <constant>DB2_AUTOCOMMIT_ON</constant> turns
|
||||
autocommit on for the specified connection resource.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Passing <constant>DB2_AUTOCOMMIT_OFF</constant> turns
|
||||
autocommit off for the specified connection resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>cursor</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Passing <constant>DB2_FORWARD_ONLY</constant> specifies a
|
||||
forward-only cursor for a statement resource. This is the
|
||||
default cursor type, and is supported by all database
|
||||
servers.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Passing <constant>DB2_SCROLLABLE</constant> specifies a
|
||||
scrollable cursor for a statement resource. Scrollable
|
||||
cursors enable result set rows to be accessed in
|
||||
non-sequential order, but are only supported by
|
||||
IBM DB2 Universal Database databases.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>binmode</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Passing <constant>DB2_BINARY</constant> specifies that
|
||||
binary data will be returned as is. This is the default
|
||||
mode. This is the equivalent of setting
|
||||
<literal>ibm_db2.binmode=1</literal> in &php.ini;.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Passing <constant>DB2_CONVERT</constant> specifies that
|
||||
binary data will be converted to hexadecimal encoding,
|
||||
and will be returned as such. This is the equivalent of
|
||||
setting <literal>ibm_db2.binmode=2</literal> in &php.ini;.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Passing <constant>DB2_PASSTHRU</constant> specifies that
|
||||
binary data will be converted to &null;. This is the
|
||||
equivalent of setting <literal>ibm_db2.binmode=3</literal>
|
||||
in &php.ini;.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>db2_attr_case</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Passing <constant>DB2_CASE_LOWER</constant> specifies that
|
||||
column names of the result set are returned in lower case.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Passing <constant>DB2_CASE_UPPER</constant> specifies that
|
||||
column names of the result set are returned in upper case.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Passing <constant>DB2_CASE_NATURAL</constant> specifies that
|
||||
column names of the result set are returned in natural
|
||||
case.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>deferred_prepare</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Passing <constant>DB2_DEFERRED_PREPARE_ON</constant> turns deferred
|
||||
prepare on for the specified statement resource.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Passing <constant>DB2_DEFERRED_PREPARE_OFF</constant> turns deferred
|
||||
prepare off for the specified statement resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -136,16 +136,16 @@
|
||||
<varlistentry>
|
||||
<term><parameter>i5_fetch_only</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FETCH_ON</literal> - Cursors are read-only
|
||||
and cannot be used for positioned updates or deletes. This
|
||||
is the default unless <literal>SQL_ATTR_FOR_FETCH_ONLY</literal>
|
||||
environment has been set to <literal>SQL_FALSE</literal>.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_I5_FETCH_OFF</literal> - Cursors can be used
|
||||
for positioned updates and deletes.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -156,16 +156,16 @@
|
||||
<varlistentry>
|
||||
<term><parameter>rowcount</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
<literal>DB2_ROWCOUNT_PREFETCH_ON</literal> - Client can request
|
||||
the full row count prior to fetching, which means that
|
||||
<function>db2_num_rows</function> returns the number of rows selected
|
||||
even when a <literal>ROLLFORWARD_ONLY</literal> cursor is used.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
<literal>DB2_ROWCOUNT_PREFETCH_OFF</literal> - Client cannot request
|
||||
the full row count prior to fetching.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -176,21 +176,21 @@
|
||||
<varlistentry>
|
||||
<term><parameter>trusted_user</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
To switch the user to a trusted user, pass the User ID (String)
|
||||
of the trusted user as the value of this key. This option can
|
||||
be set on a connection resource only. To use this option, trusted
|
||||
context must be enabled on the connection resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>trusted_password</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The password (String) that corresponds to the user specified
|
||||
by the trusted_user key.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -200,15 +200,15 @@
|
||||
These options provide useful tracking information that can be accessed during
|
||||
execution with <function>db2_get_option</function>.
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
When the value in each option is being set, some servers might not handle
|
||||
the entire length provided and might truncate the value.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
To ensure that the data specified in each option is converted correctly
|
||||
when transmitted to a host system, use only the characters A through Z,
|
||||
0 through 9, and the underscore (_) or period (.).
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
@@ -219,11 +219,11 @@
|
||||
character string used to identify the client user ID sent to the host
|
||||
database server when using DB2 Connect.
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
DB2 for z/OS and OS/390 servers support up to a length of 16 characters.
|
||||
This user-id is not to be confused with the authentication user-id, it is for
|
||||
identification purposes only and is not used for any authorization.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</para>
|
||||
</listitem>
|
||||
@@ -236,9 +236,9 @@
|
||||
character string used to identify the client accounting string sent to the
|
||||
host database server when using DB2 Connect.
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
DB2 for z/OS and OS/390 servers support up to a length of 200 characters.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</para>
|
||||
</listitem>
|
||||
@@ -251,9 +251,9 @@
|
||||
character string used to identify the client application name sent to the
|
||||
host database server when using DB2 Connect.
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
DB2 for z/OS and OS/390 servers support up to a length of 32 characters.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</para>
|
||||
</listitem>
|
||||
@@ -266,9 +266,9 @@
|
||||
character string used to identify the client workstation name sent to the
|
||||
host database server when using DB2 Connect.
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
DB2 for z/OS and OS/390 servers support up to a length of 18 characters.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</para>
|
||||
</listitem>
|
||||
@@ -280,25 +280,25 @@
|
||||
<varlistentry>
|
||||
<term><parameter>type</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
An integer value that specifies the type of resource that was
|
||||
passed into the function. The type of resource and this value
|
||||
must correspond.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Passing <literal>1</literal> as the value specifies that
|
||||
a connection resource has been passed into the function.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Passing any integer not equal to <literal>1</literal> as
|
||||
the value specifies that a statement resource has been
|
||||
passed into the function.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
<para>
|
||||
</para>
|
||||
<simpara>
|
||||
</simpara>
|
||||
<para>
|
||||
The following table specifies which options are compatible with
|
||||
the available resource types:
|
||||
@@ -487,9 +487,9 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
<!-- Place Changelog next if any -->
|
||||
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
<methodparam><type>int</type><parameter>scope</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a result set listing the unique row identifier columns for a table.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -30,34 +30,34 @@
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid connection to an IBM DB2, Cloudscape, or Apache Derby database.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>qualifier</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A qualifier for DB2 databases running on OS/390 or z/OS servers. For
|
||||
other databases, pass &null; or an empty string.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>schema</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The schema which contains the tables.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>table_name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The name of the table.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
<methodparam><type>bool</type><parameter>unique</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a result set listing the index and statistics for a table.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -30,47 +30,47 @@
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid connection to an IBM DB2, Cloudscape, or Apache Derby database.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>qualifier</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A qualifier for DB2 databases running on OS/390 or z/OS servers. For
|
||||
other databases, pass &null; or an empty string.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>schema</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The schema that contains the targeted table. If this parameter is
|
||||
&null;, the statistics and indexes are returned for the schema of the
|
||||
current user.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>table_name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The name of the table.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>unique</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
When <parameter>unique</parameter> is &true;, the information for all
|
||||
indexes in the table are returned.
|
||||
Otherwise, only the information for unique indexes in the table are
|
||||
returned.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -205,31 +205,31 @@
|
||||
<row>
|
||||
<entry>CARDINALITY</entry>
|
||||
<entry>
|
||||
<para>
|
||||
<simpara>
|
||||
If the row contains information about an index, this column contains
|
||||
an integer value representing the number of unique values in the
|
||||
index.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
If the row contains information about the table itself, this column
|
||||
contains an integer value representing the number of rows in the
|
||||
table.
|
||||
</para>
|
||||
</simpara>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>PAGES</entry>
|
||||
<entry>
|
||||
<para>
|
||||
<simpara>
|
||||
If the row contains information about an index, this column contains
|
||||
an integer value representing the number of pages used to store the
|
||||
index.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
If the row contains information about the table itself, this column
|
||||
contains an integer value representing the number of pages used to
|
||||
store the table.
|
||||
</para>
|
||||
</simpara>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
|
||||
@@ -15,16 +15,16 @@
|
||||
<methodparam choice="opt"><type class="union"><type>resource</type><type>null</type></type><parameter>stmt</parameter><initializer>&null;</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a string containing the SQLSTATE value returned by an SQL statement.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
If you do not pass a statement resource as an argument to
|
||||
<function>db2_stmt_error</function>, the driver returns the SQLSTATE
|
||||
value associated with the last attempt to return a statement resource, for
|
||||
example, from <function>db2_prepare</function> or
|
||||
<function>db2_exec</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
<para>
|
||||
To learn what the SQLSTATE value means, you can issue the following command
|
||||
at a DB2 Command Line Processor prompt:
|
||||
@@ -40,18 +40,18 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid statement resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a string containing an SQLSTATE value.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<!-- Use when examples exist
|
||||
|
||||
@@ -15,16 +15,16 @@
|
||||
<methodparam choice="opt"><type class="union"><type>resource</type><type>null</type></type><parameter>stmt</parameter><initializer>&null;</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a string containing the last SQL statement error message.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
If you do not pass a statement resource as an argument to
|
||||
<function>db2_stmt_errormsg</function>, the driver returns the error
|
||||
message associated with the last attempt to return a statement resource,
|
||||
for example, from <function>db2_prepare</function> or
|
||||
<function>db2_exec</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -33,19 +33,19 @@
|
||||
<varlistentry>
|
||||
<term><parameter>stmt</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid statement resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a string containing the error message and SQLCODE value for the
|
||||
last error that occurred issuing an SQL statement.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<!-- Use when examples exist
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>table_name</parameter><initializer>&null;</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a result set listing the tables and associated privileges in a
|
||||
database.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -30,37 +30,37 @@
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid connection to an IBM DB2, Cloudscape, or Apache Derby database.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>qualifier</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A qualifier for DB2 databases running on OS/390 or z/OS servers. For
|
||||
other databases, pass &null; or an empty string.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>schema</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The schema which contains the tables. This parameter accepts a
|
||||
search pattern containing <literal>_</literal> and <literal>%</literal>
|
||||
as wildcards.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>table_name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The name of the table. This parameter accepts a search pattern
|
||||
containing <literal>_</literal> and <literal>%</literal> as wildcards.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>table_type</parameter><initializer>&null;</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a result set listing the tables and associated metadata in a
|
||||
database.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
@@ -31,49 +31,49 @@
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid connection to an IBM DB2, Cloudscape, or Apache Derby database.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>qualifier</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A qualifier for DB2 databases running on OS/390 or z/OS servers. For
|
||||
other databases, pass &null; or an empty string.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>schema</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The schema which contains the tables. This parameter accepts a
|
||||
search pattern containing <literal>_</literal> and <literal>%</literal>
|
||||
as wildcards.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>table_name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The name of the table. This parameter accepts a search pattern
|
||||
containing <literal>_</literal> and <literal>%</literal> as wildcards.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>table_type</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A list of comma-delimited table type identifiers. To match all table
|
||||
types, pass &null; or an empty string. Valid table type identifiers
|
||||
include: ALIAS, HIERARCHY TABLE, INOPERATIVE VIEW, NICKNAME,
|
||||
MATERIALIZED QUERY TABLE, SYSTEM TABLE, TABLE, TYPED TABLE, TYPED VIEW,
|
||||
and VIEW.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
@@ -123,19 +123,19 @@
|
||||
data in the PHP application.
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
1 (DB2_BINARY)
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
2 (DB2_CONVERT)
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
3 (DB2_PASSTHRU)
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
@@ -157,14 +157,14 @@
|
||||
It should not be used in new applications.
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
0 - Persistent and non-persistent connections can be made.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
1 - All connections are persistent.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
@@ -185,29 +185,29 @@
|
||||
<function>db2_pconnect</function>.
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
0 - commitment control is not used
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
1 - read uncommitted, dirty reads possible.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
2 - read committed, dirty reads are not possible.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
3 - repeatable read, dirty reads and non-repeatable reads are not possible
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
4 - serializeable, dirty reads, non-repeatable reads, and phantoms are not possible
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
@@ -228,14 +228,14 @@
|
||||
current user.
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
0 - Don't allow a blank user ID to be passed.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
1 - Allow a blank user ID to be passed.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
@@ -254,14 +254,14 @@
|
||||
By default, this option is <literal>0</literal>.
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
0 - Columns are not trimmed.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
1 - Spaces at the end of returned character columns are removed.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
@@ -284,14 +284,14 @@
|
||||
data is returned.
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
0 - Minimum size buffers are allocated.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
1 - Larger size buffers are allocated.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
@@ -310,14 +310,14 @@
|
||||
By default, this option is set to <literal>0</literal>.
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
0 - Don't check for profile swaps.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
1 - Check for profile swaps and disconnect if so.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
@@ -340,14 +340,14 @@
|
||||
functions fail.
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
0 - Only logs brief messages.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
1 - Logs the SQL diagnostic message in addition to the brief message.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
@@ -370,14 +370,14 @@
|
||||
<function>db2_pconnect</function>.
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
0 - Uses the specified credentials, and use an SQL/CLI server job.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
1 - Always use blank credentials, and run SQL/CLI in the PHP job.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
@@ -396,19 +396,19 @@
|
||||
<literal>SQL_ATTR_CONN_SORT_SEQUENCE</literal> attribute.
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
0 - Uses the <literal>*HEX</literal> sort option, sorting by bytes.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
1 - Uses the job sort sequence set for the PHP job.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
2 - Uses the job sort sequence set for the database job.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
@@ -420,7 +420,7 @@
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
This will affect how many times a persistent connection can be reused
|
||||
when running on IBM i.
|
||||
By default, this is set to <literal>0</literal>, which means a persistent
|
||||
@@ -428,7 +428,7 @@
|
||||
This option can help work around issues in a long-running database job
|
||||
(i.e. if a procedure is leaking memory), but is obviously not a long-term
|
||||
fix.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="ini.ibm-db2.i5-override-ccsid">
|
||||
@@ -437,20 +437,20 @@
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The PASE CCSID to use for character conversions from EBCDIC on IBM i.
|
||||
By default, this is <literal>0</literal>, which will select the default
|
||||
PASE job CCSID, which comes from the PASE locale settings.
|
||||
For example, setting this to <literal>1208</literal> will use UTF-8.
|
||||
This should only be modified if the PASE job CCSID isn't the expected
|
||||
CCSID, and the locale cannot be modified.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
To learn more about CCSIDs on IBM i, consult the
|
||||
<link xlink:href="&url.ibm.ccsid;">IBM documentation</link>.
|
||||
To learn how locales on IBM i PASE are mapped to CCSIDs, consult the
|
||||
<link xlink:href="&url.ibm.pase.i;">IBM documentation</link>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="ini.ibm-db2.i5-sys-naming">
|
||||
@@ -470,21 +470,21 @@
|
||||
uses the job library list to resolve names.
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
0 - Uses the SQL naming mode ("SCHEMA.TABLE").
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
1 - Uses the system naming mode ("LIBRARY/FILE").
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
<simpara>
|
||||
To learn more about naming modes on IBM i, consult the
|
||||
<link xlink:href="&url.db2.object.naming;">IBM documentation</link>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="ini.ibm-db2.i5-servermode-subsystem">
|
||||
@@ -493,12 +493,12 @@
|
||||
<type>string</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
This option changes which subsystem database server jobs run under on
|
||||
IBM i.
|
||||
By default, this option is &null;, so jobs will run under the default
|
||||
subsystem for QSQSRVR jobs.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="ini.ibm-db2.instance-name">
|
||||
@@ -514,9 +514,9 @@
|
||||
If this option is set, its value overrides the
|
||||
<varname>DB2INSTANCE</varname> environment variable setting.
|
||||
</para>
|
||||
<para>
|
||||
<simpara>
|
||||
This option is ignored on Windows operating systems.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
@@ -1,31 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<chapter xml:id="ibm-db2.setup" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="ibm-db2.setup">
|
||||
&reftitle.setup;
|
||||
|
||||
<!-- {{{ Requirements -->
|
||||
<section xml:id="ibm-db2.requirements">
|
||||
&reftitle.required;
|
||||
<para>
|
||||
<simpara>
|
||||
To connect to IBM DB2 Universal Database for Linux, UNIX, and Windows, or
|
||||
IBM Cloudscape, or Apache Derby, you must install an IBM DB2 Universal
|
||||
Database client on the same computer on which you are running PHP. The
|
||||
extension has been developed and tested with DB2 Version 8.2.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
To connect to IBM DB2 Universal Database for z/OS or iSeries, you also
|
||||
require IBM DB2 Connect or the equivalent DRDA gateway software.
|
||||
</para>
|
||||
</simpara>
|
||||
<section xml:id="ibm-db2.requirements.unix">
|
||||
<title>Requirements on Linux or Unix</title>
|
||||
<para>
|
||||
<simpara>
|
||||
The user invoking the PHP executable or SAPI must specify the DB2 instance
|
||||
before accessing these functions. You can set the name of the DB2 instance
|
||||
in &php.ini; using the <literal>ibm_db2.instance_name</literal>
|
||||
configuration option, or you can source the DB2 instance profile before
|
||||
invoking the PHP executable.
|
||||
</para>
|
||||
</simpara>
|
||||
<para>
|
||||
If you created a DB2 instance named <literal>db2inst1</literal> in
|
||||
<filename>/home/db2inst1/</filename>, for example, you can add the
|
||||
@@ -64,15 +63,14 @@ bash$ source /home/db2inst1/sqllib/db2profile
|
||||
<!-- {{{ Resources -->
|
||||
<section xml:id="ibm-db2.resources">
|
||||
&reftitle.resources;
|
||||
<para>
|
||||
<simpara>
|
||||
The ibm_db2 extension returns connection resources, statement resources,
|
||||
and result set resources.
|
||||
</para>
|
||||
</simpara>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
</chapter>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
@@ -93,4 +91,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user