ibm_db 0.4.6 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +7 -1
- data/README +46 -43
- data/ext/ibm_db.c +361 -326
- data/lib/active_record/connection_adapters/ibm_db_adapter.rb +208 -77
- data/lib/linux32/ibm_db.so +0 -0
- data/test/associations/eager_test.rb +445 -0
- data/test/associations_test.rb +1839 -0
- data/test/fixtures/db_definitions/luw/ibm_db.drop.sql +1 -0
- data/test/fixtures/db_definitions/luw/ibm_db.sql +6 -0
- data/test/migration_test.rb +104 -65
- metadata +5 -2
data/CHANGES
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
CHANGE LOG
|
2
2
|
==============
|
3
|
+
2007/04/30 (0.6.0):
|
4
|
+
- Support for remote connections to DB2 Universal Database on z/OS version 9
|
5
|
+
- Support for result set pagination via ActiveRecord add_limit_offset! method for DB2 Universal Database on z/OS and i5/OS
|
6
|
+
- Defect fixes
|
7
|
+
- Improved documentation
|
8
|
+
|
3
9
|
2007/04/20 (0.4.6):
|
4
10
|
- Fixed XML columns creation default value (NOT NULL)
|
5
11
|
- Fixed border case for IS NULL in where clauses
|
@@ -30,4 +36,4 @@ CHANGE LOG
|
|
30
36
|
- Fixed compatibility issue with other adapters
|
31
37
|
- If a schema is omitted in database.yml, the username is now used as default schema
|
32
38
|
- Introduced descriptive CLI error messages when a connection or an execute statement fails
|
33
|
-
- Introduced check against schema in method 'indexes'
|
39
|
+
- Introduced check against schema in method 'indexes'
|
data/README
CHANGED
@@ -1,10 +1,17 @@
|
|
1
1
|
=====================================================================
|
2
|
-
README for the IBM_DB Adapter and Driver Release 0.
|
2
|
+
README for the IBM_DB Adapter and Driver Release 0.6.0 (2007/04/30)
|
3
3
|
For ActiveRecord Version 1.15.3 (and Rails 1.2.3)
|
4
4
|
=====================================================================
|
5
5
|
|
6
6
|
Change Log
|
7
7
|
==============
|
8
|
+
|
9
|
+
2007/04/30 (0.6.0):
|
10
|
+
- Support for remote connections to DB2 Universal Database on z/OS version 9
|
11
|
+
- Support for result set pagination via ActiveRecord add_limit_offset! method for DB2 Universal Database on z/OS and i5/OS
|
12
|
+
- Defect fixes
|
13
|
+
- Improved documentation
|
14
|
+
|
8
15
|
2007/04/20 (0.4.6):
|
9
16
|
- Fixed XML columns creation default value (NOT NULL)
|
10
17
|
- Fixed border case for IS NULL in where clauses
|
@@ -49,39 +56,17 @@ Supported Operating Systems
|
|
49
56
|
Supported Databases
|
50
57
|
====================
|
51
58
|
- IBM DB2 Universal Database on Linux/Unix/Windows versions 8 and 9
|
52
|
-
- Remote connections to IBM DB2 Universal Database on i5/OS versions V5R3 and V5R4
|
59
|
+
- Remote connections to IBM DB2 Universal Database on i5/OS versions V5R3 and V5R4. Please ensure that PTFs SI27250 and SI27256 are installed for i5/OS version V5R4 and PTF SI27358 is installed for /OS version V5R3
|
53
60
|
- Remote connections to IBM DB2 Universal Database on z/OS version 8
|
61
|
+
- Remote connections to IBM DB2 Universal Database on z/OS version 9
|
54
62
|
|
55
63
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
$ ./script/plugin source svn://rubyforge.org/var/svn/rubyibm/trunk/IBM_DB_Adapter/ibm_db/
|
61
|
-
$ ./script/plugin list
|
64
|
+
There are two alternatives for installing the IBM_DB adapter and driver:
|
65
|
+
A. Installing as a Ruby gem in the Ruby runtime
|
66
|
+
B. Installing as a Rails plugin in a specific Rails application runtime
|
67
|
+
Note: The IBM_DB driver can also be built separately (from source)
|
62
68
|
|
63
|
-
|
64
|
-
$ ./script/plugin install ibm_db
|
65
|
-
|
66
|
-
TEST
|
67
|
-
Note: Make sure there's no ibm_db in /gems/activerecord-1.15.3/lib/active_record.rb (Line 77)
|
68
|
-
$ ./script/console
|
69
|
-
|
70
|
-
2. Windows platforms:
|
71
|
-
REGISTER REPOSITORY and QUERY (not enabled yet @rubyibm.rubyforge.org)
|
72
|
-
D:\NewApp>ruby script\plugin source http://rubyibm.rubyforge.org/IBM_DB_Adapter/ibm_db/
|
73
|
-
D:\NewApp>ruby script\plugin list
|
74
|
-
|
75
|
-
INSTALL
|
76
|
-
D:\NewApp>ruby script\plugin install ibm_db
|
77
|
-
|
78
|
-
TEST
|
79
|
-
Note: Make sure there's no ibm_db in gems\1.8\gems\activerecord-1.15.3\lib\active_record.rb (Line 77)
|
80
|
-
D:\NewApp>ruby script\console
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
Installing the IBM_DB adapter and driver as a Ruby Gem
|
69
|
+
A. Installing the IBM_DB adapter and driver as a Ruby Gem
|
85
70
|
=======================================================
|
86
71
|
|
87
72
|
1. Windows platforms:
|
@@ -124,6 +109,33 @@ Installing the IBM_DB adapter and driver as a Ruby Gem
|
|
124
109
|
$ ./script/console
|
125
110
|
|
126
111
|
|
112
|
+
B. Installing the IBM_DB adapter and driver as a Rails plugin
|
113
|
+
==========================================================
|
114
|
+
1. Linux and Unix platforms:
|
115
|
+
Register Repository and Query
|
116
|
+
$ ./script/plugin source svn://rubyforge.org/var/svn/rubyibm/trunk/IBM_DB_Adapter/ibm_db/
|
117
|
+
$ ./script/plugin list
|
118
|
+
|
119
|
+
INSTALL
|
120
|
+
$ ./script/plugin install ibm_db
|
121
|
+
|
122
|
+
TEST
|
123
|
+
Note: Make sure there's no ibm_db in /gems/activerecord-1.15.3/lib/active_record.rb (Line 77)
|
124
|
+
$ ./script/console
|
125
|
+
|
126
|
+
2. Windows platforms:
|
127
|
+
REGISTER REPOSITORY and QUERY (not enabled yet @rubyibm.rubyforge.org)
|
128
|
+
D:\NewApp>ruby script\plugin source http://rubyibm.rubyforge.org/IBM_DB_Adapter/ibm_db/
|
129
|
+
D:\NewApp>ruby script\plugin list
|
130
|
+
|
131
|
+
INSTALL
|
132
|
+
D:\NewApp>ruby script\plugin install ibm_db
|
133
|
+
|
134
|
+
TEST
|
135
|
+
Note: Make sure there's no ibm_db in gems\1.8\gems\activerecord-1.15.3\lib\active_record.rb (Line 77)
|
136
|
+
D:\NewApp>ruby script\console
|
137
|
+
|
138
|
+
|
127
139
|
Instructions for building and installing the IBM_DB driver from source
|
128
140
|
=======================================================================
|
129
141
|
|
@@ -176,17 +188,6 @@ Instructions for building and installing the IBM_DB driver from source
|
|
176
188
|
rake
|
177
189
|
|
178
190
|
|
179
|
-
Instructions to manually install IBM_DB Adapter in the ActiveRecord gem
|
180
|
-
=======================================================================
|
181
|
-
|
182
|
-
Installation
|
183
|
-
- copy ibm_db_adapter.rb into \activerecord-1.15.3\lib\active_record\connection_adapters
|
184
|
-
- copy db2-i5-zOS.yaml into \activerecord-1.15.3\lib\active_record\vendor
|
185
|
-
- add the element ibm_db to RAILS_CONNECTION_ADAPTERS in \activerecord-1.15.3\lib\active_record.rb.
|
186
|
-
The array declaration becomes:
|
187
|
-
RAILS_CONNECTION_ADAPTERS = %w( mysql postgresql sqlite firebird sqlserver db2 oracle sybase openbase ibm_db )
|
188
|
-
|
189
|
-
|
190
191
|
Limitations and known problems
|
191
192
|
==============================
|
192
193
|
- ActiveRecord add_limit_offset! method is not supported for DB2 zOS and i5.
|
@@ -210,12 +211,14 @@ Limitations and known problems
|
|
210
211
|
in the COMMON section of your DB2 CLI initialization file (db2cli.ini). Please refer to
|
211
212
|
http://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2.udb.apdv.cli.doc/doc/c0007882.htm
|
212
213
|
for more information.
|
214
|
+
- The behavior of ActiveRecord::Base.find(:first), without an :order attribute, may be unpredictable.
|
215
|
+
The first record, ie. the record with the minimum id may be not be retrieved. In a relational model,
|
216
|
+
the order of the rows returned is unpredictable and independent of the order of insertion.
|
217
|
+
This issue may be addressed in a future release.
|
213
218
|
|
214
219
|
To Do
|
215
220
|
====
|
216
|
-
- Support DB2 zOS version 9
|
217
221
|
- Support Informix Dynamic Server 11.10
|
218
|
-
- Support ActiveRecord add_limit_offset! method for DB2 zOS and i5
|
219
222
|
- Support ActiveRecord rename_column method for DB2 zOS version 9
|
220
223
|
|
221
224
|
|
data/ext/ibm_db.c
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
+----------------------------------------------------------------------+
|
11
11
|
*/
|
12
12
|
|
13
|
-
#define MODULE_RELEASE "0.
|
13
|
+
#define MODULE_RELEASE "0.6.0"
|
14
14
|
|
15
15
|
#ifdef HAVE_CONFIG_H
|
16
16
|
#include "config.h"
|
@@ -507,42 +507,63 @@ void ruby_init_ibm_db()
|
|
507
507
|
memset(ibm_db_globals, 0, sizeof(struct _ibm_db_globals));
|
508
508
|
ruby_ibm_db_init_globals(ibm_db_globals);
|
509
509
|
|
510
|
-
/* Specifies that binary data shall be converted to a hexadecimal encoding and returned as an ASCII string
|
510
|
+
/* Specifies that binary data shall be converted to a hexadecimal encoding and returned as an ASCII string */
|
511
511
|
rb_define_const(mDB, "BINARY", INT2NUM(1));
|
512
|
-
/* Specifies that binary data shall be converted to a hexadecimal encoding and returned as an ASCII string
|
512
|
+
/* Specifies that binary data shall be converted to a hexadecimal encoding and returned as an ASCII string */
|
513
513
|
rb_define_const(mDB, "CONVERT", INT2NUM(2));
|
514
|
-
/* Specifies that binary data shall be converted to a NULL value
|
514
|
+
/* Specifies that binary data shall be converted to a NULL value */
|
515
515
|
rb_define_const(mDB, "PASSTHRU", INT2NUM(3));
|
516
|
-
/* Specifies that the column should be bound directly to a file for input
|
516
|
+
/* Specifies that the column should be bound directly to a file for input */
|
517
517
|
rb_define_const(mDB, "PARAM_FILE", INT2NUM(11));
|
518
|
-
/* Specifies
|
518
|
+
/* Specifies the column names case attribute <b>ATTENTION</b> this number is not currently in CLI but used for ibm_db purpose only */
|
519
519
|
rb_define_const(mDB, "ATTR_CASE", INT2NUM(ATTR_CASE));
|
520
|
-
/* Specifies that column names will be returned in their natural case
|
520
|
+
/* Specifies that column names will be returned in their natural case */
|
521
521
|
rb_define_const(mDB, "CASE_NATURAL", INT2NUM(0));
|
522
|
-
/* Specifies that column names will be returned in lower case
|
522
|
+
/* Specifies that column names will be returned in lower case */
|
523
523
|
rb_define_const(mDB, "CASE_LOWER", INT2NUM(1));
|
524
|
-
/* Specifies that column names will be returned in upper case
|
524
|
+
/* Specifies that column names will be returned in upper case */
|
525
525
|
rb_define_const(mDB, "CASE_UPPER", INT2NUM(2));
|
526
|
-
|
526
|
+
/* Specifies the cursor type */
|
527
527
|
rb_define_const(mDB, "SQL_ATTR_CURSOR_TYPE", INT2NUM(SQL_ATTR_CURSOR_TYPE));
|
528
|
+
/* Cursor type that detects all changes to the result set <b>ATTENTION</b> Only supported when using DB2 for z/OS Version 8.1 and later. */
|
528
529
|
rb_define_const(mDB, "SQL_CURSOR_DYNAMIC", INT2NUM(SQL_CURSOR_DYNAMIC));
|
530
|
+
/* Cursor type that only scrolls forward. This is the default */
|
529
531
|
rb_define_const(mDB, "SQL_CURSOR_FORWARD_ONLY", INT2NUM(SQL_CURSOR_FORWARD_ONLY));
|
532
|
+
/* Cursor type is a pure keyset cursor */
|
530
533
|
rb_define_const(mDB, "SQL_CURSOR_KEYSET_DRIVEN", INT2NUM(SQL_CURSOR_KEYSET_DRIVEN));
|
534
|
+
/* Cursor type that only scrolls forward */
|
531
535
|
rb_define_const(mDB, "SQL_SCROLL_FORWARD_ONLY", INT2NUM(SQL_SCROLL_FORWARD_ONLY));
|
536
|
+
/* Cursor type in which the data in the result set is static */
|
537
|
+
rb_define_const(mDB, "SQL_CURSOR_STATIC", INT2NUM(SQL_CURSOR_STATIC));
|
538
|
+
/* Parmater binding type of input */
|
532
539
|
rb_define_const(mDB, "SQL_PARAM_INPUT", INT2NUM(SQL_PARAM_INPUT));
|
540
|
+
/* Parmater binding type of output */
|
533
541
|
rb_define_const(mDB, "SQL_PARAM_OUTPUT", INT2NUM(SQL_PARAM_OUTPUT));
|
542
|
+
/* Parmater binding type of input/output */
|
534
543
|
rb_define_const(mDB, "SQL_PARAM_INPUT_OUTPUT", INT2NUM(SQL_PARAM_INPUT_OUTPUT));
|
544
|
+
/* Data type used to specify binary data */
|
535
545
|
rb_define_const(mDB, "SQL_BINARY", INT2NUM(SQL_BINARY));
|
546
|
+
/* Data type used to specify bigint data */
|
536
547
|
rb_define_const(mDB, "SQL_BIGINT", INT2NUM(SQL_BIGINT));
|
548
|
+
/* Data type used to specify long data */
|
537
549
|
rb_define_const(mDB, "SQL_LONG", INT2NUM(SQL_INTEGER));
|
550
|
+
/* Data type used to specify double data */
|
538
551
|
rb_define_const(mDB, "SQL_DOUBLE", INT2NUM(SQL_DOUBLE));
|
552
|
+
/* Data type used to specify char data */
|
539
553
|
rb_define_const(mDB, "SQL_CHAR", INT2NUM(SQL_CHAR));
|
554
|
+
/* Operates in auto-commit mode off. The application must manually commit or rollback transactions */
|
540
555
|
rb_define_const(mDB, "SQL_AUTOCOMMIT_OFF", INT2NUM(SQL_AUTOCOMMIT_OFF));
|
556
|
+
/* Operates in auto-commit mode on. This is the default */
|
541
557
|
rb_define_const(mDB, "SQL_AUTOCOMMIT_ON", INT2NUM(SQL_AUTOCOMMIT_ON));
|
558
|
+
/* Specifies whether to use auto-commit or manual commit mode */
|
542
559
|
rb_define_const(mDB, "SQL_ATTR_AUTOCOMMIT", INT2NUM(SQL_ATTR_AUTOCOMMIT));
|
560
|
+
/* String used to identify the client user ID sent to the host database */
|
543
561
|
rb_define_const(mDB, "SQL_ATTR_INFO_USERID", INT2NUM(SQL_ATTR_INFO_USERID));
|
562
|
+
/* String used to identify the client workstation name sent to the host database */
|
544
563
|
rb_define_const(mDB, "SQL_ATTR_INFO_WRKSTNNAME", INT2NUM(SQL_ATTR_INFO_WRKSTNNAME));
|
564
|
+
/* String used to identify the client application name sent to the host database */
|
545
565
|
rb_define_const(mDB, "SQL_ATTR_INFO_APPLNAME", INT2NUM(SQL_ATTR_INFO_APPLNAME));
|
566
|
+
/* String used to identify the client accounting string sent to the host database */
|
546
567
|
rb_define_const(mDB, "SQL_ATTR_INFO_ACCTSTR", INT2NUM(SQL_ATTR_INFO_ACCTSTR));
|
547
568
|
rb_global_variable(&persistent_list);
|
548
569
|
|
@@ -736,11 +757,7 @@ static void _ruby_ibm_db_assign_options( void *handle, int type, long opt_key, V
|
|
736
757
|
#ifdef PASE
|
737
758
|
rc = SQLSetStmtAttr((SQLHSTMT)((stmt_handle *)handle)->hstmt, opt_key, (SQLPOINTER)&option_str, SQL_IS_INTEGER );
|
738
759
|
#else
|
739
|
-
|
740
|
-
rc = SQLSetStmtAttr((SQLHSTMT)((stmt_handle *)handle)->hstmt, opt_key, (SQLPOINTER)option_str, SQL_IS_INTEGER );
|
741
|
-
} else { /* Is i5 */
|
742
|
-
rc = SQLSetStmtAttr((SQLHSTMT)((stmt_handle *)handle)->hstmt, opt_key, (SQLPOINTER)&option_str, SQL_IS_INTEGER );
|
743
|
-
}
|
760
|
+
rc = SQLSetStmtAttr((SQLHSTMT)((stmt_handle *)handle)->hstmt, opt_key, (SQLPOINTER)option_str, SQL_IS_INTEGER );
|
744
761
|
#endif
|
745
762
|
if ( rc == SQL_ERROR ) {
|
746
763
|
_ruby_ibm_db_check_sql_errors((SQLHSTMT)((stmt_handle *)handle)->hstmt, SQL_HANDLE_STMT, rc, 1, NULL, -1, 1);
|
@@ -752,11 +769,7 @@ static void _ruby_ibm_db_assign_options( void *handle, int type, long opt_key, V
|
|
752
769
|
#ifdef PASE
|
753
770
|
rc = SQLSetStmtAttr((SQLHSTMT)((stmt_handle *)handle)->hstmt, opt_key, (SQLPOINTER)&option_num, SQL_IS_INTEGER );
|
754
771
|
#else
|
755
|
-
|
756
|
-
rc = SQLSetStmtAttr((SQLHSTMT)((stmt_handle *)handle)->hstmt, opt_key, (SQLPOINTER)option_num, SQL_IS_INTEGER );
|
757
|
-
} else { /* Is i5 */
|
758
|
-
rc = SQLSetStmtAttr((SQLHSTMT)((stmt_handle *)handle)->hstmt, opt_key, (SQLPOINTER)&option_num, SQL_IS_INTEGER );
|
759
|
-
}
|
772
|
+
rc = SQLSetStmtAttr((SQLHSTMT)((stmt_handle *)handle)->hstmt, opt_key, (SQLPOINTER)option_num, SQL_IS_INTEGER );
|
760
773
|
#endif
|
761
774
|
if ( rc == SQL_ERROR ) {
|
762
775
|
_ruby_ibm_db_check_sql_errors((SQLHSTMT)((stmt_handle *)handle)->hstmt, SQL_HANDLE_STMT, rc, 1, NULL, -1, 1);
|
@@ -768,11 +781,7 @@ static void _ruby_ibm_db_assign_options( void *handle, int type, long opt_key, V
|
|
768
781
|
#ifdef PASE
|
769
782
|
rc = SQLSetConnectAttr((SQLHSTMT)((conn_handle*)handle)->hdbc, opt_key, (SQLPOINTER)&option_str, SQL_NTS);
|
770
783
|
#else
|
771
|
-
|
772
|
-
rc = SQLSetConnectAttr((SQLHSTMT)((conn_handle*)handle)->hdbc, opt_key, (SQLPOINTER)option_str, SQL_NTS);
|
773
|
-
} else { /* Is i5 */
|
774
|
-
rc = SQLSetConnectAttr((SQLHSTMT)((conn_handle*)handle)->hdbc, opt_key, (SQLPOINTER)&option_str, SQL_NTS);
|
775
|
-
}
|
784
|
+
rc = SQLSetConnectAttr((SQLHSTMT)((conn_handle*)handle)->hdbc, opt_key, (SQLPOINTER)option_str, SQL_NTS);
|
776
785
|
#endif
|
777
786
|
if ( rc == SQL_ERROR ) {
|
778
787
|
_ruby_ibm_db_check_sql_errors((SQLHSTMT)((stmt_handle *)handle)->hstmt, SQL_HANDLE_STMT, rc, 1, NULL, -1, 1);
|
@@ -784,11 +793,7 @@ static void _ruby_ibm_db_assign_options( void *handle, int type, long opt_key, V
|
|
784
793
|
#ifdef PASE
|
785
794
|
rc = SQLSetConnectAttr((SQLHSTMT)((conn_handle*)handle)->hdbc, opt_key, (SQLPOINTER)&option_num, SQL_IS_INTEGER);
|
786
795
|
#else
|
787
|
-
|
788
|
-
rc = SQLSetConnectAttr((SQLHSTMT)((conn_handle*)handle)->hdbc, opt_key, (SQLPOINTER)option_num, SQL_IS_INTEGER);
|
789
|
-
} else { /* Is i5 */
|
790
|
-
rc = SQLSetConnectAttr((SQLHSTMT)((conn_handle*)handle)->hdbc, opt_key, (SQLPOINTER)&option_num, SQL_IS_INTEGER);
|
791
|
-
}
|
796
|
+
rc = SQLSetConnectAttr((SQLHSTMT)((conn_handle*)handle)->hdbc, opt_key, (SQLPOINTER)option_num, SQL_IS_INTEGER);
|
792
797
|
#endif
|
793
798
|
if ( rc == SQL_ERROR ) {
|
794
799
|
_ruby_ibm_db_check_sql_errors((SQLHSTMT)((stmt_handle *)handle)->hstmt, SQL_HANDLE_STMT, rc, 1, NULL, -1, 1);
|
@@ -1258,6 +1263,7 @@ static void _ruby_ibm_db_clear_conn_err_cache()
|
|
1258
1263
|
* ===Description
|
1259
1264
|
*
|
1260
1265
|
* resource IBM_DB::connect ( string database, string username, string password [, array options] )
|
1266
|
+
*
|
1261
1267
|
* Creates a new connection to an IBM DB2 Universal Database, IBM Cloudscape, or Apache Derby database.
|
1262
1268
|
* ==Parameters
|
1263
1269
|
*
|
@@ -1318,7 +1324,7 @@ VALUE ibm_db_connect(int argc, VALUE *argv, VALUE self)
|
|
1318
1324
|
* resource IBM_DB::pconnect ( string database, string username, string password [, array options] )
|
1319
1325
|
*
|
1320
1326
|
* Returns a persistent connection to an IBM DB2 Universal Database, IBM Cloudscape,
|
1321
|
-
* or Apache Derby database.
|
1327
|
+
* or Apache Derby database.
|
1322
1328
|
*
|
1323
1329
|
* Calling IBM_DB::close() on a persistent connection always returns TRUE, but the underlying DB2 client
|
1324
1330
|
* connection remains open and waiting to serve the next matching IBM_DB::pconnect() request.
|
@@ -1374,7 +1380,7 @@ VALUE ibm_db_pconnect(int argc, VALUE *argv, VALUE self)
|
|
1374
1380
|
* ===Description
|
1375
1381
|
* mixed IBM_DB::autocommit ( resource connection [, bool value] )
|
1376
1382
|
*
|
1377
|
-
*
|
1383
|
+
* Returns or sets the AUTOCOMMIT behavior of the specified connection resource.
|
1378
1384
|
*
|
1379
1385
|
* ===Parameters
|
1380
1386
|
*
|
@@ -1546,13 +1552,13 @@ static void _ruby_ibm_db_add_param_cache( stmt_handle *stmt_res, int param_no, c
|
|
1546
1552
|
* DB2_CHAR, DB2_DOUBLE, or DB2_LONG .
|
1547
1553
|
*
|
1548
1554
|
* precision
|
1549
|
-
* Specifies the precision
|
1555
|
+
* Specifies the precision that the variable should be bound to the database.
|
1550
1556
|
*
|
1551
1557
|
* scale
|
1552
|
-
* Specifies the scale
|
1558
|
+
* Specifies the scale that the variable should be bound to the database.
|
1553
1559
|
*
|
1554
1560
|
* size
|
1555
|
-
* Specifies the size
|
1561
|
+
* Specifies the size that should be retreived from an INOUT/OUT parameter.
|
1556
1562
|
*
|
1557
1563
|
* ===Return Values
|
1558
1564
|
*
|
@@ -1689,7 +1695,7 @@ VALUE ibm_db_bind_param(int argc, VALUE *argv, VALUE self)
|
|
1689
1695
|
* the corresponding resources to the database server.
|
1690
1696
|
*
|
1691
1697
|
* If you attempt to close a persistent DB2 client connection created with IBM_DB::pconnect(), the close request
|
1692
|
-
*
|
1698
|
+
* returns TRUE and the persistent DB2 client connection remains available for the next caller.
|
1693
1699
|
*
|
1694
1700
|
* ===Parameters
|
1695
1701
|
*
|
@@ -1782,15 +1788,15 @@ VALUE ibm_db_close(int argc, VALUE *argv, VALUE self)
|
|
1782
1788
|
* Returns a statement resource with a result set containing rows describing the column privileges
|
1783
1789
|
* for columns matching the specified parameters. The rows are composed of the following columns:
|
1784
1790
|
*
|
1785
|
-
* Column name
|
1786
|
-
* TABLE_CAT
|
1787
|
-
* TABLE_SCHEM
|
1788
|
-
* TABLE_NAME Name of the table or view.
|
1789
|
-
* COLUMN_NAME
|
1790
|
-
* GRANTOR
|
1791
|
-
* GRANTEE
|
1792
|
-
* PRIVILEGE
|
1793
|
-
* IS_GRANTABLE Whether the GRANTEE is permitted to grant this privilege to other users.
|
1791
|
+
* <b>Column name</b>:: <b>Description</b>
|
1792
|
+
* TABLE_CAT:: Name of the catalog. The value is NULL if this table does not have catalogs.
|
1793
|
+
* TABLE_SCHEM:: Name of the schema.
|
1794
|
+
* TABLE_NAME:: Name of the table or view.
|
1795
|
+
* COLUMN_NAME:: Name of the column.
|
1796
|
+
* GRANTOR:: Authorization ID of the user who granted the privilege.
|
1797
|
+
* GRANTEE:: Authorization ID of the user to whom the privilege was granted.
|
1798
|
+
* PRIVILEGE:: The privilege for the column.
|
1799
|
+
* IS_GRANTABLE:: Whether the GRANTEE is permitted to grant this privilege to other users.
|
1794
1800
|
*/
|
1795
1801
|
VALUE ibm_db_column_privileges(int argc, VALUE *argv, VALUE self)
|
1796
1802
|
{
|
@@ -1876,25 +1882,25 @@ VALUE ibm_db_column_privileges(int argc, VALUE *argv, VALUE self)
|
|
1876
1882
|
* Returns a statement resource with a result set containing rows describing the columns matching the specified parameters.
|
1877
1883
|
* The rows are composed of the following columns:
|
1878
1884
|
*
|
1879
|
-
* Column name
|
1880
|
-
* TABLE_CAT
|
1881
|
-
* TABLE_SCHEM
|
1882
|
-
* TABLE_NAME Name of the table or view.
|
1883
|
-
* COLUMN_NAME
|
1884
|
-
* DATA_TYPE
|
1885
|
-
* TYPE_NAME
|
1886
|
-
* COLUMN_SIZE
|
1887
|
-
* BUFFER_LENGTH
|
1888
|
-
* DECIMAL_DIGITS The scale of the column, or NULL where scale is not applicable.
|
1889
|
-
* NUM_PREC_RADIX An integer value of either 10 (representing an exact numeric data type), 2 (representing an approximate numeric data type), or NULL (representing a data type for which radix is not applicable).
|
1890
|
-
* NULLABLE An integer value representing whether the column is nullable or not.
|
1891
|
-
* REMARKS
|
1892
|
-
* COLUMN_DEF Default value for the column.
|
1893
|
-
* SQL_DATA_TYPE
|
1894
|
-
* SQL_DATETIME_SUB Returns an integer value representing a datetime subtype code, or NULL for SQL data types to which this does not apply.
|
1895
|
-
* CHAR_OCTET_LENGTH Maximum length in octets for a character data type column, which matches COLUMN_SIZE for single-byte character set data, or NULL for non-character data types.
|
1896
|
-
* ORDINAL_POSITION The 1-indexed position of the column in the table.
|
1897
|
-
* IS_NULLABLE
|
1885
|
+
* <b>Column name</b>:: <b>Description</b>
|
1886
|
+
* TABLE_CAT:: Name of the catalog. The value is NULL if this table does not have catalogs.
|
1887
|
+
* TABLE_SCHEM:: Name of the schema.
|
1888
|
+
* TABLE_NAME:: Name of the table or view.
|
1889
|
+
* COLUMN_NAME:: Name of the column.
|
1890
|
+
* DATA_TYPE:: The SQL data type for the column represented as an integer value.
|
1891
|
+
* TYPE_NAME:: A string representing the data type for the column.
|
1892
|
+
* COLUMN_SIZE:: An integer value representing the size of the column.
|
1893
|
+
* BUFFER_LENGTH:: Maximum number of bytes necessary to store data from this column.
|
1894
|
+
* DECIMAL_DIGITS:: The scale of the column, or NULL where scale is not applicable.
|
1895
|
+
* NUM_PREC_RADIX:: An integer value of either 10 (representing an exact numeric data type), 2 (representing an approximate numeric data type), or NULL (representing a data type for which radix is not applicable).
|
1896
|
+
* NULLABLE:: An integer value representing whether the column is nullable or not.
|
1897
|
+
* REMARKS:: Description of the column.
|
1898
|
+
* COLUMN_DEF:: Default value for the column.
|
1899
|
+
* SQL_DATA_TYPE:: An integer value representing the size of the column.
|
1900
|
+
* SQL_DATETIME_SUB:: Returns an integer value representing a datetime subtype code, or NULL for SQL data types to which this does not apply.
|
1901
|
+
* CHAR_OCTET_LENGTH:: Maximum length in octets for a character data type column, which matches COLUMN_SIZE for single-byte character set data, or NULL for non-character data types.
|
1902
|
+
* ORDINAL_POSITION:: The 1-indexed position of the column in the table.
|
1903
|
+
* IS_NULLABLE:: A string value where 'YES' means that the column is nullable and 'NO' means that the column is not nullable.
|
1898
1904
|
*/
|
1899
1905
|
VALUE ibm_db_columns(int argc, VALUE *argv, VALUE self)
|
1900
1906
|
{
|
@@ -1962,11 +1968,11 @@ VALUE ibm_db_columns(int argc, VALUE *argv, VALUE self)
|
|
1962
1968
|
*
|
1963
1969
|
* qualifier
|
1964
1970
|
* A qualifier for DB2 databases running on OS/390 or z/OS servers. For other databases, pass NULL
|
1965
|
-
*
|
1971
|
+
* or an empty string.
|
1966
1972
|
*
|
1967
1973
|
* schema
|
1968
1974
|
* The schema which contains the tables. If schema is NULL, IBM_DB::foreign_keys() matches the schema
|
1969
|
-
*
|
1975
|
+
* for the current connection.
|
1970
1976
|
*
|
1971
1977
|
* table-name
|
1972
1978
|
* The name of the table.
|
@@ -1976,21 +1982,21 @@ VALUE ibm_db_columns(int argc, VALUE *argv, VALUE self)
|
|
1976
1982
|
* Returns a statement resource with a result set containing rows describing the foreign keys for
|
1977
1983
|
* the specified table. The result set is composed of the following columns:
|
1978
1984
|
*
|
1979
|
-
* Column name Description
|
1980
|
-
* PKTABLE_CAT
|
1981
|
-
* PKTABLE_SCHEM
|
1982
|
-
* PKTABLE_NAME Name of the table containing the primary key.
|
1983
|
-
* PKCOLUMN_NAME
|
1984
|
-
* FKTABLE_CAT
|
1985
|
-
* FKTABLE_SCHEM
|
1986
|
-
* FKTABLE_NAME Name of the table containing the foreign key.
|
1987
|
-
* FKCOLUMN_NAME
|
1988
|
-
* KEY_SEQ
|
1989
|
-
* UPDATE_RULE
|
1990
|
-
* DELETE_RULE
|
1991
|
-
* FK_NAME
|
1992
|
-
* PK_NAME
|
1993
|
-
* DEFERRABILITY
|
1985
|
+
* <b>Column name</b>:: <b>Description</b>
|
1986
|
+
* PKTABLE_CAT:: Name of the catalog for the table containing the primary key. The value is NULL if this table does not have catalogs.
|
1987
|
+
* PKTABLE_SCHEM:: Name of the schema for the table containing the primary key.
|
1988
|
+
* PKTABLE_NAME:: Name of the table containing the primary key.
|
1989
|
+
* PKCOLUMN_NAME:: Name of the column containing the primary key.
|
1990
|
+
* FKTABLE_CAT:: Name of the catalog for the table containing the foreign key. The value is NULL if this table does not have catalogs.
|
1991
|
+
* FKTABLE_SCHEM:: Name of the schema for the table containing the foreign key.
|
1992
|
+
* FKTABLE_NAME:: Name of the table containing the foreign key.
|
1993
|
+
* FKCOLUMN_NAME:: Name of the column containing the foreign key.
|
1994
|
+
* KEY_SEQ:: 1-indexed position of the column in the key.
|
1995
|
+
* UPDATE_RULE:: Integer value representing the action applied to the foreign key when the SQL operation is UPDATE.
|
1996
|
+
* DELETE_RULE:: Integer value representing the action applied to the foreign key when the SQL operation is DELETE.
|
1997
|
+
* FK_NAME:: The name of the foreign key.
|
1998
|
+
* PK_NAME:: The name of the primary key.
|
1999
|
+
* DEFERRABILITY:: An integer value representing whether the foreign key deferrability is SQL_INITIALLY_DEFERRED, SQL_INITIALLY_IMMEDIATE, or SQL_NOT_DEFERRABLE.
|
1994
2000
|
*/
|
1995
2001
|
VALUE ibm_db_foreign_keys(int argc, VALUE *argv, VALUE self)
|
1996
2002
|
{
|
@@ -2070,15 +2076,16 @@ VALUE ibm_db_foreign_keys(int argc, VALUE *argv, VALUE self)
|
|
2070
2076
|
*
|
2071
2077
|
* ===Return Values
|
2072
2078
|
*
|
2073
|
-
* Returns a statement resource with a result set containing rows describing the primary keys for the specified table.
|
2079
|
+
* Returns a statement resource with a result set containing rows describing the primary keys for the specified table.
|
2080
|
+
* The result set is composed of the following columns:
|
2074
2081
|
*
|
2075
|
-
* Column name
|
2076
|
-
* TABLE_CAT
|
2077
|
-
* TABLE_SCHEM
|
2078
|
-
* TABLE_NAME Name of the table containing the primary key.
|
2079
|
-
* COLUMN_NAME
|
2080
|
-
* KEY_SEQ
|
2081
|
-
* PK_NAME
|
2082
|
+
* <b>Column name</b>:: <b>Description</b>
|
2083
|
+
* TABLE_CAT:: Name of the catalog for the table containing the primary key. The value is NULL if this table does not have catalogs.
|
2084
|
+
* TABLE_SCHEM:: Name of the schema for the table containing the primary key.
|
2085
|
+
* TABLE_NAME:: Name of the table containing the primary key.
|
2086
|
+
* COLUMN_NAME:: Name of the column containing the primary key.
|
2087
|
+
* KEY_SEQ:: 1-indexed position of the column in the key.
|
2088
|
+
* PK_NAME:: The name of the primary key.
|
2082
2089
|
*/
|
2083
2090
|
VALUE ibm_db_primary_keys(int argc, VALUE *argv, VALUE self)
|
2084
2091
|
{
|
@@ -2164,34 +2171,30 @@ VALUE ibm_db_primary_keys(int argc, VALUE *argv, VALUE self)
|
|
2164
2171
|
* Returns a statement resource with a result set containing rows describing the parameters for the stored procedures
|
2165
2172
|
* matching the specified parameters. The rows are composed of the following columns:
|
2166
2173
|
*
|
2167
|
-
* Column name Description
|
2168
|
-
* PROCEDURE_CAT
|
2169
|
-
* PROCEDURE_SCHEM
|
2170
|
-
* PROCEDURE_NAME Name of the procedure.
|
2171
|
-
* COLUMN_NAME
|
2172
|
-
* COLUMN_TYPE
|
2173
|
-
*
|
2174
|
-
*
|
2175
|
-
*
|
2176
|
-
*
|
2177
|
-
*
|
2178
|
-
*
|
2179
|
-
*
|
2180
|
-
*
|
2181
|
-
*
|
2182
|
-
*
|
2183
|
-
*
|
2184
|
-
*
|
2185
|
-
*
|
2186
|
-
*
|
2187
|
-
*
|
2188
|
-
*
|
2189
|
-
*
|
2190
|
-
*
|
2191
|
-
* SQL_DATETIME_SUB Returns an integer value representing a datetime subtype code, or NULL for SQL data types to which this does not apply.
|
2192
|
-
* CHAR_OCTET_LENGTH Maximum length in octets for a character data type parameter, which matches COLUMN_SIZE for single-byte character set data, or NULL for non-character data types.
|
2193
|
-
* ORDINAL_POSITION The 1-indexed position of the parameter in the CALL statement.
|
2194
|
-
* IS_NULLABLE A string value where 'YES' means that the parameter accepts or returns NULL values and 'NO' means that the parameter does not accept or return NULL values.
|
2174
|
+
* <b>Column name</b>:: <b>Description</b>
|
2175
|
+
* PROCEDURE_CAT:: The catalog that contains the procedure. The value is NULL if this table does not have catalogs.
|
2176
|
+
* PROCEDURE_SCHEM:: Name of the schema that contains the stored procedure.
|
2177
|
+
* PROCEDURE_NAME:: Name of the procedure.
|
2178
|
+
* COLUMN_NAME:: Name of the parameter.
|
2179
|
+
* COLUMN_TYPE:: An integer value representing the type of the parameter:
|
2180
|
+
* Return value:: Parameter type
|
2181
|
+
* 1:: (SQL_PARAM_INPUT) Input (IN) parameter.
|
2182
|
+
* 2:: (SQL_PARAM_INPUT_OUTPUT) Input/output (INOUT) parameter.
|
2183
|
+
* 3:: (SQL_PARAM_OUTPUT) Output (OUT) parameter.
|
2184
|
+
* DATA_TYPE:: The SQL data type for the parameter represented as an integer value.
|
2185
|
+
* TYPE_NAME:: A string representing the data type for the parameter.
|
2186
|
+
* COLUMN_SIZE:: An integer value representing the size of the parameter.
|
2187
|
+
* BUFFER_LENGTH:: Maximum number of bytes necessary to store data for this parameter.
|
2188
|
+
* DECIMAL_DIGITS:: The scale of the parameter, or NULL where scale is not applicable.
|
2189
|
+
* NUM_PREC_RADIX:: An integer value of either 10 (representing an exact numeric data type), 2 (representing anapproximate numeric data type), or NULL (representing a data type for which radix is not applicable).
|
2190
|
+
* NULLABLE:: An integer value representing whether the parameter is nullable or not.
|
2191
|
+
* REMARKS:: Description of the parameter.
|
2192
|
+
* COLUMN_DEF:: Default value for the parameter.
|
2193
|
+
* SQL_DATA_TYPE:: An integer value representing the size of the parameter.
|
2194
|
+
* SQL_DATETIME_SUB:: Returns an integer value representing a datetime subtype code, or NULL for SQL data types to which this does not apply.
|
2195
|
+
* CHAR_OCTET_LENGTH:: Maximum length in octets for a character data type parameter, which matches COLUMN_SIZE for single-byte character set data, or NULL for non-character data types.
|
2196
|
+
* ORDINAL_POSITION:: The 1-indexed position of the parameter in the CALL statement.
|
2197
|
+
* IS_NULLABLE:: A string value where 'YES' means that the parameter accepts or returns NULL values and 'NO' means that the parameter does not accept or return NULL values.
|
2195
2198
|
*/
|
2196
2199
|
VALUE ibm_db_procedure_columns(int argc, VALUE *argv, VALUE self)
|
2197
2200
|
{
|
@@ -2284,15 +2287,15 @@ VALUE ibm_db_procedure_columns(int argc, VALUE *argv, VALUE self)
|
|
2284
2287
|
*
|
2285
2288
|
* Returns a statement resource with a result set containing rows describing the stored procedures matching the specified parameters. The rows are composed of the following columns:
|
2286
2289
|
*
|
2287
|
-
* Column name
|
2288
|
-
* PROCEDURE_CAT
|
2289
|
-
* PROCEDURE_SCHEM
|
2290
|
-
* PROCEDURE_NAME Name of the procedure.
|
2291
|
-
* NUM_INPUT_PARAMS Number of input (IN) parameters for the stored procedure.
|
2292
|
-
* NUM_OUTPUT_PARAMS
|
2293
|
-
* NUM_RESULT_SETS
|
2294
|
-
* REMARKS
|
2295
|
-
* PROCEDURE_TYPE Always returns 1, indicating that the stored procedure does not return a return value.
|
2290
|
+
* <b>Column name</b>:: <b>Description</b>
|
2291
|
+
* PROCEDURE_CAT:: The catalog that contains the procedure. The value is NULL if this table does not have catalogs.
|
2292
|
+
* PROCEDURE_SCHEM:: Name of the schema that contains the stored procedure.
|
2293
|
+
* PROCEDURE_NAME:: Name of the procedure.
|
2294
|
+
* NUM_INPUT_PARAMS:: Number of input (IN) parameters for the stored procedure.
|
2295
|
+
* NUM_OUTPUT_PARAMS:: Number of output (OUT) parameters for the stored procedure.
|
2296
|
+
* NUM_RESULT_SETS:: Number of result sets returned by the stored procedure.
|
2297
|
+
* REMARKS:: Any comments about the stored procedure.
|
2298
|
+
* PROCEDURE_TYPE:: Always returns 1, indicating that the stored procedure does not return a return value.
|
2296
2299
|
*/
|
2297
2300
|
VALUE ibm_db_procedures(int argc, VALUE *argv, VALUE self)
|
2298
2301
|
{
|
@@ -2378,31 +2381,32 @@ VALUE ibm_db_procedures(int argc, VALUE *argv, VALUE self)
|
|
2378
2381
|
* scope
|
2379
2382
|
* Integer value representing the minimum duration for which the unique row identifier is valid. This can be one of the following values:
|
2380
2383
|
*
|
2381
|
-
*
|
2382
|
-
*
|
2383
|
-
*
|
2384
|
-
* 2 SQL_SCOPE_SESSION Row identifier is valid for the duration of the connection.
|
2384
|
+
* 0: Row identifier is valid only while the cursor is positioned on the row. (SQL_SCOPE_CURROW)
|
2385
|
+
* 1: Row identifier is valid for the duration of the transaction. (SQL_SCOPE_TRANSACTION)
|
2386
|
+
* 2: Row identifier is valid for the duration of the connection. (SQL_SCOPE_SESSION)
|
2385
2387
|
*
|
2386
2388
|
* ===Return Values
|
2387
2389
|
*
|
2388
|
-
* Returns a statement resource with a result set containing rows with unique row identifier information for a table.
|
2389
|
-
*
|
2390
|
-
* Column name Description
|
2391
|
-
* SCOPE
|
2392
|
-
*
|
2393
|
-
* Integer value SQL constant Description
|
2394
|
-
* 0 SQL_SCOPE_CURROW Row identifier is valid only while the cursor is positioned on the row.
|
2395
|
-
* 1 SQL_SCOPE_TRANSACTION Row identifier is valid for the duration of the transaction.
|
2396
|
-
* 2 SQL_SCOPE_SESSION Row identifier is valid for the duration of the connection.
|
2390
|
+
* Returns a statement resource with a result set containing rows with unique row identifier information for a table.
|
2391
|
+
* The rows are composed of the following columns:
|
2397
2392
|
*
|
2398
|
-
*
|
2399
|
-
*
|
2400
|
-
*
|
2401
|
-
*
|
2402
|
-
*
|
2403
|
-
*
|
2404
|
-
*
|
2405
|
-
*
|
2393
|
+
* <b>Column name</b>:: <b>Description</b>
|
2394
|
+
* SCOPE:: Integer value representing the minimum duration for which the unique row identifier is valid.
|
2395
|
+
*
|
2396
|
+
* 0: Row identifier is valid only while the cursor is positioned on the row. (SQL_SCOPE_CURROW)
|
2397
|
+
*
|
2398
|
+
* 1: Row identifier is valid for the duration of the transaction. (SQL_SCOPE_TRANSACTION)
|
2399
|
+
*
|
2400
|
+
* 2: Row identifier is valid for the duration of the connection. (SQL_SCOPE_SESSION)
|
2401
|
+
* COLUMN_NAME:: Name of the unique column.
|
2402
|
+
* DATA_TYPE:: SQL data type for the column.
|
2403
|
+
* TYPE_NAME:: Character string representation of the SQL data type for the column.
|
2404
|
+
* COLUMN_SIZE:: An integer value representing the size of the column.
|
2405
|
+
* BUFFER_LENGTH:: Maximum number of bytes necessary to store data from this column.
|
2406
|
+
* DECIMAL_DIGITS:: The scale of the column, or NULL where scale is not applicable.
|
2407
|
+
* NUM_PREC_RADIX:: An integer value of either 10 (representing an exact numeric data type),2 (representing an
|
2408
|
+
* approximate numeric data type), or NULL (representing a data type for which radix is not applicable).
|
2409
|
+
* PSEUDO_COLUMN:: Always returns 1.
|
2406
2410
|
*/
|
2407
2411
|
VALUE ibm_db_special_columns(int argc, VALUE *argv, VALUE self)
|
2408
2412
|
{
|
@@ -2482,7 +2486,8 @@ VALUE ibm_db_special_columns(int argc, VALUE *argv, VALUE self)
|
|
2482
2486
|
* A qualifier for DB2 databases running on OS/390 or z/OS servers. For other databases, pass NULL or an empty string.
|
2483
2487
|
*
|
2484
2488
|
* schema
|
2485
|
-
* The schema that contains the targeted table. If this parameter is NULL, the statistics and indexes are
|
2489
|
+
* The schema that contains the targeted table. If this parameter is NULL, the statistics and indexes are
|
2490
|
+
* returned for the schema of the current user.
|
2486
2491
|
*
|
2487
2492
|
* table_name
|
2488
2493
|
* The name of the table.
|
@@ -2496,47 +2501,44 @@ VALUE ibm_db_special_columns(int argc, VALUE *argv, VALUE self)
|
|
2496
2501
|
*
|
2497
2502
|
* ===Return Values
|
2498
2503
|
*
|
2499
|
-
* Returns a statement resource with a result set containing rows describing the statistics and indexes for the base tables
|
2500
|
-
*
|
2501
|
-
* Column name Description
|
2502
|
-
* TABLE_CAT The catalog that contains the table. The value is NULL if this table does not have catalogs.
|
2503
|
-
* TABLE_SCHEM Name of the schema that contains the table.
|
2504
|
-
* TABLE_NAME Name of the table.
|
2505
|
-
* NON_UNIQUE
|
2506
|
-
*
|
2507
|
-
* An integer value representing whether the index prohibits unique values, or whether the row represents statistics on the table itself:
|
2508
|
-
*
|
2509
|
-
* Return value Parameter type
|
2510
|
-
* 0 (SQL_FALSE) The index allows duplicate values.
|
2511
|
-
* 1 (SQL_TRUE) The index values must be unique.
|
2512
|
-
* NULL This row is statistics information for the table itself.
|
2513
|
-
*
|
2514
|
-
* INDEX_QUALIFIER A string value representing the qualifier that would have to be prepended to INDEX_NAME to fully qualify the index.
|
2515
|
-
* INDEX_NAME A string representing the name of the index.
|
2516
|
-
* TYPE
|
2517
|
-
*
|
2518
|
-
* An integer value representing the type of information contained in this row of the result set:
|
2519
|
-
*
|
2520
|
-
* Return value Parameter type
|
2521
|
-
* 0 (SQL_TABLE_STAT) The row contains statistics about the table itself.
|
2522
|
-
* 1 (SQL_INDEX_CLUSTERED) The row contains information about a clustered index.
|
2523
|
-
* 2 (SQL_INDEX_HASH) The row contains information about a hashed index.
|
2524
|
-
* 3 (SQL_INDEX_OTHER) The row contains information about a type of index that is neither clustered nor hashed.
|
2525
|
-
*
|
2526
|
-
* ORDINAL_POSITION The 1-indexed position of the column in the index. NULL if the row contains statistics information about the table itself.
|
2527
|
-
* COLUMN_NAME The name of the column in the index. NULL if the row contains statistics information about the table itself.
|
2528
|
-
* ASC_OR_DESC A if the column is sorted in ascending order, D if the column is sorted in descending order, NULL if the row contains statistics information about the table itself.
|
2529
|
-
* CARDINALITY
|
2530
|
-
*
|
2531
|
-
* If the row contains information about an index, this column contains an integer value representing the number of unique values in the index.
|
2532
|
-
*
|
2533
|
-
* If the row contains information about the table itself, this column contains an integer value representing the number of rows in the table.
|
2534
|
-
* PAGES
|
2535
|
-
*
|
2536
|
-
* If the row contains information about an index, this column contains an integer value representing the number of pages used to store the index.
|
2504
|
+
* Returns a statement resource with a result set containing rows describing the statistics and indexes for the base tables
|
2505
|
+
* matching the specified parameters. The rows are composed of the following columns:
|
2537
2506
|
*
|
2538
|
-
*
|
2539
|
-
*
|
2507
|
+
* <b>Column name</b>:: <b>Description</b>
|
2508
|
+
* TABLE_CAT:: The catalog that contains the table. The value is NULL if this table does not have catalogs.
|
2509
|
+
* TABLE_SCHEM:: Name of the schema that contains the table.
|
2510
|
+
* TABLE_NAME:: Name of the table.
|
2511
|
+
* NON_UNIQUE:: An integer value representing whether the index prohibits unique values, or whether the row represents
|
2512
|
+
* statistics on the table itself:
|
2513
|
+
*
|
2514
|
+
* Return value:: Parameter type
|
2515
|
+
* 0 (SQL_FALSE):: The index allows duplicate values.
|
2516
|
+
* 1 (SQL_TRUE):: The index values must be unique.
|
2517
|
+
* NULL:: This row is statistics information for the table itself.
|
2518
|
+
*
|
2519
|
+
* INDEX_QUALIFIER:: A string value representing the qualifier that would have to be prepended to INDEX_NAME to fully qualify the index.
|
2520
|
+
* INDEX_NAME:: A string representing the name of the index.
|
2521
|
+
* TYPE:: An integer value representing the type of information contained in this row of the result set:
|
2522
|
+
*
|
2523
|
+
* Return value:: Parameter type
|
2524
|
+
* 0 (SQL_TABLE_STAT):: The row contains statistics about the table itself.
|
2525
|
+
* 1 (SQL_INDEX_CLUSTERED):: The row contains information about a clustered index.
|
2526
|
+
* 2 (SQL_INDEX_HASH):: The row contains information about a hashed index.
|
2527
|
+
* 3 (SQL_INDEX_OTHER):: The row contains information about a type of index that is neither clustered nor hashed.
|
2528
|
+
*
|
2529
|
+
* ORDINAL_POSITION:: The 1-indexed position of the column in the index. NULL if the row contains statistics information about the table itself.
|
2530
|
+
* COLUMN_NAME:: The name of the column in the index. NULL if the row contains statistics information about the table itself.
|
2531
|
+
* ASC_OR_DESC:: A if the column is sorted in ascending order, D if the column is sorted in descending order, NULL
|
2532
|
+
* if the row contains statistics information about the table itself.
|
2533
|
+
* CARDINALITY:: If the row contains information about an index, this column contains an integer value representing the number
|
2534
|
+
* of unique values in the index.
|
2535
|
+
* If the row contains information about the table itself, this column contains an integer value representing the
|
2536
|
+
* number of rows in the table.
|
2537
|
+
* PAGES:: If the row contains information about an index, this column contains an integer value representing the number of pages
|
2538
|
+
* used to store the index.
|
2539
|
+
* If the row contains information about the table itself, this column contains an integer value representing the number
|
2540
|
+
* of pages used to store the table.
|
2541
|
+
* FILTER_CONDITION:: Always returns NULL.
|
2540
2542
|
*/
|
2541
2543
|
VALUE ibm_db_statistics(int argc, VALUE *argv, VALUE self)
|
2542
2544
|
{
|
@@ -2596,8 +2598,7 @@ VALUE ibm_db_statistics(int argc, VALUE *argv, VALUE self)
|
|
2596
2598
|
* IBM_DB::table_privileges -- Returns a result set listing the tables and associated privileges in a database
|
2597
2599
|
*
|
2598
2600
|
* ===Description
|
2599
|
-
* resource IBM_DB::table_privileges ( resource connection [, string qualifier [, string schema
|
2600
|
-
* [, string table_name]]] )
|
2601
|
+
* resource IBM_DB::table_privileges ( resource connection [, string qualifier [, string schema [, string table_name]]] )
|
2601
2602
|
*
|
2602
2603
|
* Returns a result set listing the tables and associated privileges in a database.
|
2603
2604
|
*
|
@@ -2622,16 +2623,15 @@ VALUE ibm_db_statistics(int argc, VALUE *argv, VALUE self)
|
|
2622
2623
|
* Returns a statement resource with a result set containing rows describing the privileges for the
|
2623
2624
|
* tables that match the specified parameters. The rows are composed of the following columns:
|
2624
2625
|
*
|
2625
|
-
* Column name
|
2626
|
-
* TABLE_CAT
|
2627
|
-
* TABLE_SCHEM
|
2628
|
-
* TABLE_NAME Name of the table.
|
2629
|
-
* GRANTOR
|
2630
|
-
* GRANTEE
|
2631
|
-
* PRIVILEGE
|
2632
|
-
*
|
2633
|
-
* IS_GRANTABLE A string value of "YES" or "NO" indicating whether the grantee can grant the privilege
|
2634
|
-
* to other users.
|
2626
|
+
* <b>Column name</b>:: <b>Description</b>
|
2627
|
+
* TABLE_CAT:: The catalog that contains the table. The value is NULL if this table does not have catalogs.
|
2628
|
+
* TABLE_SCHEM:: Name of the schema that contains the table.
|
2629
|
+
* TABLE_NAME:: Name of the table.
|
2630
|
+
* GRANTOR:: Authorization ID of the user who granted the privilege.
|
2631
|
+
* GRANTEE:: Authorization ID of the user to whom the privilege was granted.
|
2632
|
+
* PRIVILEGE:: The privilege that has been granted. This can be one of ALTER, CONTROL, DELETE, INDEX,
|
2633
|
+
* INSERT, REFERENCES, SELECT, or UPDATE.
|
2634
|
+
* IS_GRANTABLE:: A string value of "YES" or "NO" indicating whether the grantee can grant the privilege to other users.
|
2635
2635
|
*/
|
2636
2636
|
VALUE ibm_db_table_privileges(int argc, VALUE *argv, VALUE self)
|
2637
2637
|
{
|
@@ -2719,18 +2719,21 @@ VALUE ibm_db_table_privileges(int argc, VALUE *argv, VALUE self)
|
|
2719
2719
|
* The name of the table. This parameter accepts a search pattern containing _ and % as wildcards.
|
2720
2720
|
*
|
2721
2721
|
* table-type
|
2722
|
-
* A list of comma-delimited table type identifiers. To match all table types, pass NULL or an empty string.
|
2722
|
+
* A list of comma-delimited table type identifiers. To match all table types, pass NULL or an empty string.
|
2723
|
+
* Valid table type identifiers include: ALIAS, HIERARCHY TABLE, INOPERATIVE VIEW, NICKNAME, MATERIALIZED QUERY
|
2724
|
+
* TABLE, SYSTEM TABLE, TABLE, TYPED TABLE, TYPED VIEW, and VIEW.
|
2723
2725
|
*
|
2724
2726
|
* ===Return Values
|
2725
2727
|
*
|
2726
|
-
* Returns a statement resource with a result set containing rows describing the tables that match the specified parameters.
|
2728
|
+
* Returns a statement resource with a result set containing rows describing the tables that match the specified parameters.
|
2729
|
+
* The rows are composed of the following columns:
|
2727
2730
|
*
|
2728
|
-
* Column name
|
2729
|
-
* TABLE_CAT
|
2730
|
-
*
|
2731
|
-
* TABLE_NAME Name of the table.
|
2732
|
-
* TABLE_TYPE Table type identifier for the table.
|
2733
|
-
* REMARKS
|
2731
|
+
* <b>Column name</b>:: <b>Description</b>
|
2732
|
+
* TABLE_CAT:: The catalog that contains the table. The value is NULL if this table does not have catalogs.
|
2733
|
+
* TABLE_SCHEMA:: Name of the schema that contains the table.
|
2734
|
+
* TABLE_NAME:: Name of the table.
|
2735
|
+
* TABLE_TYPE:: Table type identifier for the table.
|
2736
|
+
* REMARKS:: Description of the table.
|
2734
2737
|
*/
|
2735
2738
|
VALUE ibm_db_tables(int argc, VALUE *argv, VALUE self)
|
2736
2739
|
{
|
@@ -2791,7 +2794,8 @@ VALUE ibm_db_tables(int argc, VALUE *argv, VALUE self)
|
|
2791
2794
|
* Commits an in-progress transaction on the specified connection resource and begins a new transaction.
|
2792
2795
|
* Ruby applications normally default to AUTOCOMMIT mode, so IBM_DB::commit() is not necessary unless
|
2793
2796
|
* AUTOCOMMIT has been turned off for the connection resource.
|
2794
|
-
*
|
2797
|
+
*
|
2798
|
+
* <b>Note:</b> If the specified connection resource is a persistent connection, all transactions
|
2795
2799
|
* in progress for all applications using that persistent connection will be committed. For this reason,
|
2796
2800
|
* persistent connections are not recommended for use in applications that require transactions.
|
2797
2801
|
*
|
@@ -4008,7 +4012,8 @@ VALUE ibm_db_num_fields(int argc, VALUE *argv, VALUE self)
|
|
4008
4012
|
* if the number of rows is 0, consider modifying your application to attempt to return the first row
|
4009
4013
|
* with one of IBM_DB::fetch_assoc(), IBM_DB::fetch_both(), IBM_DB::fetch_array(), or IBM_DB::fetch_row(), and branch
|
4010
4014
|
* if the fetch function returns FALSE.
|
4011
|
-
*
|
4015
|
+
*
|
4016
|
+
* <b>Note:</b> If you issue a SELECT statement using a scrollable cursor, IBM_DB::num_rows() returns the
|
4012
4017
|
* number of rows returned by the SELECT statement. However, the overhead associated with scrollable cursors
|
4013
4018
|
* significantly degrades the performance of your application, so if this is the only reason you are
|
4014
4019
|
* considering using scrollable cursors, you should use a forward-only cursor and either
|
@@ -4146,7 +4151,7 @@ VALUE ibm_db_field_name(int argc, VALUE *argv, VALUE self)
|
|
4146
4151
|
*
|
4147
4152
|
* column
|
4148
4153
|
* Specifies the column in the result set. This can either be an integer representing the
|
4149
|
-
*
|
4154
|
+
* 0-indexed position of the column, or a string containing the name of the column.
|
4150
4155
|
*
|
4151
4156
|
* ===Return Values
|
4152
4157
|
*
|
@@ -4254,7 +4259,7 @@ VALUE ibm_db_field_num(int argc, VALUE *argv, VALUE self)
|
|
4254
4259
|
*
|
4255
4260
|
* column
|
4256
4261
|
* Specifies the column in the result set. This can either be an integer representing the
|
4257
|
-
*
|
4262
|
+
* 0-indexed position of the column, or a string containing the name of the column.
|
4258
4263
|
*
|
4259
4264
|
* ===Return Values
|
4260
4265
|
*
|
@@ -4304,7 +4309,7 @@ VALUE ibm_db_field_precision(int argc, VALUE *argv, VALUE self)
|
|
4304
4309
|
*
|
4305
4310
|
* column
|
4306
4311
|
* Specifies the column in the result set. This can either be an integer representing the
|
4307
|
-
*
|
4312
|
+
* 0-indexed position of the column, or a string containing the name of the column.
|
4308
4313
|
*
|
4309
4314
|
* ===Return Values
|
4310
4315
|
*
|
@@ -4353,7 +4358,7 @@ VALUE ibm_db_field_scale(int argc, VALUE *argv, VALUE self)
|
|
4353
4358
|
*
|
4354
4359
|
* column
|
4355
4360
|
* Specifies the column in the result set. This can either be an integer representing the
|
4356
|
-
*
|
4361
|
+
* 0-indexed position of the column, or a string containing the name of the column.
|
4357
4362
|
*
|
4358
4363
|
* ===Return Values
|
4359
4364
|
*
|
@@ -4445,7 +4450,7 @@ VALUE ibm_db_field_type(int argc, VALUE *argv, VALUE self)
|
|
4445
4450
|
*
|
4446
4451
|
* column
|
4447
4452
|
* Specifies the column in the result set. This can either be an integer representing the
|
4448
|
-
*
|
4453
|
+
* 0-indexed position of the column, or a string containing the name of the column.
|
4449
4454
|
*
|
4450
4455
|
* ===Return Values
|
4451
4456
|
*
|
@@ -4528,8 +4533,13 @@ VALUE ibm_db_cursor_type(int argc, VALUE *argv, VALUE self)
|
|
4528
4533
|
* ===Description
|
4529
4534
|
* bool IBM_DB::rollback ( resource connection )
|
4530
4535
|
*
|
4531
|
-
* Rolls back an in-progress transaction on the specified connection resource and begins a new transaction. Ruby
|
4532
|
-
*
|
4536
|
+
* Rolls back an in-progress transaction on the specified connection resource and begins a new transaction. Ruby
|
4537
|
+
* applications normally default to AUTOCOMMIT mode, so IBM_DB::rollback() normally has no effect unless AUTOCOMMIT
|
4538
|
+
* has been turned off for the connection resource.
|
4539
|
+
*
|
4540
|
+
* <b>Note:</b> If the specified connection resource is a persistent connection, all transactions in progress for all
|
4541
|
+
* applications using that persistent connection will be rolled back. For this reason, persistent connections are not
|
4542
|
+
* recommended for use in applications that require transactions.
|
4533
4543
|
*
|
4534
4544
|
* ===Parameters
|
4535
4545
|
*
|
@@ -5346,7 +5356,7 @@ VALUE ibm_db_fetch_row(int argc, VALUE *argv, VALUE self)
|
|
5346
5356
|
* row_number
|
5347
5357
|
*
|
5348
5358
|
* Requests a specific 1-indexed row from the result set. Passing this parameter results in a
|
5349
|
-
*
|
5359
|
+
* Ruby warning if the result set uses a forward-only cursor.
|
5350
5360
|
*
|
5351
5361
|
* ===Return Values
|
5352
5362
|
*
|
@@ -5416,6 +5426,7 @@ VALUE ibm_db_fetch_object(int argc, VALUE *argv, VALUE self)
|
|
5416
5426
|
* ===Description
|
5417
5427
|
*
|
5418
5428
|
* array IBM_DB::fetch_array ( resource stmt [, int row_number] )
|
5429
|
+
*
|
5419
5430
|
* Returns an array, indexed by column position, representing a row in a result set. The columns are 0-indexed.
|
5420
5431
|
*
|
5421
5432
|
* ===Parameters
|
@@ -5424,7 +5435,7 @@ VALUE ibm_db_fetch_object(int argc, VALUE *argv, VALUE self)
|
|
5424
5435
|
* A valid stmt resource containing a result set.
|
5425
5436
|
*
|
5426
5437
|
* row_number
|
5427
|
-
* Requests a specific 1-indexed row from the result set. Passing this parameter results in a
|
5438
|
+
* Requests a specific 1-indexed row from the result set. Passing this parameter results in a
|
5428
5439
|
* Ruby warning if the result set uses a forward-only cursor.
|
5429
5440
|
*
|
5430
5441
|
* ===Return Values
|
@@ -5457,7 +5468,7 @@ VALUE ibm_db_fetch_array(int argc, VALUE *argv, VALUE self)
|
|
5457
5468
|
*
|
5458
5469
|
* row_number
|
5459
5470
|
* Requests a specific 1-indexed row from the result set. Passing this parameter results in a
|
5460
|
-
*
|
5471
|
+
* Ruby warning if the result set uses a forward-only cursor.
|
5461
5472
|
*
|
5462
5473
|
* ===Return Values
|
5463
5474
|
*
|
@@ -5475,22 +5486,20 @@ VALUE ibm_db_fetch_both(int argc, VALUE *argv, VALUE self)
|
|
5475
5486
|
* IBM_DB::set_option -- Sets the specified option in the resource.
|
5476
5487
|
*
|
5477
5488
|
* ===Description
|
5478
|
-
* bool IBM_DB::set_option ( resource
|
5489
|
+
* bool IBM_DB::set_option ( resource resc, array options, int type )
|
5479
5490
|
*
|
5480
|
-
*
|
5481
|
-
* Note that the row returned by IBM_DB::fetch_both() requires more memory than the single-indexed
|
5482
|
-
* arrays returned by IBM_DB::fetch_assoc() or IBM_DB::fetch_array().
|
5491
|
+
* Sets options for a connection or statement resource. You cannot set options for result set resources.
|
5483
5492
|
*
|
5484
5493
|
* ===Parameters
|
5485
5494
|
*
|
5486
|
-
*
|
5487
|
-
* A valid
|
5495
|
+
* resc
|
5496
|
+
* A valid connection or statement resource.
|
5488
5497
|
*
|
5489
5498
|
* options
|
5490
5499
|
* The options to be set
|
5491
5500
|
*
|
5492
5501
|
* type
|
5493
|
-
* A field that specifies the resource type (1 = Connection)
|
5502
|
+
* A field that specifies the resource type (1 = Connection, NON-1 = Statement)
|
5494
5503
|
*
|
5495
5504
|
* ===Return Values
|
5496
5505
|
*
|
@@ -5547,61 +5556,60 @@ VALUE ibm_db_set_option(int argc, VALUE *argv, VALUE self)
|
|
5547
5556
|
* ===Description
|
5548
5557
|
* object IBM_DB::server_info ( resource connection )
|
5549
5558
|
*
|
5550
|
-
* This function returns
|
5551
|
-
*
|
5552
|
-
*
|
5553
|
-
*
|
5554
|
-
*
|
5555
|
-
*
|
5556
|
-
*
|
5557
|
-
*
|
5558
|
-
*
|
5559
|
-
*
|
5560
|
-
*
|
5561
|
-
*
|
5562
|
-
*
|
5563
|
-
*
|
5564
|
-
*
|
5565
|
-
*
|
5566
|
-
*
|
5567
|
-
*
|
5568
|
-
*
|
5569
|
-
*
|
5570
|
-
*
|
5571
|
-
*
|
5572
|
-
*
|
5573
|
-
*
|
5574
|
-
*
|
5575
|
-
*
|
5576
|
-
*
|
5577
|
-
*
|
5578
|
-
* KEYWORDS
|
5579
|
-
* LIKE_ESCAPE_CLAUSE
|
5580
|
-
*
|
5581
|
-
*
|
5582
|
-
*
|
5583
|
-
*
|
5584
|
-
*
|
5585
|
-
*
|
5586
|
-
*
|
5587
|
-
*
|
5588
|
-
*
|
5589
|
-
*
|
5590
|
-
*
|
5591
|
-
*
|
5592
|
-
*
|
5593
|
-
*
|
5594
|
-
*
|
5595
|
-
*
|
5596
|
-
*
|
5597
|
-
*
|
5598
|
-
*
|
5599
|
-
*
|
5600
|
-
*
|
5601
|
-
*
|
5602
|
-
*
|
5603
|
-
*
|
5604
|
-
* Intermediate level SQL-92 compliance.
|
5559
|
+
* This function returns a read-only object with information about the IBM DB2, Cloudscape, or Apache Derby database server.
|
5560
|
+
* The following table lists the database server properties:
|
5561
|
+
*
|
5562
|
+
* ===Table 1. Database server properties
|
5563
|
+
* <b>Property name</b>:: <b>Description (Return type)</b>
|
5564
|
+
* DBMS_NAME:: The name of the database server to which you are connected. For DB2 servers this is a combination
|
5565
|
+
* of DB2 followed by the operating system on which the database server is running. (string)
|
5566
|
+
* DBMS_VER:: The version of the database server, in the form of a string "MM.mm.uuuu" where MM is the major version,
|
5567
|
+
* mm is the minor version, and uuuu is the update. For example, "08.02.0001" represents major version 8,
|
5568
|
+
* minor version 2, update 1. (string)
|
5569
|
+
* DB_CODEPAGE:: The code page of the database to which you are connected. (int)
|
5570
|
+
* DB_NAME:: The name of the database to which you are connected. (string)
|
5571
|
+
* DFT_ISOLATION:: The default transaction isolation level supported by the server: (string)
|
5572
|
+
*
|
5573
|
+
* UR:: Uncommitted read: changes are immediately visible by all concurrent transactions.
|
5574
|
+
*
|
5575
|
+
* CS:: Cursor stability: a row read by one transaction can be altered and committed by a second concurrent transaction.
|
5576
|
+
*
|
5577
|
+
* RS:: Read stability: a transaction can add or remove rows matching a search condition or a pending transaction.
|
5578
|
+
*
|
5579
|
+
* RR:: Repeatable read: data affected by pending transaction is not available to other transactions.
|
5580
|
+
*
|
5581
|
+
* NC:: No commit: any changes are visible at the end of a successful operation. Explicit commits and rollbacks are not allowed.
|
5582
|
+
*
|
5583
|
+
* IDENTIFIER_QUOTE_CHAR:: The character used to delimit an identifier. (string)
|
5584
|
+
* INST_NAME:: The instance on the database server that contains the database. (string)
|
5585
|
+
* ISOLATION_OPTION:: An array of the isolation options supported by the database server. The isolation options are described
|
5586
|
+
* in the DFT_ISOLATION property. (array)
|
5587
|
+
* KEYWORDS:: An array of the keywords reserved by the database server. (array)
|
5588
|
+
* LIKE_ESCAPE_CLAUSE:: TRUE if the database server supports the use of % and _ wildcard characters. FALSE if the database server
|
5589
|
+
* does not support these wildcard characters. (bool)
|
5590
|
+
* MAX_COL_NAME_LEN:: Maximum length of a column name supported by the database server, expressed in bytes. (int)
|
5591
|
+
* MAX_IDENTIFIER_LEN:: Maximum length of an SQL identifier supported by the database server, expressed in characters. (int)
|
5592
|
+
* MAX_INDEX_SIZE:: Maximum size of columns combined in an index supported by the database server, expressed in bytes. (int)
|
5593
|
+
* MAX_PROC_NAME_LEN:: Maximum length of a procedure name supported by the database server, expressed in bytes. (int)
|
5594
|
+
* MAX_ROW_SIZE:: Maximum length of a row in a base table supported by the database server, expressed in bytes. (int)
|
5595
|
+
* MAX_SCHEMA_NAME_LEN:: Maximum length of a schema name supported by the database server, expressed in bytes. (int)
|
5596
|
+
* MAX_STATEMENT_LEN:: Maximum length of an SQL statement supported by the database server, expressed in bytes. (int)
|
5597
|
+
* MAX_TABLE_NAME_LEN:: Maximum length of a table name supported by the database server, expressed in bytes. (bool)
|
5598
|
+
* NON_NULLABLE_COLUMNS:: TRUE if the database server supports columns that can be defined as NOT NULL, FALSE if the database
|
5599
|
+
* server does not support columns defined as NOT NULL. (bool)
|
5600
|
+
* PROCEDURES:: TRUE if the database server supports the use of the CALL statement to call stored procedures, FALSE if the
|
5601
|
+
* database server does not support the CALL statement. (bool)
|
5602
|
+
* SPECIAL_CHARS:: A string containing all of the characters other than a-Z, 0-9, and underscore that can be used in an
|
5603
|
+
* identifier name. (string)
|
5604
|
+
* SQL_CONFORMANCE:: The level of conformance to the ANSI/ISO SQL-92 specification offered by the database server: (string)
|
5605
|
+
*
|
5606
|
+
* ENTRY:: Entry-level SQL-92 compliance.
|
5607
|
+
*
|
5608
|
+
* FIPS127:: FIPS-127-2 transitional compliance.
|
5609
|
+
*
|
5610
|
+
* FULL:: Full level SQL-92 compliance.
|
5611
|
+
*
|
5612
|
+
* INTERMEDIATE:: Intermediate level SQL-92 compliance.
|
5605
5613
|
*
|
5606
5614
|
* ===Parameters
|
5607
5615
|
*
|
@@ -5984,30 +5992,27 @@ VALUE ibm_db_server_info(int argc, VALUE *argv, VALUE self)
|
|
5984
5992
|
* ===Description
|
5985
5993
|
* object IBM_DB::client_info ( resource connection )
|
5986
5994
|
*
|
5987
|
-
* This function returns
|
5995
|
+
* This function returns a read-only object with information about the DB2 database client. The following table lists the DB2 client properties:
|
5988
5996
|
*
|
5989
5997
|
* ====Table 1. DB2 client properties
|
5990
5998
|
*
|
5991
|
-
*
|
5999
|
+
* <b>Property name</b>:: <b>Description (Return type)</b>
|
5992
6000
|
*
|
5993
|
-
* APPL_CODEPAGE
|
5994
|
-
* CONN_CODEPAGE int The code page for the current connection.
|
5995
|
-
* DATA_SOURCE_NAME string The data source name (DSN) used to create the current connection to the database.
|
5996
|
-
* DRIVER_NAME string The name of the library that implements the DB2 Call Level Interface (CLI) specification.
|
5997
|
-
* DRIVER_ODBC_VER string The version of ODBC that the DB2 client supports. This returns a string "MM.mm" where MM is the major version and mm is the minor version. The DB2 client always returns "03.51".
|
5998
|
-
* DRIVER_VER string The version of the client, in the form of a string "MM.mm.uuuu" where MM is the major version, mm is the minor version, and uuuu is the update. For example, "08.02.0001" represents major version 8, minor version 2, update 1.
|
5999
|
-
* ODBC_SQL_CONFORMANCE string The level of ODBC SQL grammar supported by the client:
|
6000
|
-
*
|
6001
|
-
* MINIMUM
|
6002
|
-
* Supports the minimum ODBC SQL grammar.
|
6001
|
+
* APPL_CODEPAGE:: The application code page. (int)
|
6003
6002
|
*
|
6004
|
-
*
|
6005
|
-
*
|
6006
|
-
*
|
6007
|
-
*
|
6008
|
-
*
|
6009
|
-
*
|
6010
|
-
*
|
6003
|
+
* CONN_CODEPAGE:: The code page for the current connection. (int)
|
6004
|
+
*
|
6005
|
+
* DATA_SOURCE_NAME:: The data source name (DSN) used to create the current connection to the database. (string)
|
6006
|
+
*
|
6007
|
+
* DRIVER_NAME:: The name of the library that implements the DB2 Call Level Interface (CLI) specification. (string)
|
6008
|
+
*
|
6009
|
+
* DRIVER_ODBC_VER:: The version of ODBC that the DB2 client supports. This returns a string "MM.mm" where MM is the major version and mm is the minor version. The DB2 client always returns "03.51". (string)
|
6010
|
+
*
|
6011
|
+
* DRIVER_VER:: The version of the client, in the form of a string "MM.mm.uuuu" where MM is the major version, mm is the minor version, and uuuu is the update. For example, "08.02.0001" represents major version 8, minor version 2, update 1. (string)
|
6012
|
+
*
|
6013
|
+
* ODBC_SQL_CONFORMANCE:: There are three levels of ODBC SQL grammar supported by the client: MINIMAL (Supports the minimum ODBC SQL grammar), CORE (Supports the core ODBC SQL grammar), EXTENDED (Supports extended ODBC SQL grammar). (string)
|
6014
|
+
*
|
6015
|
+
* ODBC_VER:: The version of ODBC that the ODBC driver manager supports. This returns a string "MM.mm.rrrr" where MM is the major version, mm is the minor version, and rrrr is the release. The DB2 client always returns "03.01.0000". (string)
|
6011
6016
|
*
|
6012
6017
|
* ===Parameters
|
6013
6018
|
*
|
@@ -6200,59 +6205,89 @@ VALUE ibm_db_active(int argc, VALUE *argv, VALUE self)
|
|
6200
6205
|
/* */
|
6201
6206
|
|
6202
6207
|
/*
|
6203
|
-
* IBM_DB::get_option -- Gets the specified option
|
6208
|
+
* IBM_DB::get_option -- Gets the specified option in the resource.
|
6204
6209
|
*
|
6205
6210
|
* ===Description
|
6206
|
-
*
|
6211
|
+
* mixed IBM_DB::get_option ( resource resc, int options, int type )
|
6207
6212
|
*
|
6208
|
-
* Returns a
|
6213
|
+
* Returns a value, that is the current setting of a connection or statement attribute.
|
6209
6214
|
*
|
6210
6215
|
* ===Parameters
|
6211
6216
|
*
|
6212
|
-
*
|
6213
|
-
* A valid connection resource.
|
6217
|
+
* resc
|
6218
|
+
* A valid connection or statement resource containing a result set.
|
6214
6219
|
*
|
6215
|
-
*
|
6216
|
-
* The
|
6217
|
-
*
|
6218
|
-
*
|
6219
|
-
*
|
6220
|
-
* - applname
|
6221
|
-
* - wrkstnname
|
6220
|
+
* options
|
6221
|
+
* The options to be retrieved
|
6222
|
+
*
|
6223
|
+
* type
|
6224
|
+
* A field that specifies the resource type (1 = Connection, non - 1 = Statement)
|
6222
6225
|
*
|
6223
6226
|
* ===Return Values
|
6224
6227
|
*
|
6225
|
-
* Returns the current setting of the
|
6228
|
+
* Returns the current setting of the resource attribute provided.
|
6226
6229
|
*/
|
6227
6230
|
VALUE ibm_db_get_option(int argc, VALUE *argv, VALUE self)
|
6228
6231
|
{
|
6229
|
-
VALUE
|
6232
|
+
VALUE conn_or_stmt = Qnil;
|
6230
6233
|
VALUE option = Qnil;
|
6234
|
+
VALUE r_type = Qnil;
|
6231
6235
|
SQLCHAR *value = NULL;
|
6232
|
-
|
6236
|
+
SQLINTEGER value_int = 0;
|
6237
|
+
conn_handle *conn_res = NULL;
|
6238
|
+
stmt_handle *stmt_res = NULL;
|
6233
6239
|
SQLCHAR *op_string = NULL;
|
6234
6240
|
SQLINTEGER op_integer = 0;
|
6241
|
+
long type = 0;
|
6235
6242
|
int rc;
|
6236
6243
|
|
6237
|
-
rb_scan_args(argc, argv, "
|
6244
|
+
rb_scan_args(argc, argv, "3", &conn_or_stmt, &option, &r_type);
|
6238
6245
|
|
6239
|
-
if (!NIL_P(
|
6240
|
-
Data_Get_Struct(connection, conn_handle, conn_res);
|
6246
|
+
if (!NIL_P(r_type)) type = NUM2LONG(r_type);
|
6241
6247
|
|
6242
|
-
|
6243
|
-
|
6244
|
-
|
6245
|
-
|
6248
|
+
if (!NIL_P(conn_or_stmt)) {
|
6249
|
+
/* Checking to see if we are getting a connection option (1) or a statement option (non - 1) */
|
6250
|
+
if (type == 1) {
|
6251
|
+
Data_Get_Struct(conn_or_stmt, conn_handle, conn_res);
|
6252
|
+
|
6253
|
+
/* Check to ensure the connection resource given is active */
|
6254
|
+
if (!conn_res->handle_active) {
|
6255
|
+
rb_throw("Connection is not active", Qnil);
|
6256
|
+
}
|
6257
|
+
/* Check that the option given is not null */
|
6258
|
+
if (!NIL_P(option)) {
|
6246
6259
|
op_integer=(SQLINTEGER)FIX2INT(option);
|
6247
6260
|
/* ACCTSTR_LEN is the largest possible length of the options to retrieve */
|
6248
6261
|
value = ALLOC_N(char, ACCTSTR_LEN + 1);
|
6249
6262
|
rc = SQLGetConnectAttr((SQLHDBC)conn_res->hdbc, op_integer, (SQLPOINTER)value, ACCTSTR_LEN, NULL);
|
6250
|
-
if (
|
6263
|
+
if (rc == SQL_ERROR) {
|
6251
6264
|
_ruby_ibm_db_check_sql_errors( conn_res->hdbc, SQL_HANDLE_DBC, rc, 1, NULL, -1, 1);
|
6252
6265
|
}
|
6253
|
-
|
6266
|
+
return rb_str_new2((char *)value);
|
6267
|
+
} else {
|
6268
|
+
rb_throw("Supplied parameter is invalid", Qnil);
|
6269
|
+
}
|
6270
|
+
/* At this point we know we are to retreive a statement option */
|
6254
6271
|
} else {
|
6255
|
-
|
6272
|
+
Data_Get_Struct(conn_or_stmt, stmt_handle, stmt_res);
|
6273
|
+
|
6274
|
+
/* Check that the option given is not null */
|
6275
|
+
if (!NIL_P(option)) {
|
6276
|
+
op_integer=(SQLINTEGER)FIX2INT(option);
|
6277
|
+
/* Checking that the option to get is the cursor type because that is what we support here */
|
6278
|
+
if (op_integer == SQL_ATTR_CURSOR_TYPE) {
|
6279
|
+
rc = SQLGetStmtAttr((SQLHSTMT)stmt_res->hstmt, op_integer, &value_int, SQL_IS_INTEGER, NULL);
|
6280
|
+
if (rc == SQL_ERROR) {
|
6281
|
+
_ruby_ibm_db_check_sql_errors(stmt_res->hstmt, SQL_HANDLE_STMT, rc, 1, NULL, -1, 1);
|
6282
|
+
}
|
6283
|
+
return INT2NUM(value_int);
|
6284
|
+
} else {
|
6285
|
+
rb_throw("Supplied parameter is invalid", Qnil);
|
6286
|
+
}
|
6287
|
+
} else {
|
6288
|
+
rb_throw("Supplied parameter is invalid", Qnil);
|
6289
|
+
}
|
6290
|
+
|
6256
6291
|
}
|
6257
6292
|
}
|
6258
6293
|
}
|