diff --git a/reference/ibm_db2/functions/db2-connect.xml b/reference/ibm_db2/functions/db2-connect.xml index cc8a72e70c..55b97264f9 100644 --- a/reference/ibm_db2/functions/db2-connect.xml +++ b/reference/ibm_db2/functions/db2-connect.xml @@ -1,5 +1,5 @@ - + @@ -167,6 +167,233 @@ + + 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_lib + + + 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. + + + + + i5_naming + + + DB2_I5_NAMING_ON 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. + + + DB2_I5_NAMING_OFF 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. + + + + + i5_commit + + + The i5_commit attribute should be set before the + db2_connect. If the value is changed after the + connection has been established, and the connection is to a remote data + source, the change does not take effect until the next successful + db2_connect for the connection handle. + + + Note: php.ini setting ibm_db2.i5_allow_commit==0 + or DB2_I5_TXN_NO_COMMIT is the default, but may be + overridden with the i5_commit option. + + + DB2_I5_TXN_NO_COMMIT - Commitment control is not used. + + + DB2_I5_TXN_READ_UNCOMMITTED - Dirty reads, nonrepeatable + reads, and phantoms are possible. + + + DB2_I5_TXN_READ_COMMITTED - Dirty reads are not possible. + Nonrepeatable reads, and phantoms are possible. + + + DB2_I5_TXN_REPEATABLE_READ - Dirty reads and nonrepeatable + reads are not possible. Phantoms are possible. + + + DB2_I5_TXN_SERIALIZABLE - Transactions are serializable. + Dirty reads, non-repeatable reads, and phantoms are not possible + + + + + i5_query_optimize + + + DB2_FIRST_IO 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. + + + DB2_ALL_IO 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. + + + + + i5_dbcs_alloc + + + DB2_I5_DBCS_ALLOC_ON value turns on DB2 6X allocation scheme + for DBCS translation column size growth. + + + DB2_I5_DBCS_ALLOC_OFF value turns off DB2 6X allocation scheme + for DBCS translation column size growth. + + + Note: php.ini setting ibm_db2.i5_dbcs_alloc==0 or + DB2_I5_DBCS_ALLOC_OFF is the default, but may be overridden + with the i5_dbcs_alloc option. + + + + + i5_date_fmt + + + SQL_FMT_ISO - The International Organization for Standardization + (ISO) date format yyyy-mm-dd is used. This is the default. + + + DB2_I5_FMT_USA - The United States date format mm/dd/yyyy is used. + + + DB2_I5_FMT_EUR - The European date format dd.mm.yyyy is used. + + + DB2_I5_FMT_JIS - The Japanese Industrial Standard date format + yyyy-mm-dd is used. + + + DB2_I5_FMT_MDY - The date format mm/dd/yyyy is used. + + + DB2_I5_FMT_DMY - The date format dd/mm/yyyy is used. + + + DB2_I5_FMT_YMD - The date format yy/mm/dd is used. + + + DB2_I5_FMT_JUL - The Julian date format yy/ddd is used. + + + DB2_I5_FMT_JOB - The job default is used. + + + + + i5_date_sep + + + DB2_I5_SEP_SLASH - A slash ( / ) is used as the date separator. + This is the default. + + + DB2_I5_SEP_DASH - A dash ( - ) is used as the date separator. + + + DB2_I5_SEP_PERIOD - A period ( . ) is used as the date + separator. + + + DB2_I5_SEP_COMMA - A comma ( , ) is used as the date separator. + + + DB2_I5_SEP_BLANK - A blank is used as the date separator. + + + DB2_I5_SEP_JOB - The job default is used + + + + + i5_time_fmt + + + DB2_I5_FMT_ISO - The International Organization for + Standardization (ISO) time format hh.mm.ss is used. This is the default. + + + DB2_I5_FMT_USA - The United States time format + hh:mmxx is used, where xx is AM or PM. + + + DB2_I5_FMT_EUR - The European time format hh.mm.ss + is used. + + + DB2_I5_FMT_JIS - The Japanese Industrial Standard + time format hh:mm:ss is used. + + + DB2_I5_FMT_HMS - The hh:mm:ss format is used. + + + + + i5_time_sep + + + DB2_I5_SEP_COLON - A colon ( : ) is used as the time + separator. This is the default. + + + DB2_I5_SEP_PERIOD - A period ( . ) is used as the time + separator. + + + DB2_I5_SEP_COMMA - A comma ( , ) is used as the time + separator. + + + DB2_I5_SEP_BLANK - A blank is used as the time separator. + + + DB2_I5_SEP_JOB - The job default is used. + + + + + i5_decimal_sep + + + DB2_I5_SEP_PERIOD - A period ( . ) is used as + the decimal separator. This is the default. + + + DB2_I5_SEP_COMMA - A comma ( , ) is used as the + date separator. + + + DB2_I5_SEP_JOB - The job default is used. + + + + + @@ -293,7 +520,36 @@ Autocommit is off. ]]> - + + i5/OS best performance + + To achieve best performance for your i5/OS ibm_db2 1.5.1 PHP application + use the default host, userid, and password for your + db2_connect. + + +"qsys2")); + $result = db2_exec($i5, + "select * from systables where table_schema = '$library'"); + while ($row = db2_fetch_both($result)) { + echo $row['TABLE_NAME']."
"; + } + db2_close($i5); +?> +]]> +
+ &example.outputs; + + + +
diff --git a/reference/ibm_db2/functions/db2-fetch-row.xml b/reference/ibm_db2/functions/db2-fetch-row.xml index 40d1e0aebf..22352000f8 100644 --- a/reference/ibm_db2/functions/db2-fetch-row.xml +++ b/reference/ibm_db2/functions/db2-fetch-row.xml @@ -1,5 +1,5 @@ - + @@ -98,6 +98,52 @@ cat Pook gold fish Bubbles budgerigar Gizmo goat Rickety Ride +]]> + + + + i5/OS recommended alternatives to db2_fetch_row/db2_result + + On i5/OS it is recommended that you use db2_fetch_both, + db2_fetch_array, or db2_fetch_object + over db2_fetch_row/db2_result. In general + db2_fetch_row/db2_result have more issues + with various column types in EBCIDIC to ASCII + translation, including possible truncation in DBCS applications. + You may also find the performance of db2_fetch_both, + db2_fetch_array, and db2_fetch_object to + be superior to db2_fetch_row/db2_result. + + + DB2_SCROLLABLE)); + while ($row = db2_fetch_both($stmt)){ + echo "
db2_fetch_both {$row['SPECIFIC_NAME']} {$row['ROUTINE_CREATED']} {$row[5]}"; + } + $stmt = db2_exec($conn, $sql, array('cursor' => DB2_SCROLLABLE)); + while ($row = db2_fetch_array($stmt)){ + echo "
db2_fetch_array {$row[1]} {$row[5]}"; + } + $stmt = db2_exec($conn, $sql, array('cursor' => DB2_SCROLLABLE)); + while ($row = db2_fetch_object($stmt)){ + echo "
db2_fetch_object {$row->SPECIFIC_NAME} {$row->ROUTINE_CREATED}"; + } + db2_close($conn); +?> +]]> +
+ &example.outputs; + +
diff --git a/reference/ibm_db2/functions/db2-set-option.xml b/reference/ibm_db2/functions/db2-set-option.xml index 8f2774a12c..8e27e50a39 100644 --- a/reference/ibm_db2/functions/db2-set-option.xml +++ b/reference/ibm_db2/functions/db2-set-option.xml @@ -1,676 +1,739 @@ - - - - - db2_set_option - Set options for connection or statement resources - - - &reftitle.description; - - - booldb2_set_option - - - resourceresource - - - arrayoptions - - - inttype - - - Sets options for a statement resource or a connection resource. You - cannot set options for result set resources. - - - - &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. - - - - - options - - - An associative array containing valid statement or connection - options. This parameter can be used to change autocommit values, - cursor types (scrollable or forward), and to specify the case of - the column names (lower, upper, or natural) that will appear in a - result set. - - - autocommit - - - Passing DB2_AUTOCOMMIT_ON turns - autocommit on for the specified connection resource. - - - Passing DB2_AUTOCOMMIT_OFF turns - autocommit off for the specified connection resource. - - - - - cursor - - - Passing DB2_FORWARD_ONLY specifies a - forward-only cursor for a statement resource. This is the - default cursor type, and is supported by all database - servers. - - - Passing DB2_SCROLLABLE 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. - - - - - binmode - - - Passing DB2_BINARY specifies that - binary data will be returned as is. This is the default - mode. This is the equivalent of setting - ibm_db2.binmode=1 in &php.ini;. - - - Passing DB2_CONVERT specifies that - binary data will be converted to hexadecimal encoding, - and will be returned as such. This is the equivalent of - setting ibm_db2.binmode=2 in &php.ini;. - - - Passing DB2_PASSTHRU specifies that - binary data will be converted to &null;. This is the - equivalent of setting ibm_db2.binmode=3 - in &php.ini;. - - - - - db2_attr_case - - - Passing DB2_CASE_LOWER specifies that - column names of the result set are returned in lower case. - - - Passing DB2_CASE_UPPER specifies that - column names of the result set are returned in upper case. - - - Passing DB2_CASE_NATURAL specifies that - column names of the result set are returned in natural - case. - - - - - - - - - type - - - An integer value that specifies the type of resource that was - passed into the function. The type of resource and this value - must correspond. - - - - - - Passing 1 as the value specifies that - a connection resource has been passed into the function. - - - Passing any integer not equal to 1 as - the value specifies that a statement resource has been - passed into the function. - - - - - - - - - - - - - The following table specifies which options are compatible with - the available resource types: - - Resource-Parameter Matrix - - - - - - - - - - Key - Value - Resource Type - - - - - - Connection - Statement - Result Set - - - autocommit - DB2_AUTOCOMMIT_ON - X - - - - - - - autocommit - DB2_AUTOCOMMIT_OFF - X - - - - - - - cursor - DB2_SCROLLABLE - X - X - - - - - cursor - DB2_FORWARD_ONLY - X - X - - - - - binmode - DB2_BINARY - X - X - - - - - binmode - DB2_CONVERT - X - X - - - - - binmode - DB2_PASSTHRU - X - X - - - - - db2_attr_case - DB2_CASE_LOWER - X - X - - - - - db2_attr_case - DB2_CASE_UPPER - X - X - - - - - db2_attr_case - DB2_CASE_NATURAL - X - X - - - - - -
-
-
- - - &reftitle.returnvalues; - - &return.success; - - - - - - - &reftitle.examples; - - - - Setting one parameter with a connection resource - - - - DB2_AUTOCOMMIT_ON); - -/* Call the function using the correct resource, options array, and type values */ -$result = db2_set_option($conn, $options, 1); - -/* Check if all options could be set correctly */ -if($result) -{ - echo 'Options Set Successfully'; -} -else -{ - echo 'Could Not Set Options'; -} -?> -]]> - - &example.outputs; - - - - - Setting multiple parameters with a connection resource - - - - DB2_AUTOCOMMIT_OFF, - 'binmode' => DB2_PASSTHRU, - 'db2_attr_case' => DB2_CASE_UPPER, - 'cursor' => DB2_SCROLLABLE); - -/* Call the function using the correct resource, options array, and type values */ -$result = db2_set_option($conn, $options, 1); - -/* Check if all options could be set correctly */ -if($result) -{ - echo 'Options Set Successfully'; -} -else -{ - echo 'Could Not Set Options'; -} -?> -]]> - - &example.outputs; - - - - - - Setting multiple parameters with an invalid key - - - - DB2_AUTOCOMMIT_OFF, - 'MY_INVALID_KEY' => DB2_PASSTHRU, - 'db2_attr_case' => DB2_CASE_UPPER, - 'cursor' => DB2_SCROLLABLE); - -/* Call the function using the correct resource, options array, and type values */ -$result = db2_set_option($conn, $options, 1); - -/* Check if all options could be set correctly */ -if($result) -{ - echo 'Options Set Successfully'; -} -else -{ - echo 'Could Not Set Options'; -} -?> -]]> - - &example.outputs; - - - - - - Setting multiple parameters with an invalid value - - - - DB2_AUTOCOMMIT_OFF, - 'binmode' => 'INVALID_VALUE', - 'db2_attr_case' => DB2_CASE_UPPER, - 'cursor' => DB2_SCROLLABLE); - -/* Call the function using the correct resource, options array, and type values */ -$result = db2_set_option($conn, $options, 1); - -/* Check if all options could be set correctly */ -if($result) -{ - echo 'Options Set Successfully'; -} -else -{ - echo 'Could Not Set Options'; -} -?> -]]> - - &example.outputs; - - - - - Setting multiple parameters with a connection resource and the wrong type - - - - DB2_AUTOCOMMIT_OFF, - 'binmode' => DB2_PASSTHRU, - 'db2_attr_case' => DB2_CASE_UPPER, - 'cursor' => DB2_SCROLLABLE); - -/* Call the function using the correct resource, options array, and the wrong type value */ -$result = db2_set_option($conn, $options, 2); - -/* Check if all options could be set correctly */ -if($result) -{ - echo 'Options Set Successfully'; -} -else -{ - echo 'Could Not Set Options'; -} -?> -]]> - - &example.outputs; - - - - - Setting multiple parameters with the wrong resource - - - - DB2_AUTOCOMMIT_OFF, - 'binmode' => DB2_PASSTHRU, - 'db2_attr_case' => DB2_CASE_UPPER, - 'cursor' => DB2_SCROLLABLE); - -$stmt = db2_prepare($conn, 'SELECT * FROM EMPLOYEE'); - -/* Call the function using the wrong resource, and the correct options array, and type values */ -$result = db2_set_option($stmt, $options, 1); - -/* Check if all options could be set correctly */ -if($result) -{ - echo 'Options Set Successfully'; -} -else -{ - echo 'Could Not Set Options'; -} -?> -]]> - - &example.outputs; - - - - - Putting it all together - - - - DB2_CASE_LOWER, - 'cursor' => DB2_SCROLLABLE); - -$stmt = db2_prepare($conn, 'SELECT * FROM EMPLOYEE WHERE EMPNO = ? OR EMPNO = ?'); - -/* Call the function using the correct resource, options array, and type values */ -$option_result = db2_set_option($stmt, $options, 2); -$result = db2_execute($stmt, array('000130', '000140')); - -/* Get Row 2 before Row 1 since Scrollable Cursor */ -print_r(db2_fetch_assoc($stmt, 2)); -print '

