PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 5.9.0
Defender Security – Malware Scanner, Login Security & Firewall v5.9.0
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / vendor / thecodingmachine / safe / generated / ibmDb2.php

ibmDb2.php in Defender Security – Malware Scanner, Login Security & Firewall 5.9.0, at vendor/thecodingmachine/safe/generated/ibmDb2.php

1,225 lines 31.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Safe;
4
5 use Safe\Exceptions\IbmDb2Exception;
6
7 /**
8 * Sets or gets the AUTOCOMMIT behavior of the specified connection resource.
9 *
10 * @param resource $connection A valid database connection resource variable as returned from
11 * db2_connect or db2_pconnect.
12 * @param int|null $value One of the following constants:
13 *
14 *
15 * DB2_AUTOCOMMIT_OFF
16 *
17 *
18 * Turns AUTOCOMMIT off.
19 *
20 *
21 *
22 *
23 * DB2_AUTOCOMMIT_ON
24 *
25 *
26 * Turns AUTOCOMMIT on.
27 *
28 *
29 *
30 *
31 *
32 * Turns AUTOCOMMIT off.
33 *
34 * Turns AUTOCOMMIT on.
35 *
36 * @return mixed When db2_autocommit receives only the
37 * connection parameter, it returns the current state
38 * of AUTOCOMMIT for the requested connection as an integer value. A value of
39 * DB2_AUTOCOMMIT_OFF indicates that AUTOCOMMIT is off, while a value of DB2_AUTOCOMMIT_ON indicates that
40 * AUTOCOMMIT is on.
41 *
42 * When db2_autocommit receives both the
43 * connection parameter and
44 * autocommit parameter, it attempts to set the
45 * AUTOCOMMIT state of the requested connection to the corresponding state.
46 * Returns TRUE on success.
47 * @throws IbmDb2Exception
48 *
49 */
50 function db2_autocommit($connection, ?int $value = null)
51 {
52 error_clear_last();
53 if ($value !== null) {
54 $result = \db2_autocommit($connection, $value);
55 } else {
56 $result = \db2_autocommit($connection);
57 }
58 if ($result === false) {
59 throw IbmDb2Exception::createFromPhpError();
60 }
61 return $result;
62 }
63
64
65 /**
66 * Binds a PHP variable to an SQL statement parameter in a statement resource
67 * returned by db2_prepare. This function gives you more
68 * control over the parameter type, data type, precision, and scale for the
69 * parameter than simply passing the variable as part of the optional input
70 * array to db2_execute.
71 *
72 * @param resource $stmt A prepared statement returned from db2_prepare.
73 * @param int $parameter_number Specifies the 1-indexed position of the parameter in the prepared
74 * statement.
75 * @param string $variable_name A string specifying the name of the PHP variable to bind to the
76 * parameter specified by parameter_number.
77 * @param int|null $parameter_type A constant specifying whether the PHP variable should be bound to the
78 * SQL parameter as an input parameter (DB2_PARAM_IN),
79 * an output parameter (DB2_PARAM_OUT), or as a
80 * parameter that accepts input and returns output
81 * (DB2_PARAM_INOUT). To avoid memory overhead, you can
82 * also specify DB2_PARAM_FILE to bind the PHP variable
83 * to the name of a file that contains large object (BLOB, CLOB, or DBCLOB)
84 * data.
85 * @param int $data_type A constant specifying the SQL data type that the PHP variable should be
86 * bound as: one of DB2_BINARY,
87 * DB2_CHAR, DB2_DOUBLE, or
88 * DB2_LONG .
89 * @param int $precision Specifies the precision with which the variable should be bound to the
90 * database. This parameter can also be used for retrieving XML output values
91 * from stored procedures. A non-negative value specifies the maximum size of
92 * the XML data that will be retrieved from the database. If this parameter
93 * is not used, a default of 1MB will be assumed for retrieving the XML
94 * output value from the stored procedure.
95 * @param int $scale Specifies the scale with which the variable should be bound to the
96 * database.
97 *
98 * @throws IbmDb2Exception
99 *
100 */
101 function db2_bind_param($stmt, int $parameter_number, string $variable_name, ?int $parameter_type = null, int $data_type = 0, int $precision = -1, int $scale = 0): void
102 {
103 error_clear_last();
104 if ($scale !== 0) {
105 $result = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type, $data_type, $precision, $scale);
106 } elseif ($precision !== -1) {
107 $result = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type, $data_type, $precision);
108 } elseif ($data_type !== 0) {
109 $result = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type, $data_type);
110 } elseif ($parameter_type !== null) {
111 $result = \db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type);
112 } else {
113 $result = \db2_bind_param($stmt, $parameter_number, $variable_name);
114 }
115 if ($result === false) {
116 throw IbmDb2Exception::createFromPhpError();
117 }
118 }
119
120
121 /**
122 * This function returns an object with read-only properties that return
123 * information about the DB2 database client. The following table lists
124 * the DB2 client properties:
125 *
126 * DB2 client properties
127 *
128 *
129 *
130 * Property name
131 * Return type
132 * Description
133 *
134 *
135 *
136 *
137 * APPL_CODEPAGE
138 * int
139 * The application code page.
140 *
141 *
142 * CONN_CODEPAGE
143 * int
144 * The code page for the current connection.
145 *
146 *
147 * DATA_SOURCE_NAME
148 * string
149 * The data source name (DSN) used to create the current connection
150 * to the database.
151 *
152 *
153 * DRIVER_NAME
154 * string
155 * The name of the library that implements the DB2 Call
156 * Level Interface (CLI) specification.
157 *
158 *
159 * DRIVER_ODBC_VER
160 * string
161 * The version of ODBC that the DB2 client supports. This returns a
162 * string "MM.mm" where MM is the major version and
163 * mm is the minor version. The DB2 client always
164 * returns "03.51".
165 *
166 *
167 *
168 * DRIVER_VER
169 * string
170 * The version of the client, in the form of a string "MM.mm.uuuu" where
171 * MM is the major version,
172 * mm is the minor version,
173 * and uuuu is the update. For example, "08.02.0001"
174 * represents major version 8, minor version 2, update 1.
175 *
176 *
177 *
178 * ODBC_SQL_CONFORMANCE
179 * string
180 *
181 * The level of ODBC SQL grammar supported by the client:
182 *
183 *
184 * MINIMUM
185 *
186 *
187 * Supports the minimum ODBC SQL grammar.
188 *
189 *
190 *
191 *
192 * CORE
193 *
194 *
195 * Supports the core ODBC SQL grammar.
196 *
197 *
198 *
199 *
200 * EXTENDED
201 *
202 *
203 * Supports extended ODBC SQL grammar.
204 *
205 *
206 *
207 *
208 *
209 *
210 *
211 *
212 * ODBC_VER
213 * string
214 * The version of ODBC that the ODBC driver manager supports. This
215 * returns a string "MM.mm.rrrr" where MM is the major
216 * version, mm is the minor version, and
217 * rrrr is the release. The DB2 client always returns
218 * "03.01.0000".
219 *
220 *
221 *
222 *
223 *
224 *
225 * @param resource $connection Specifies an active DB2 client connection.
226 * @return object Returns an object on a successful call. Returns FALSE on failure.
227 * @throws IbmDb2Exception
228 *
229 */
230 function db2_client_info($connection): object
231 {
232 error_clear_last();
233 $result = \db2_client_info($connection);
234 if ($result === false) {
235 throw IbmDb2Exception::createFromPhpError();
236 }
237 return $result;
238 }
239
240
241 /**
242 * This function closes a DB2 client connection created with
243 * db2_connect and returns the corresponding
244 * resources to the database server.
245 *
246 * If you attempt to close a persistent DB2 client connection created with
247 * db2_pconnect, the close request is ignored and the
248 * persistent DB2 client connection remains available for the next caller.
249 *
250 * @param resource $connection Specifies an active DB2 client connection.
251 * @throws IbmDb2Exception
252 *
253 */
254 function db2_close($connection): void
255 {
256 error_clear_last();
257 $result = \db2_close($connection);
258 if ($result === false) {
259 throw IbmDb2Exception::createFromPhpError();
260 }
261 }
262
263
264 /**
265 * Commits an in-progress transaction on the specified connection resource and
266 * begins a new transaction. PHP applications normally default to AUTOCOMMIT
267 * mode, so db2_commit is not necessary unless AUTOCOMMIT
268 * has been turned off for the connection resource.
269 *
270 * @param resource $connection A valid database connection resource variable as returned from
271 * db2_connect or db2_pconnect.
272 * @throws IbmDb2Exception
273 *
274 */
275 function db2_commit($connection): void
276 {
277 error_clear_last();
278 $result = \db2_commit($connection);
279 if ($result === false) {
280 throw IbmDb2Exception::createFromPhpError();
281 }
282 }
283
284
285 /**
286 * db2_execute executes an SQL statement that was
287 * prepared by db2_prepare.
288 *
289 * If the SQL statement returns a result set, for example, a SELECT statement
290 * or a CALL to a stored procedure that returns one or more result sets, you
291 * can retrieve a row as an array from the stmt resource
292 * using db2_fetch_assoc,
293 * db2_fetch_both, or
294 * db2_fetch_array. Alternatively, you can use
295 * db2_fetch_row to move the result set pointer to the
296 * next row and fetch a column at a time from that row with
297 * db2_result.
298 *
299 * Refer to db2_prepare for a brief discussion of the
300 * advantages of using db2_prepare and
301 * db2_execute rather than db2_exec.
302 *
303 * @param resource $stmt A prepared statement returned from db2_prepare.
304 * @param array|null $parameters An array of input parameters matching any parameter markers contained
305 * in the prepared statement.
306 *
307 * @throws IbmDb2Exception
308 *
309 */
310 function db2_execute($stmt, ?array $parameters = null): void
311 {
312 error_clear_last();
313 if ($parameters !== null) {
314 $result = \db2_execute($stmt, $parameters);
315 } else {
316 $result = \db2_execute($stmt);
317 }
318 if ($result === false) {
319 throw IbmDb2Exception::createFromPhpError();
320 }
321 }
322
323
324 /**
325 * Frees the system and database resources that are associated with a result
326 * set. These resources are freed implicitly when a script finishes, but you
327 * can call db2_free_result to explicitly free the result
328 * set resources before the end of the script.
329 *
330 * @param resource $stmt A valid statement resource.
331 * @throws IbmDb2Exception
332 *
333 */
334 function db2_free_result($stmt): void
335 {
336 error_clear_last();
337 $result = \db2_free_result($stmt);
338 if ($result === false) {
339 throw IbmDb2Exception::createFromPhpError();
340 }
341 }
342
343
344 /**
345 * Frees the system and database resources that are associated with a statement
346 * resource. These resources are freed implicitly when a script finishes, but
347 * you can call db2_free_stmt to explicitly free the
348 * statement resources before the end of the script.
349 *
350 * @param resource $stmt A valid statement resource.
351 * @throws IbmDb2Exception
352 *
353 */
354 function db2_free_stmt($stmt): void
355 {
356 error_clear_last();
357 $result = \db2_free_stmt($stmt);
358 if ($result === false) {
359 throw IbmDb2Exception::createFromPhpError();
360 }
361 }
362
363
364 /**
365 * Retrieves the value of a specified option value for a statement resource
366 * or a connection resource.
367 *
368 * @param resource $resource A valid statement resource as returned from
369 * db2_prepare or a valid connection resource as
370 * returned from db2_connect or
371 * db2_pconnect.
372 * @param string $option A valid statement or connection options. The following new options are available
373 * as of ibm_db2 version 1.6.0. They provide useful tracking information
374 * that can be set during execution with db2_get_option.
375 *
376 *
377 * Prior versions of ibm_db2 do not support these new options.
378 *
379 *
380 * When the value in each option is being set, some servers might not handle
381 * the entire length provided and might truncate the value.
382 *
383 *
384 * To ensure that the data specified in each option is converted correctly
385 * when transmitted to a host system, use only the characters A through Z,
386 * 0 through 9, and the underscore (_) or period (.).
387 *
388 *
389 *
390 *
391 * userid
392 *
393 *
394 * SQL_ATTR_INFO_USERID - A pointer to a null-terminated
395 * character string used to identify the client user ID sent to the host
396 * database server when using DB2 Connect.
397 *
398 *
399 * DB2 for z/OS and OS/390 servers support up to a length of 16 characters.
400 * This user-id is not to be confused with the authentication user-id, it is for
401 * identification purposes only and is not used for any authorization.
402 *
403 *
404 *
405 *
406 *
407 *
408 * acctstr
409 *
410 *
411 * SQL_ATTR_INFO_ACCTSTR - A pointer to a null-terminated
412 * character string used to identify the client accounting string sent to the
413 * host database server when using DB2 Connect.
414 *
415 *
416 * DB2 for z/OS and OS/390 servers support up to a length of 200 characters.
417 *
418 *
419 *
420 *
421 *
422 *
423 * applname
424 *
425 *
426 * SQL_ATTR_INFO_APPLNAME - A pointer to a null-terminated
427 * character string used to identify the client application name sent to the
428 * host database server when using DB2 Connect.
429 *
430 *
431 * DB2 for z/OS and OS/390 servers support up to a length of 32 characters.
432 *
433 *
434 *
435 *
436 *
437 *
438 * wrkstnname
439 *
440 *
441 * SQL_ATTR_INFO_WRKSTNNAME - A pointer to a null-terminated
442 * character string used to identify the client workstation name sent to the
443 * host database server when using DB2 Connect.
444 *
445 *
446 * DB2 for z/OS and OS/390 servers support up to a length of 18 characters.
447 *
448 *
449 *
450 *
451 *
452 *
453 *
454 * Prior versions of ibm_db2 do not support these new options.
455 *
456 * When the value in each option is being set, some servers might not handle
457 * the entire length provided and might truncate the value.
458 *
459 * To ensure that the data specified in each option is converted correctly
460 * when transmitted to a host system, use only the characters A through Z,
461 * 0 through 9, and the underscore (_) or period (.).
462 *
463 * SQL_ATTR_INFO_USERID - A pointer to a null-terminated
464 * character string used to identify the client user ID sent to the host
465 * database server when using DB2 Connect.
466 *
467 *
468 * DB2 for z/OS and OS/390 servers support up to a length of 16 characters.
469 * This user-id is not to be confused with the authentication user-id, it is for
470 * identification purposes only and is not used for any authorization.
471 *
472 *
473 *
474 * DB2 for z/OS and OS/390 servers support up to a length of 16 characters.
475 * This user-id is not to be confused with the authentication user-id, it is for
476 * identification purposes only and is not used for any authorization.
477 *
478 * SQL_ATTR_INFO_ACCTSTR - A pointer to a null-terminated
479 * character string used to identify the client accounting string sent to the
480 * host database server when using DB2 Connect.
481 *
482 *
483 * DB2 for z/OS and OS/390 servers support up to a length of 200 characters.
484 *
485 *
486 *
487 * DB2 for z/OS and OS/390 servers support up to a length of 200 characters.
488 *
489 * SQL_ATTR_INFO_APPLNAME - A pointer to a null-terminated
490 * character string used to identify the client application name sent to the
491 * host database server when using DB2 Connect.
492 *
493 *
494 * DB2 for z/OS and OS/390 servers support up to a length of 32 characters.
495 *
496 *
497 *
498 * DB2 for z/OS and OS/390 servers support up to a length of 32 characters.
499 *
500 * SQL_ATTR_INFO_WRKSTNNAME - A pointer to a null-terminated
501 * character string used to identify the client workstation name sent to the
502 * host database server when using DB2 Connect.
503 *
504 *
505 * DB2 for z/OS and OS/390 servers support up to a length of 18 characters.
506 *
507 *
508 *
509 * DB2 for z/OS and OS/390 servers support up to a length of 18 characters.
510 * @return string Returns the current setting of the connection attribute provided on success.
511 * @throws IbmDb2Exception
512 *
513 */
514 function db2_get_option($resource, string $option): string
515 {
516 error_clear_last();
517 $result = \db2_get_option($resource, $option);
518 if ($result === false) {
519 throw IbmDb2Exception::createFromPhpError();
520 }
521 return $result;
522 }
523
524
525 /**
526 * This function closes a DB2 client connection created with
527 * db2_pconnect and returns the corresponding resources
528 * to the database server.
529 *
530 *
531 * This function is only available on i5/OS in response to i5/OS system
532 * administration requests.
533 *
534 *
535 *
536 * If you have a persistent DB2 client connection created with
537 * db2_pconnect, you may use this function to close the
538 * connection. To avoid substantial connection performance penalties, this
539 * function should only be used in rare cases when the persistent connection
540 * has become unresponsive or the persistent connection will not be needed for
541 * a long period of time.
542 *
543 * @param resource $resource Specifies an active DB2 client connection.
544 * @throws IbmDb2Exception
545 *
546 */
547 function db2_pclose($resource): void
548 {
549 error_clear_last();
550 $result = \db2_pclose($resource);
551 if ($result === false) {
552 throw IbmDb2Exception::createFromPhpError();
553 }
554 }
555
556
557 /**
558 * Rolls back an in-progress transaction on the specified connection resource and
559 * begins a new transaction. PHP applications normally default to AUTOCOMMIT
560 * mode, so db2_rollback normally has no effect unless
561 * AUTOCOMMIT has been turned off for the connection resource.
562 *
563 * @param resource $connection A valid database connection resource variable as returned from
564 * db2_connect or db2_pconnect.
565 * @throws IbmDb2Exception
566 *
567 */
568 function db2_rollback($connection): void
569 {
570 error_clear_last();
571 $result = \db2_rollback($connection);
572 if ($result === false) {
573 throw IbmDb2Exception::createFromPhpError();
574 }
575 }
576
577
578 /**
579 * This function returns an object with read-only properties that return
580 * information about the IBM DB2, Cloudscape, or Apache Derby database server.
581 * The following table lists the database server properties:
582 *
583 * Database server properties
584 *
585 *
586 *
587 * Property name
588 * Return type
589 * Description
590 *
591 *
592 *
593 *
594 * DBMS_NAME
595 * string
596 * The name of the database server to which you are
597 * connected. For DB2 servers this is a combination of
598 * DB2 followed by the operating system on which
599 * the database server is running.
600 *
601 *
602 * DBMS_VER
603 * string
604 * The version of the database server, in the form of a string
605 * "MM.mm.uuuu" where MM is the major version,
606 * mm is the minor version,
607 * and uuuu is the update. For example, "08.02.0001"
608 * represents major version 8, minor version 2, update 1.
609 *
610 *
611 *
612 * DB_CODEPAGE
613 * int
614 * The code page of the database to which you are connected.
615 *
616 *
617 * DB_NAME
618 * string
619 * The name of the database to which you are connected.
620 *
621 *
622 * DFT_ISOLATION
623 * string
624 *
625 * The default transaction isolation level supported by the
626 * server:
627 *
628 *
629 * UR
630 *
631 *
632 * Uncommitted read: changes are immediately visible by all
633 * concurrent transactions.
634 *
635 *
636 *
637 *
638 * CS
639 *
640 *
641 * Cursor stability: a row read by one transaction can be altered and
642 * committed by a second concurrent transaction.
643 *
644 *
645 *
646 *
647 * RS
648 *
649 *
650 * Read stability: a transaction can add or remove rows matching a
651 * search condition or a pending transaction.
652 *
653 *
654 *
655 *
656 * RR
657 *
658 *
659 * Repeatable read: data affected by pending transaction is not
660 * available to other transactions.
661 *
662 *
663 *
664 *
665 * NC
666 *
667 *
668 * No commit: any changes are visible at the end of a successful
669 * operation. Explicit commits and rollbacks are not allowed.
670 *
671 *
672 *
673 *
674 *
675 *
676 *
677 *
678 * IDENTIFIER_QUOTE_CHAR
679 * string
680 * The character used to delimit an identifier.
681 *
682 *
683 * INST_NAME
684 * string
685 * The instance on the database server that contains the
686 * database.
687 *
688 *
689 * ISOLATION_OPTION
690 * array
691 * An array of the isolation options supported by the
692 * database server. The isolation options are described in
693 * the DFT_ISOLATION property.
694 *
695 *
696 * KEYWORDS
697 * array
698 * An array of the keywords reserved by the database
699 * server.
700 *
701 *
702 * LIKE_ESCAPE_CLAUSE
703 * bool
704 * TRUE if the database server supports the
705 * use of % and _ wildcard
706 * characters. FALSE if the database server does not
707 * support these wildcard characters.
708 *
709 *
710 * MAX_COL_NAME_LEN
711 * int
712 * Maximum length of a column name supported by the database
713 * server, expressed in bytes.
714 *
715 *
716 * MAX_IDENTIFIER_LEN
717 * int
718 * Maximum length of an SQL identifier supported by the database
719 * server, expressed in characters.
720 *
721 *
722 * MAX_INDEX_SIZE
723 * int
724 * Maximum size of columns combined in an index supported by the
725 * database server, expressed in bytes.
726 *
727 *
728 * MAX_PROC_NAME_LEN
729 * int
730 * Maximum length of a procedure name supported by the database
731 * server, expressed in bytes.
732 *
733 *
734 * MAX_ROW_SIZE
735 * int
736 * Maximum length of a row in a base table supported by the
737 * database server, expressed in bytes.
738 *
739 *
740 * MAX_SCHEMA_NAME_LEN
741 * int
742 * Maximum length of a schema name supported by the database
743 * server, expressed in bytes.
744 *
745 *
746 * MAX_STATEMENT_LEN
747 * int
748 * Maximum length of an SQL statement supported by the database
749 * server, expressed in bytes.
750 *
751 *
752 * MAX_TABLE_NAME_LEN
753 * int
754 * Maximum length of a table name supported by the database
755 * server, expressed in bytes.
756 *
757 *
758 * NON_NULLABLE_COLUMNS
759 * bool
760 * TRUE if the database server supports columns that can be
761 * defined as NOT NULL, FALSE if the database server does not support
762 * columns defined as NOT NULL.
763 *
764 *
765 * PROCEDURES
766 * bool
767 * TRUE if the database server supports the use of the CALL
768 * statement to call stored procedures, FALSE if the database
769 * server does not support the CALL statement.
770 *
771 *
772 * SPECIAL_CHARS
773 * string
774 * A string containing all of the characters other than
775 * a-Z, 0-9, and underscore that can be used in an identifier name.
776 *
777 *
778 * SQL_CONFORMANCE
779 * string
780 *
781 * The level of conformance to the ANSI/ISO SQL-92 specification
782 * offered by the database server:
783 *
784 *
785 * ENTRY
786 *
787 *
788 * Entry-level SQL-92 compliance.
789 *
790 *
791 *
792 *
793 * FIPS127
794 *
795 *
796 * FIPS-127-2 transitional compliance.
797 *
798 *
799 *
800 *
801 * FULL
802 *
803 *
804 * Full level SQL-92 compliance.
805 *
806 *
807 *
808 *
809 * INTERMEDIATE
810 *
811 *
812 * Intermediate level SQL-92 compliance.
813 *
814 *
815 *
816 *
817 *
818 *
819 *
820 *
821 *
822 *
823 *
824 * @param resource $connection Specifies an active DB2 client connection.
825 * @return object Returns an object on a successful call. Returns FALSE on failure.
826 * @throws IbmDb2Exception
827 *
828 */
829 function db2_server_info($connection): object
830 {
831 error_clear_last();
832 $result = \db2_server_info($connection);
833 if ($result === false) {
834 throw IbmDb2Exception::createFromPhpError();
835 }
836 return $result;
837 }
838
839
840 /**
841 * Sets options for a statement resource or a connection resource. You
842 * cannot set options for result set resources.
843 *
844 * @param resource $resource A valid statement resource as returned from
845 * db2_prepare or a valid connection resource as
846 * returned from db2_connect or
847 * db2_pconnect.
848 * @param array $options An associative array containing valid statement or connection
849 * options. This parameter can be used to change autocommit values,
850 * cursor types (scrollable or forward), and to specify the case of
851 * the column names (lower, upper, or natural) that will appear in a
852 * result set.
853 *
854 *
855 * autocommit
856 *
857 *
858 * Passing DB2_AUTOCOMMIT_ON turns
859 * autocommit on for the specified connection resource.
860 *
861 *
862 * Passing DB2_AUTOCOMMIT_OFF turns
863 * autocommit off for the specified connection resource.
864 *
865 *
866 *
867 *
868 * cursor
869 *
870 *
871 * Passing DB2_FORWARD_ONLY specifies a
872 * forward-only cursor for a statement resource. This is the
873 * default cursor type, and is supported by all database
874 * servers.
875 *
876 *
877 * Passing DB2_SCROLLABLE specifies a
878 * scrollable cursor for a statement resource. Scrollable
879 * cursors enable result set rows to be accessed in
880 * non-sequential order, but are only supported by
881 * IBM DB2 Universal Database databases.
882 *
883 *
884 *
885 *
886 * binmode
887 *
888 *
889 * Passing DB2_BINARY specifies that
890 * binary data will be returned as is. This is the default
891 * mode. This is the equivalent of setting
892 * ibm_db2.binmode=1 in php.ini.
893 *
894 *
895 * Passing DB2_CONVERT specifies that
896 * binary data will be converted to hexadecimal encoding,
897 * and will be returned as such. This is the equivalent of
898 * setting ibm_db2.binmode=2 in php.ini.
899 *
900 *
901 * Passing DB2_PASSTHRU specifies that
902 * binary data will be converted to NULL. This is the
903 * equivalent of setting ibm_db2.binmode=3
904 * in php.ini.
905 *
906 *
907 *
908 *
909 * db2_attr_case
910 *
911 *
912 * Passing DB2_CASE_LOWER specifies that
913 * column names of the result set are returned in lower case.
914 *
915 *
916 * Passing DB2_CASE_UPPER specifies that
917 * column names of the result set are returned in upper case.
918 *
919 *
920 * Passing DB2_CASE_NATURAL specifies that
921 * column names of the result set are returned in natural
922 * case.
923 *
924 *
925 *
926 *
927 * deferred_prepare
928 *
929 *
930 * Passing DB2_DEFERRED_PREPARE_ON turns deferred
931 * prepare on for the specified statement resource.
932 *
933 *
934 * Passing DB2_DEFERRED_PREPARE_OFF turns deferred
935 * prepare off for the specified statement resource.
936 *
937 *
938 *
939 *
940 *
941 * Passing DB2_AUTOCOMMIT_ON turns
942 * autocommit on for the specified connection resource.
943 *
944 * Passing DB2_AUTOCOMMIT_OFF turns
945 * autocommit off for the specified connection resource.
946 *
947 * Passing DB2_FORWARD_ONLY specifies a
948 * forward-only cursor for a statement resource. This is the
949 * default cursor type, and is supported by all database
950 * servers.
951 *
952 * Passing DB2_SCROLLABLE specifies a
953 * scrollable cursor for a statement resource. Scrollable
954 * cursors enable result set rows to be accessed in
955 * non-sequential order, but are only supported by
956 * IBM DB2 Universal Database databases.
957 *
958 * Passing DB2_BINARY specifies that
959 * binary data will be returned as is. This is the default
960 * mode. This is the equivalent of setting
961 * ibm_db2.binmode=1 in php.ini.
962 *
963 * Passing DB2_CONVERT specifies that
964 * binary data will be converted to hexadecimal encoding,
965 * and will be returned as such. This is the equivalent of
966 * setting ibm_db2.binmode=2 in php.ini.
967 *
968 * Passing DB2_PASSTHRU specifies that
969 * binary data will be converted to NULL. This is the
970 * equivalent of setting ibm_db2.binmode=3
971 * in php.ini.
972 *
973 * Passing DB2_CASE_LOWER specifies that
974 * column names of the result set are returned in lower case.
975 *
976 * Passing DB2_CASE_UPPER specifies that
977 * column names of the result set are returned in upper case.
978 *
979 * Passing DB2_CASE_NATURAL specifies that
980 * column names of the result set are returned in natural
981 * case.
982 *
983 * Passing DB2_DEFERRED_PREPARE_ON turns deferred
984 * prepare on for the specified statement resource.
985 *
986 * Passing DB2_DEFERRED_PREPARE_OFF turns deferred
987 * prepare off for the specified statement resource.
988 *
989 * The following new i5/OS options are available in ibm_db2 version 1.5.1
990 * and later. These options apply only when running PHP and ibm_db2 natively on i5 systems.
991 *
992 *
993 * i5_fetch_only
994 *
995 *
996 * DB2_I5_FETCH_ON - Cursors are read-only
997 * and cannot be used for positioned updates or deletes. This
998 * is the default unless SQL_ATTR_FOR_FETCH_ONLY
999 * environment has been set to SQL_FALSE.
1000 *
1001 *
1002 * DB2_I5_FETCH_OFF - Cursors can be used
1003 * for positioned updates and deletes.
1004 *
1005 *
1006 *
1007 *
1008 *
1009 * DB2_I5_FETCH_ON - Cursors are read-only
1010 * and cannot be used for positioned updates or deletes. This
1011 * is the default unless SQL_ATTR_FOR_FETCH_ONLY
1012 * environment has been set to SQL_FALSE.
1013 *
1014 * DB2_I5_FETCH_OFF - Cursors can be used
1015 * for positioned updates and deletes.
1016 *
1017 * The following new option is available in ibm_db2 version 1.8.0 and later.
1018 *
1019 *
1020 * rowcount
1021 *
1022 *
1023 * DB2_ROWCOUNT_PREFETCH_ON - Client can request
1024 * the full row count prior to fetching, which means that
1025 * db2_num_rows returns the number of rows selected
1026 * even when a ROLLFORWARD_ONLY cursor is used.
1027 *
1028 *
1029 * DB2_ROWCOUNT_PREFETCH_OFF - Client cannot request
1030 * the full row count prior to fetching.
1031 *
1032 *
1033 *
1034 *
1035 *
1036 * DB2_ROWCOUNT_PREFETCH_ON - Client can request
1037 * the full row count prior to fetching, which means that
1038 * db2_num_rows returns the number of rows selected
1039 * even when a ROLLFORWARD_ONLY cursor is used.
1040 *
1041 * DB2_ROWCOUNT_PREFETCH_OFF - Client cannot request
1042 * the full row count prior to fetching.
1043 *
1044 * The following new options are available in ibm_db2 version 1.7.0 and later.
1045 *
1046 *
1047 * trusted_user
1048 *
1049 *
1050 * To switch the user to a trusted user, pass the User ID (String)
1051 * of the trusted user as the value of this key. This option can
1052 * be set on a connection resource only. To use this option, trusted
1053 * context must be enabled on the connection resource.
1054 *
1055 *
1056 *
1057 *
1058 * trusted_password
1059 *
1060 *
1061 * The password (String) that corresponds to the user specified
1062 * by the trusted_user key.
1063 *
1064 *
1065 *
1066 *
1067 *
1068 * To switch the user to a trusted user, pass the User ID (String)
1069 * of the trusted user as the value of this key. This option can
1070 * be set on a connection resource only. To use this option, trusted
1071 * context must be enabled on the connection resource.
1072 *
1073 * The password (String) that corresponds to the user specified
1074 * by the trusted_user key.
1075 *
1076 * The following new options are available in ibm_db2 version 1.6.0 and later.
1077 * These options provide useful tracking information that can be accessed during
1078 * execution with db2_get_option.
1079 *
1080 *
1081 * When the value in each option is being set, some servers might not handle
1082 * the entire length provided and might truncate the value.
1083 *
1084 *
1085 * To ensure that the data specified in each option is converted correctly
1086 * when transmitted to a host system, use only the characters A through Z,
1087 * 0 through 9, and the underscore (_) or period (.).
1088 *
1089 *
1090 *
1091 *
1092 * userid
1093 *
1094 *
1095 * SQL_ATTR_INFO_USERID - A pointer to a null-terminated
1096 * character string used to identify the client user ID sent to the host
1097 * database server when using DB2 Connect.
1098 *
1099 *
1100 * DB2 for z/OS and OS/390 servers support up to a length of 16 characters.
1101 * This user-id is not to be confused with the authentication user-id, it is for
1102 * identification purposes only and is not used for any authorization.
1103 *
1104 *
1105 *
1106 *
1107 *
1108 *
1109 * acctstr
1110 *
1111 *
1112 * SQL_ATTR_INFO_ACCTSTR - A pointer to a null-terminated
1113 * character string used to identify the client accounting string sent to the
1114 * host database server when using DB2 Connect.
1115 *
1116 *
1117 * DB2 for z/OS and OS/390 servers support up to a length of 200 characters.
1118 *
1119 *
1120 *
1121 *
1122 *
1123 *
1124 * applname
1125 *
1126 *
1127 * SQL_ATTR_INFO_APPLNAME - A pointer to a null-terminated
1128 * character string used to identify the client application name sent to the
1129 * host database server when using DB2 Connect.
1130 *
1131 *
1132 * DB2 for z/OS and OS/390 servers support up to a length of 32 characters.
1133 *
1134 *
1135 *
1136 *
1137 *
1138 *
1139 * wrkstnname
1140 *
1141 *
1142 * SQL_ATTR_INFO_WRKSTNNAME - A pointer to a null-terminated
1143 * character string used to identify the client workstation name sent to the
1144 * host database server when using DB2 Connect.
1145 *
1146 *
1147 * DB2 for z/OS and OS/390 servers support up to a length of 18 characters.
1148 *
1149 *
1150 *
1151 *
1152 *
1153 *
1154 *
1155 * When the value in each option is being set, some servers might not handle
1156 * the entire length provided and might truncate the value.
1157 *
1158 * To ensure that the data specified in each option is converted correctly
1159 * when transmitted to a host system, use only the characters A through Z,
1160 * 0 through 9, and the underscore (_) or period (.).
1161 *
1162 * SQL_ATTR_INFO_USERID - A pointer to a null-terminated
1163 * character string used to identify the client user ID sent to the host
1164 * database server when using DB2 Connect.
1165 *
1166 *
1167 * DB2 for z/OS and OS/390 servers support up to a length of 16 characters.
1168 * This user-id is not to be confused with the authentication user-id, it is for
1169 * identification purposes only and is not used for any authorization.
1170 *
1171 *
1172 *
1173 * DB2 for z/OS and OS/390 servers support up to a length of 16 characters.
1174 * This user-id is not to be confused with the authentication user-id, it is for
1175 * identification purposes only and is not used for any authorization.
1176 *
1177 * SQL_ATTR_INFO_ACCTSTR - A pointer to a null-terminated
1178 * character string used to identify the client accounting string sent to the
1179 * host database server when using DB2 Connect.
1180 *
1181 *
1182 * DB2 for z/OS and OS/390 servers support up to a length of 200 characters.
1183 *
1184 *
1185 *
1186 * DB2 for z/OS and OS/390 servers support up to a length of 200 characters.
1187 *
1188 * SQL_ATTR_INFO_APPLNAME - A pointer to a null-terminated
1189 * character string used to identify the client application name sent to the
1190 * host database server when using DB2 Connect.
1191 *
1192 *
1193 * DB2 for z/OS and OS/390 servers support up to a length of 32 characters.
1194 *
1195 *
1196 *
1197 * DB2 for z/OS and OS/390 servers support up to a length of 32 characters.
1198 *
1199 * SQL_ATTR_INFO_WRKSTNNAME - A pointer to a null-terminated
1200 * character string used to identify the client workstation name sent to the
1201 * host database server when using DB2 Connect.
1202 *
1203 *
1204 * DB2 for z/OS and OS/390 servers support up to a length of 18 characters.
1205 *
1206 *
1207 *
1208 * DB2 for z/OS and OS/390 servers support up to a length of 18 characters.
1209 * @param int $type Passing DB2_AUTOCOMMIT_ON turns
1210 * autocommit on for the specified connection resource.
1211 *
1212 * Passing DB2_AUTOCOMMIT_OFF turns
1213 * autocommit off for the specified connection resource.
1214 * @throws IbmDb2Exception
1215 *
1216 */
1217 function db2_set_option($resource, array $options, int $type): void
1218 {
1219 error_clear_last();
1220 $result = \db2_set_option($resource, $options, $type);
1221 if ($result === false) {
1222 throw IbmDb2Exception::createFromPhpError();
1223 }
1224 }
1225