Tim Bunce wrote:
> On Fri, Jan 09, 2004 at 10:49:35PM -0000, Andy Hassall wrote:
>> Tim Bunce wrote:
>>> I'd be very grateful if someone could send me the output of:
>>>
>>> perl -MDBI::DBD::Metadata -e write_typeinfo_pm dbi:ODBC:dsnname
>>> user pass Oracle
>>>
>>> Where dsnname is an ODBC DSN that uses a recent (9.2 or at least
>>> 9.1) Oracle ODBC driver to talk to a similarly recent Oracle
>>> database
>>> server.
>>
>> I might be missing something here, but DBI::DBD::Metadata from DBI
>> 1.40 doesn't appear to have a write_typeinfo_pm sub. It's got
>> write_typeinfo though (line 308).
>>
>> $ perl -MDBI::DBD::Metadata -e write_typeinfo_pm dbi:ODBC:web test
>> test Oracle
>>
>> Undefined subroutine &DBI::DBD::Metadata::write_typeinfo_pm called
>> at -e line 1.
>>
>> write_typeinfo works, but the parameters are in a different order,
>> which had me confused for a bit!
>
> Uh. Bugs in the DBI::DBD docs. Patches welcome :)
Is it really a doc bug? Metadata has write_typeinfo_pm in @EXPORT but never
defines it, and write_typeinfo is inconsistent with write_getinfo_pm.
The following sorts that out:
--- Metadata.pm.orig 2004-01-10 00:04:46.598710400 +0000
+++ Metadata.pm 2004-01-10 00:12:03.486924800 +0000
@@ -245,7 +245,7 @@
}
Please replace Driver (or "<foo>") with the name of your driver.
-Note that this stub function is generated for you by the write_typeinfo
+Note that this stub function is generated for you by the write_typeinfo_pm
function, but you must manually transfer the code to Driver.pm.
=cut
@@ -305,9 +305,9 @@
return $val;
}
-sub write_typeinfo
+sub write_typeinfo_pm
{
- my ($driver, $dsn, $user, $pass) = @_ ? @_ : @ARGV;
+ my ($dsn, $user, $pass, $driver) = @_ ? @_ : @ARGV;
my $dbh = DBI->connect($dsn, $user, $pass, {AutoCommit=>1,
RaiseError=>1});
$driver = "<foo>" unless defined $driver;
@@ -316,7 +316,7 @@
# Transfer this to ${driver}.pm
# The type_info_all function was automatically generated by
-# DBI::DBD::Metadata::write_typeinfo v$DBI::DBD::Metadata::VERSION.
+# DBI::DBD::Metadata::write_typeinfo_pm v$DBI::DBD::Metadata::VERSION.
package DBD::${driver}::db; # This line can be removed once
transferred.
@@ -331,7 +331,7 @@
# Don't forget to add version and intellectual property control
information.
# The \%type_info_all hash was automatically generated by
-# DBI::DBD::Metadata::write_typeinfo v$DBI::DBD::Metadata::VERSION.
+# DBI::DBD::Metadata::write_typeinfo_pm v$DBI::DBD::Metadata::VERSION.
package DBD::${driver}::TypeInfo;
>> Output attached, command used was:
>>
>> $ perl -MDBI::DBD::Metadata -e "DBI::DBD::Metadata::write_typeinfo
>> 'Oracle','dbi:ODBC:web','test','test'" > TypeInfo.pm
>>
>> $ perl -MDBI -e 'DBI->installed_versions'
>> Perl : 5.008001 (MSWin32-x86-multi-thread)
>> OS : MSWin32 (4.0)
>> DBI : 1.40
>> DBD::Oracle : 1.14
>> DBD::ODBC : 1.06
>
>> Forgot to mention - Oracle client & server both 9.2.0.4.
>
> Darn it! Where are the various TIMESTAMP and INTERVAL types I was
> expecting to find? Is the ODBC driver manager recent (v3 ODBC specs?)
Hm, where should I be looking for this? My knowledge of ODBC is fairly
limited. I've updated MDAC to 2.8, the latest version on microsoft.com; I
believe that updates the driver manager? (from what it says on google
searches).
--
Andy Hassall <[EMAIL PROTECTED]> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>