'; -print_r(db2_fetch_assoc($stmt, 1)); - -?> -]]> -
- &example.outputs; - 000140 - [firstnme] => HEATHER - [midinit] => A - [lastname] => NICHOLLS - [workdept] => C01 - [phoneno] => 1793 - [hiredate] => 1976-12-15 - [job] => ANALYST - [edlevel] => 18 - [sex] => F - [birthdate] => 1946-01-19 - [salary] => 28420.00 - [bonus] => 600.00 - [comm] => 2274.00 -) - -Array -( - [empno] => 000130 - [firstnme] => DELORES - [midinit] => M - [lastname] => QUINTANA - [workdept] => C01 - [phoneno] => 4578 - [hiredate] => 1971-07-28 - [job] => ANALYST - [edlevel] => 16 - [sex] => F - [birthdate] => 1925-09-15 - [salary] => 23800.00 - [bonus] => 500.00 - [comm] => 1904.00 -)]]> -
-
-
- - &reftitle.seealso; - - - db2_connect - db2_pconnect - db2_exec - db2_prepare - db2_cursor_type - - - -
- - + + + + + db2_set_option + Set options for connection or statement resources + + + &reftitle.description; + + + booldb2_set_option + + + resourceresource + + + arrayoptions + + + inttype + + + Sets options for a statement resource or a connection resource. You + cannot set options for result set resources. + + + + &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. + + + + + options + + + An associative array containing valid statement or connection + options. This parameter can be used to change autocommit values, + cursor types (scrollable or forward), and to specify the case of + the column names (lower, upper, or natural) that will appear in a + result set. + + + autocommit + + + Passing DB2_AUTOCOMMIT_ON turns + autocommit on for the specified connection resource. + + + Passing DB2_AUTOCOMMIT_OFF turns + autocommit off for the specified connection resource. + + + + + cursor + + + Passing DB2_FORWARD_ONLY specifies a + forward-only cursor for a statement resource. This is the + default cursor type, and is supported by all database + servers. + + + Passing DB2_SCROLLABLE 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. + + + + + binmode + + + Passing DB2_BINARY specifies that + binary data will be returned as is. This is the default + mode. This is the equivalent of setting + ibm_db2.binmode=1 in &php.ini;. + + + Passing DB2_CONVERT specifies that + binary data will be converted to hexadecimal encoding, + and will be returned as such. This is the equivalent of + setting ibm_db2.binmode=2 in &php.ini;. + + + Passing DB2_PASSTHRU specifies that + binary data will be converted to &null;. This is the + equivalent of setting ibm_db2.binmode=3 + in &php.ini;. + + + + + db2_attr_case + + + Passing DB2_CASE_LOWER specifies that + column names of the result set are returned in lower case. + + + Passing DB2_CASE_UPPER specifies that + column names of the result set are returned in upper case. + + + Passing DB2_CASE_NATURAL specifies that + column names of the result set are returned in natural + case. + + + + + + + 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 + + + DB2_I5_FETCH_ON - Cursors are read-only + and cannot be used for positioned updates or deletes. This + is the default unless SQL_ATTR_FOR_FETCH_ONLY + environment has been set to SQL_FALSE. + + + DB2_I5_FETCH_OFF - Cursors can be used + for positioned updates and deletes. + + + + + + + + + type + + + An integer value that specifies the type of resource that was + passed into the function. The type of resource and this value + must correspond. + + + + + + Passing 1 as the value specifies that + a connection resource has been passed into the function. + + + Passing any integer not equal to 1 as + the value specifies that a statement resource has been + passed into the function. + + + + + + + + + + + + + The following table specifies which options are compatible with + the available resource types: + + Resource-Parameter Matrix + + + + + + + + + + Key + Value + Resource Type + + + + + + Connection + Statement + Result Set + + + autocommit + DB2_AUTOCOMMIT_ON + X + - + - + + + autocommit + DB2_AUTOCOMMIT_OFF + X + - + - + + + cursor + DB2_SCROLLABLE + X + X + - + + + cursor + DB2_FORWARD_ONLY + X + X + - + + + binmode + DB2_BINARY + X + X + - + + + binmode + DB2_CONVERT + X + X + - + + + binmode + DB2_PASSTHRU + X + X + - + + + db2_attr_case + DB2_CASE_LOWER + X + X + - + + + db2_attr_case + DB2_CASE_UPPER + X + X + - + + + db2_attr_case + DB2_CASE_NATURAL + X + X + - + + + i5_fetch_only + DB2_I5_FETCH_ON + - + X + - + + + i5_fetch_only + DB2_I5_FETCH_OFF + - + X + - + + + +
+
+
+ + + &reftitle.returnvalues; + + &return.success; + + + + + + + &reftitle.examples; + + + + Setting one parameter with a connection resource + + + + DB2_AUTOCOMMIT_ON); + +/* Call the function using the correct resource, options array, and type values */ +$result = db2_set_option($conn, $options, 1); + +/* Check if all options could be set correctly */ +if($result) +{ + echo 'Options Set Successfully'; +} +else +{ + echo 'Could Not Set Options'; +} +?> +]]> + + &example.outputs; + + + + + Setting multiple parameters with a connection resource + + + + DB2_AUTOCOMMIT_OFF, + 'binmode' => DB2_PASSTHRU, + 'db2_attr_case' => DB2_CASE_UPPER, + 'cursor' => DB2_SCROLLABLE); + +/* Call the function using the correct resource, options array, and type values */ +$result = db2_set_option($conn, $options, 1); + +/* Check if all options could be set correctly */ +if($result) +{ + echo 'Options Set Successfully'; +} +else +{ + echo 'Could Not Set Options'; +} +?> +]]> + + &example.outputs; + + + + + + Setting multiple parameters with an invalid key + + + + DB2_AUTOCOMMIT_OFF, + 'MY_INVALID_KEY' => DB2_PASSTHRU, + 'db2_attr_case' => DB2_CASE_UPPER, + 'cursor' => DB2_SCROLLABLE); + +/* Call the function using the correct resource, options array, and type values */ +$result = db2_set_option($conn, $options, 1); + +/* Check if all options could be set correctly */ +if($result) +{ + echo 'Options Set Successfully'; +} +else +{ + echo 'Could Not Set Options'; +} +?> +]]> + + &example.outputs; + + + + + + Setting multiple parameters with an invalid value + + + + DB2_AUTOCOMMIT_OFF, + 'binmode' => 'INVALID_VALUE', + 'db2_attr_case' => DB2_CASE_UPPER, + 'cursor' => DB2_SCROLLABLE); + +/* Call the function using the correct resource, options array, and type values */ +$result = db2_set_option($conn, $options, 1); + +/* Check if all options could be set correctly */ +if($result) +{ + echo 'Options Set Successfully'; +} +else +{ + echo 'Could Not Set Options'; +} +?> +]]> + + &example.outputs; + + + + + Setting multiple parameters with a connection resource and the wrong type + + + + DB2_AUTOCOMMIT_OFF, + 'binmode' => DB2_PASSTHRU, + 'db2_attr_case' => DB2_CASE_UPPER, + 'cursor' => DB2_SCROLLABLE); + +/* Call the function using the correct resource, options array, and the wrong type value */ +$result = db2_set_option($conn, $options, 2); + +/* Check if all options could be set correctly */ +if($result) +{ + echo 'Options Set Successfully'; +} +else +{ + echo 'Could Not Set Options'; +} +?> +]]> + + &example.outputs; + + + + + Setting multiple parameters with the wrong resource + + + + DB2_AUTOCOMMIT_OFF, + 'binmode' => DB2_PASSTHRU, + 'db2_attr_case' => DB2_CASE_UPPER, + 'cursor' => DB2_SCROLLABLE); + +$stmt = db2_prepare($conn, 'SELECT * FROM EMPLOYEE'); + +/* Call the function using the wrong resource, and the correct options array, and type values */ +$result = db2_set_option($stmt, $options, 1); + +/* Check if all options could be set correctly */ +if($result) +{ + echo 'Options Set Successfully'; +} +else +{ + echo 'Could Not Set Options'; +} +?> +]]> + + &example.outputs; + + + + + Putting it all together + + + + DB2_CASE_LOWER, + 'cursor' => DB2_SCROLLABLE); + +$stmt = db2_prepare($conn, 'SELECT * FROM EMPLOYEE WHERE EMPNO = ? OR EMPNO = ?'); + +/* Call the function using the correct resource, options array, and type values */ +$option_result = db2_set_option($stmt, $options, 2); +$result = db2_execute($stmt, array('000130', '000140')); + +/* Get Row 2 before Row 1 since Scrollable Cursor */ +print_r(db2_fetch_assoc($stmt, 2)); +print '

