PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 5.4.1
Defender Security – Malware Scanner, Login Security & Firewall v5.4.1
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.4.1, at vendor/thecodingmachine/safe/generated/ibmDb2.php

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