diff --git a/reference/ibm_db2/configure.xml b/reference/ibm_db2/configure.xml
index 20dabab21b..5d7e9b7349 100644
--- a/reference/ibm_db2/configure.xml
+++ b/reference/ibm_db2/configure.xml
@@ -1,5 +1,5 @@
-
+
&reftitle.install;
@@ -29,6 +29,31 @@ bash$ ./configure --with-IBM_DB2=/path/to/DB2
The configure command defaults to
/opt/IBM/db2/V8.1.
+
+
+ Note for IIS users
+
+ If you are using the ibm_db2 driver with Microsoft Internet Information Server (IIS)
+ you may have to do the following:
+
+
+
+
+ Install DB2 with extended operating system security.
+
+
+ Add the PHP binary path to the PATH system environment variable (default C:\php\).
+
+
+ Create another system environment variable equal to the path where the PHP.INI file is located (eg: PHPRC = C:\php\).
+
+
+ Add the IUSR_COMPUTERNAME to the DB2USERS group.
+
+
+
+
+
+
&reftitle.constants;
@@ -202,6 +202,28 @@
+
+
+ DB2_DEFERRED_PREPARE_ON
+ (integer)
+
+
+
+ Specifies that deferred prepare should be turned on for the specified statement resource.
+
+
+
+
+
+ DB2_DEFERRED_PREPARE_OFF
+ (integer)
+
+
+
+ Specifies that deferred prepare should be turned off for the specified statement resource.
+
+
+
diff --git a/reference/ibm_db2/functions/db2-escape-string.xml b/reference/ibm_db2/functions/db2-escape-string.xml
new file mode 100644
index 0000000000..f5fcf2e1ce
--- /dev/null
+++ b/reference/ibm_db2/functions/db2-escape-string.xml
@@ -0,0 +1,124 @@
+
+
+
+ db2_escape_string
+
+ Used to escape certain characters.
+
+
+
+
+ &reftitle.description;
+
+ stringdb2_escape_string
+ stringstring_literal
+
+
+ Prepends backslashes to special characters in the string argument.
+
+
+
+
+ &reftitle.parameters;
+
+
+
+ string_literal
+
+
+ The string that contains special characters that need to be modified.
+ Characters that are prepended with a backslash are \x00,
+ \n, \r, \,
+ ', " and \x1a.
+
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns string_literal with the special characters
+ noted above prepended with backslashes.
+
+
+
+
+ &reftitle.examples;
+
+
+ A db2_escape_string example
+
+ Result of using the db2_escape_string function
+
+
+
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+
+ db2_prepare
+
+
+
+
+
+
+
diff --git a/reference/ibm_db2/functions/db2-get-option.xml b/reference/ibm_db2/functions/db2-get-option.xml
new file mode 100644
index 0000000000..5c4f5ccc6f
--- /dev/null
+++ b/reference/ibm_db2/functions/db2-get-option.xml
@@ -0,0 +1,323 @@
+
+
+
+
+ db2_get_option
+ Retrieves an option value for a statement resource or a connection resource
+
+
+
+ &reftitle.description;
+
+ stringdb2_get_option
+ resourceresource
+ stringoption
+
+
+ Retrieves the value of a specified option value for a statement resource
+ or a connection resource.
+
+
+
+
+ &reftitle.parameters;
+
+
+
+ resource
+
+
+ A valid statement resource as returned from
+ db2_prepare or a valid connection resource as
+ returned from db2_connect or
+ db2_pconnect.
+
+
+
+
+ option
+
+
+ A valid statement or connection options. The following new options are available
+ as of ibm_db2 version 1.6.0. They provide useful tracking information
+ that can be set during execution with db2_get_option.
+
+ Note
+
+ Prior versions of ibm_db2 do not support these new options.
+
+
+ When the value in each option is being set, some servers might not handle
+ the entire length provided and might truncate the value.
+
+
+ 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 (.).
+
+
+
+
+ userid
+
+
+ SQL_ATTR_INFO_USERID - A pointer to a null-terminated
+ character string used to identify the client user ID sent to the host
+ database server when using DB2 Connect.
+
+ Note
+
+ 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.
+
+
+
+
+
+
+ acctstr
+
+
+ SQL_ATTR_INFO_ACCTSTR - A pointer to a null-terminated
+ character string used to identify the client accounting string sent to the
+ host database server when using DB2 Connect.
+
+ Note
+
+ DB2 for z/OS and OS/390 servers support up to a length of 200 characters.
+
+
+
+
+
+
+ applname
+
+
+ SQL_ATTR_INFO_APPLNAME - A pointer to a null-terminated
+ character string used to identify the client application name sent to the
+ host database server when using DB2 Connect.
+
+ Note
+
+ DB2 for z/OS and OS/390 servers support up to a length of 32 characters.
+
+
+
+
+
+
+ wrkstnname
+
+
+ SQL_ATTR_INFO_WRKSTNNAME - A pointer to a null-terminated
+ character string used to identify the client workstation name sent to the
+ host database server when using DB2 Connect.
+
+ Note
+
+ DB2 for z/OS and OS/390 servers support up to a length of 18 characters.
+
+
+
+
+
+
+
+
+
+
+
+
+ The following table specifies which options are compatible with
+ the available resource types:
+
+ Resource-Parameter Matrix
+
+
+
+
+
+
+
+
+ Key
+ Value
+ Resource Type
+
+
+
+
+ Connection
+ Statement
+ Result Set
+
+
+ userid
+ SQL_ATTR_INFO_USERID
+ X
+ X
+ -
+
+
+ acctstr
+ SQL_ATTR_INFO_ACCTSTR
+ X
+ X
+ -
+
+
+ applname
+ SQL_ATTR_INFO_APPLNAME
+ X
+ X
+ -
+
+
+ wrkstnname
+ SQL_ATTR_INFO_WRKSTNNAME
+ X
+ X
+ -
+
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the current setting of the connection attribute provided on success
+ or &false; on failure.
+
+
+
+
+ &reftitle.examples;
+
+
+ Setting and retrieving parameters through a connection resource
+
+ 'db2inst1');
+$conn1 = db2_connect($database, $user, $password, $options1);
+$val = db2_get_option($conn1, 'userid');
+echo $val . "\n";
+
+$options2 = array('acctstr' => 'account');
+$conn2 = db2_connect($database, $user, $password, $options2);
+$val = db2_get_option($conn2, 'acctstr');
+echo $val . "\n";
+
+$options3 = array('applname' => 'myapp');
+$conn3 = db2_connect($database, $user, $password, $options3);
+$val = db2_get_option($conn3, 'applname');
+echo $val . "\n";
+
+$options4 = array('wrkstnname' => 'workstation');
+$conn4 = db2_connect($database, $user, $password, $options4);
+$val = db2_get_option($conn4, 'wrkstnname');
+echo $val . "\n";
+
+echo "Client attributes passed post-conection:\n";
+
+/* Create the associative options array with valid key-value pairs */
+/* Assign the attributes after a connection is made */
+/* Access the options specified */
+$options5 = array('userid' => 'db2inst1');
+$conn5 = db2_connect($database, $user, $password);
+$rc = db2_set_option($conn5, $options5, 1);
+$val = db2_get_option($conn5, 'userid');
+echo $val . "\n";
+
+$options6 = array('acctstr' => 'account');
+$conn6 = db2_connect($database, $user, $password);
+$rc = db2_set_option($conn6, $options6, 1);
+$val = db2_get_option($conn6, 'acctstr');
+echo $val . "\n";
+
+$options7 = array('applname' => 'myapp');
+$conn7 = db2_connect($database, $user, $password);
+$rc = db2_set_option($conn7, $options7, 1);
+$val = db2_get_option($conn7, 'applname');
+echo $val . "\n";
+
+$options8 = array('wrkstnname' => 'workstation');
+$conn8 = db2_connect($database, $user, $password);
+$rc = db2_set_option($conn8, $options8, 1);
+$val = db2_get_option($conn8, 'wrkstnname');
+echo $val . "\n";
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+
+ db2_connect
+ db2_cursor_type
+ db2_exec
+ db2_set_option
+ db2_pconnect
+ db2_prepare
+
+
+
+
+
+
+
diff --git a/reference/ibm_db2/functions/db2-lob-read.xml b/reference/ibm_db2/functions/db2-lob-read.xml
new file mode 100644
index 0000000000..2e54de7bef
--- /dev/null
+++ b/reference/ibm_db2/functions/db2-lob-read.xml
@@ -0,0 +1,196 @@
+
+
+
+
+
+ db2_lob_read
+
+ Gets a user defined size of LOB files with each invocation
+
+
+
+
+ &reftitle.description;
+
+ stringdb2_lob_read
+ resourcestmt
+ intcolnum
+ intlength
+
+
+ Use db2_lob_read to iterate through a specified column of
+ a result set and retrieve a user defined size of LOB data.
+
+
+
+
+ &reftitle.parameters;
+
+
+
+ stmt
+
+
+ A valid stmt resource containing LOB data.
+
+
+
+
+ colnum
+
+
+ A valid column number in the result set of the stmt resource.
+
+
+
+
+ length
+
+
+ The size of the LOB data to be retrieved from the stmt resource.
+
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the amount of data the user specifies. Returns
+ &false; if the data cannot be retrieved.
+
+
+
+
+ &reftitle.examples;
+
+
+ Iterating through different types of data
+
+
+
+
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+
+ db2_bind_param
+ db2_exec
+ db2_execute
+ db2_fetch_row
+ db2_prepare
+ db2_result
+
+
+
+
+
+
+
diff --git a/reference/ibm_db2/functions/db2-set-option.xml b/reference/ibm_db2/functions/db2-set-option.xml
index 8e27e50a39..6008f3e074 100644
--- a/reference/ibm_db2/functions/db2-set-option.xml
+++ b/reference/ibm_db2/functions/db2-set-option.xml
@@ -1,5 +1,5 @@
-
+
db2_set_option
@@ -122,11 +122,29 @@
+
+ deferred_prepare
+
+
+ Passing DB2_DEFERRED_PREPARE_ON turns deferred
+ prepare on for the specified statement resource.
+
+
+ Passing DB2_DEFERRED_PREPARE_OFF turns deferred
+ prepare off for the specified statement resource.
+
+
+
- The following new i5/OS options are available as of ibm_db2 version 1.5.1.
- Note: prior versions of ibm_db2 do not support these new i5 options.
+ The following new i5/OS options are available as of ibm_db2 version 1.5.1.
+
+ Note
+
+ Prior versions of ibm_db2 do not support these new i5 options.
+
+
i5_fetch_only
@@ -145,6 +163,93 @@
+
+ The following new options are available as of ibm_db2 version 1.6.0. They provide useful tracking information
+ that can be accessed during execution with db2_get_option.
+
+ Note
+
+ Prior versions of ibm_db2 do not support these new options.
+
+
+ When the value in each option is being set, some servers might not handle
+ the entire length provided and might truncate the value.
+
+
+ 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 (.).
+
+
+
+
+ userid
+
+
+ SQL_ATTR_INFO_USERID - A pointer to a null-terminated
+ character string used to identify the client user ID sent to the host
+ database server when using DB2 Connect.
+
+ Note
+
+ 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.
+
+
+
+
+
+
+ acctstr
+
+
+ SQL_ATTR_INFO_ACCTSTR - A pointer to a null-terminated
+ character string used to identify the client accounting string sent to the
+ host database server when using DB2 Connect.
+
+ Note
+
+ DB2 for z/OS and OS/390 servers support up to a length of 200 characters.
+
+
+
+
+
+
+ applname
+
+
+ SQL_ATTR_INFO_APPLNAME - A pointer to a null-terminated
+ character string used to identify the client application name sent to the
+ host database server when using DB2 Connect.
+
+ Note
+
+ DB2 for z/OS and OS/390 servers support up to a length of 32 characters.
+
+
+
+
+
+
+ wrkstnname
+
+
+ SQL_ATTR_INFO_WRKSTNNAME - A pointer to a null-terminated
+ character string used to identify the client workstation name sent to the
+ host database server when using DB2 Connect.
+
+ Note
+
+ DB2 for z/OS and OS/390 servers support up to a length of 18 characters.
+
+
+
+
+
+
+
@@ -220,14 +325,14 @@
cursor
DB2_SCROLLABLE
- X
+ -
X
-
cursor
DB2_FORWARD_ONLY
- X
+ -
X
-
@@ -273,6 +378,20 @@
X
-
+
+ deferred_prepare
+ DB2_DEFERRED_PREPARE_ON
+ -
+ X
+ -
+
+
+ deferred_prepare
+ DB2_DEFERRED_PREPARE_OFF
+ -
+ X
+ -
+
i5_fetch_only
DB2_I5_FETCH_ON
@@ -287,6 +406,34 @@
X
-
+
+ userid
+ SQL_ATTR_INFO_USERID
+ X
+ X
+ -
+
+
+ acctstr
+ SQL_ATTR_INFO_ACCTSTR
+ X
+ X
+ -
+
+
+ applname
+ SQL_ATTR_INFO_APPLNAME
+ X
+ X
+ -
+
+
+ wrkstnname
+ SQL_ATTR_INFO_WRKSTNNAME
+ X
+ X
+ -
+