Since DBI supports the SQL/CLI LOB datatypes

 - SQL_CLOB and
 - SQL_BLOB

and DBI supports the temporal datatype

 - SQL_TYPE_TIMESTAMP

and DBD::Oracle has ora_server_version(), we could provide a more
specific type_info_all() (see attached patch).

Should type_info_all() depend on ora_server_version(),
DBD::Oracle::ORA_OCI() or both?


Steffen
*** DBD-Oracle-1.12a/Oracle.pm  Sat Feb 16 20:00:39 2002
--- Oracle.pm   Wed Feb 20 21:06:33 2002
***************
*** 658,677 ****
            SQL_DATETIME_SUB    =>16,
            NUM_PREC_RADIX      =>17,
        };
-       # Based on the values from Oracle 8.0.4 ODBC driver
-       my $varchar2_maxlen = (DBD::Oracle::ORA_OCI()>=8) ? 4000 : 2000;
        my $ti = [
          $names,
            [ 'LONG RAW', -4, '2147483647', '\'', '\'', undef, 1, '0', '0',
              undef, '0', undef, undef, undef, undef, -4, undef, undef
            ],
!           [ 'RAW', -3, 255, '\'', '\'', 'max length', 1, '0', 3,
              undef, '0', undef, undef, undef, undef, -3, undef, undef
            ],
            [ 'LONG', -1, '2147483647', '\'', '\'', undef, 1, 1, '0',
              undef, '0', undef, undef, undef, undef, -1, undef, undef
            ],
!           [ 'CHAR', 1, 255, '\'', '\'', 'max length', 1, 1, 3,
              undef, '0', '0', undef, undef, undef, 1, undef, undef
            ],
            [ 'NUMBER', 3, 38, undef, undef, 'precision,scale', 1, '0', 3,
--- 658,675 ----
            SQL_DATETIME_SUB    =>16,
            NUM_PREC_RADIX      =>17,
        };
        my $ti = [
          $names,
            [ 'LONG RAW', -4, '2147483647', '\'', '\'', undef, 1, '0', '0',
              undef, '0', undef, undef, undef, undef, -4, undef, undef
            ],
!           [ 'RAW', -3, 2000, '\'', '\'', 'max length', 1, '0', 3,
              undef, '0', undef, undef, undef, undef, -3, undef, undef
            ],
            [ 'LONG', -1, '2147483647', '\'', '\'', undef, 1, 1, '0',
              undef, '0', undef, undef, undef, undef, -1, undef, undef
            ],
!           [ 'CHAR', 1, 2000, '\'', '\'', 'max length', 1, 1, 3,
              undef, '0', '0', undef, undef, undef, 1, undef, undef
            ],
            [ 'NUMBER', 3, 38, undef, undef, 'precision,scale', 1, '0', 3,
***************
*** 679,692 ****
            ],
            [ 'DOUBLE', 8, 15, undef, undef, undef, 1, '0', 3,
              '0', '0', '0', undef, undef, undef, 8, undef, 10
-           ],
-           [ 'DATE', 9, 19, '\'', '\'', undef, 1, '0', 3,
-             undef, '0', '0', undef, '0', '0', 11, undef, undef
-           ],
-           [ 'VARCHAR2', 12, $varchar2_maxlen, '\'', '\'', 'max length', 1, 1, 3,
-             undef, '0', '0', undef, undef, undef, 12, undef, undef
            ]
          ];
        return $ti;
      }
  
--- 677,706 ----
            ],
            [ 'DOUBLE', 8, 15, undef, undef, undef, 1, '0', 3,
              '0', '0', '0', undef, undef, undef, 8, undef, 10
            ]
          ];
+       if ( ora_server_version($dbh)->[0] < 8 ) {
+           push @$ti,
+           [ 'VARCHAR2', 12, 2000, '\'', '\'', 'max length', 1, 1, 3,
+             undef, '0', '0', undef, undef, undef, 12, undef, undef
+           ];
+       }
+       else {
+           push @$ti,
+           [ 'VARCHAR2', 12, 4000, '\'', '\'', 'max length', 1, 1, 3,
+             undef, '0', '0', undef, undef, undef, 12, undef, undef
+           ],
+           [ 'BLOB', 30, 2147483647, '\'', '\'', undef, 1, 1, 0,
+             undef, 0, undef, undef, undef, undef, 30, undef, undef
+           ],
+           [ 'CLOB', 40, 2147483647, '\'', '\'', undef, 1, 1, 0,
+             undef, 0, undef, undef, undef, undef, 40, undef, undef
+           ];
+       }
+       push @$ti,
+       [ 'DATE', 93, 19, '\'', '\'', undef, 1, 0, 3,
+         undef, 0, 0, undef, 0, 0, 9, 3, undef
+       ];
        return $ti;
      }
  

Reply via email to