'; +print_r(db2_fetch_assoc($stmt, 1)); + +?> +]]> +
+ &example.outputs; + 000140 + [firstnme] => HEATHER + [midinit] => A + [lastname] => NICHOLLS + [workdept] => C01 + [phoneno] => 1793 + [hiredate] => 1976-12-15 + [job] => ANALYST + [edlevel] => 18 + [sex] => F + [birthdate] => 1946-01-19 + [salary] => 28420.00 + [bonus] => 600.00 + [comm] => 2274.00 +) + +Array +( + [empno] => 000130 + [firstnme] => DELORES + [midinit] => M + [lastname] => QUINTANA + [workdept] => C01 + [phoneno] => 4578 + [hiredate] => 1971-07-28 + [job] => ANALYST + [edlevel] => 16 + [sex] => F + [birthdate] => 1925-09-15 + [salary] => 23800.00 + [bonus] => 500.00 + [comm] => 1904.00 +)]]> +
+ + i5/OS cursors are read-only + + + +"nobody")); + $stmt = db2_prepare($conn, 'select * from names where first = ?'); + $name = "first2"; + db2_bind_param($stmt, 1, "name", DB2_PARAM_IN); + $options = array("i5_fetch_only"=>DB2_I5_FETCH_ON); + db2_set_option($stmt,$options,0); + if (db2_execute($stmt)) { + while ($row = db2_fetch_array($stmt)) { + echo "{$row[0]} {$row[1]}"; + } + } +?> +]]> + + &example.outputs; + + + + +
+
+ + &reftitle.seealso; + + + db2_connect + db2_pconnect + db2_exec + db2_prepare + db2_cursor_type + + + +
+ + diff --git a/reference/ibm_db2/ini.xml b/reference/ibm_db2/ini.xml index c1ce732b81..35106b5905 100644 --- a/reference/ibm_db2/ini.xml +++ b/reference/ibm_db2/ini.xml @@ -1,5 +1,5 @@ - +
&reftitle.runtime; &extension.runtime; @@ -22,6 +22,18 @@ PHP_INI_ALL + + ibm_db2.i5_allow_commit + "0" + PHP_INI_SYSTEM + + + + ibm_db2.i5_dbcs_alloc + "0" + PHP_INI_SYSTEM + + ibm_db2.instance_name NULL @@ -67,6 +79,54 @@ + + + ibm_db2.i5_allow_commit + integer + + + + This option controls the commit mode used for i5 schema collections + in the PHP application. + + + + 0 no commit (see i5_commit for override) + + + + + 1 allow commit (see i5_commit for override) + + + + + + + + + ibm_db2.i5_dbcs_alloc + integer + + + + This option controls the internal ibm_db2 allocation scheme + for large DBCS column buffers. + + + + 0 no expanded allocations (see i5_dbcs_alloc for override) + + + + + 1 use expanded allocations (see i5_dbcs_alloc for override) + + + + + + ibm_db2.instance_name