Catalog() in Win32::ODBC for MySQL



I'm trying to pull the table information from MySQL using the Catalog()
method and it gives me errors...

Here's an example of my code:
-----------------------------------------------------------------------------
use Win32::ODBC;
my($db) = new Win32::ODBC("dsn=mysqldb;uid=user;pwd=pass");

if( $db->Catalog( '', '', '', "'TABLE','SYSTEM TABLE'" ) )
{
my %Data;
print "Available tables:\n";
while( $db->FetchRow( %Data ) )
{
print "\t" . $Data{TABLE_NAME} . "\n";
#print "[";
}
}
$db->Close();
-----------------------------------------------------------------------------

This DSN maps to a database that has just one table in it. When I run
this it gives me an error in ODBC.pm "Use of uninitialized value in
numeric ne (!=) at C:/Perl/site/lib/Win32/ODBC.pm line 291." which I
think is just because it doesn't grab any results from the database.

If I use the db->TableList that works, but I need the schema
information. I don't want to resort to running SQL statements against
the system tables or using any list tables type of statements because
eventually I want to make this portable enough to run on an Oracle
database too so I'm trying to stick to built-in Win32::ODBC methods.

Any ideas anybody?

.



Relevant Pages

  • Catalog() in Win32::ODBC for MySQL
    ... I'm trying to pull the table information from MySQL using the Catalog() ... This DSN maps to a database that has just one table in it. ... I don't want to resort to running SQL statements against ...
    (comp.lang.perl.misc)
  • Re: MySQL Database problem (probably already solved in a message, but this is somewhat urgent)
    ... MySQL server has a database with a table, ... columns, an FSR column, and a password column. ... checked if the supposed arrays that were returned were actually arrays ...
    (comp.lang.php)
  • RE: FreeBSD 5.3 MySQL Performance
    ... versions of Linux and FreeBSD for most tests. ... > popular with the ATA disk drive manufacturers. ... > Many companies have used FreeBSD and MySQL for years and years. ... it is not often that you have such a small database and such a large ...
    (freebsd-questions)
  • Re: Locks & FT Catalogs
    ... Director of Text Mining and Database Strategy ... Looking for a SQL Server replication book? ... in the 6 hours after that either) leaving that catalog completely unusable ... synchronise their changes from staging to live (or vice versa to roll ...
    (microsoft.public.sqlserver.fulltext)
  • ANN: Database Designer for MySQL version 1.6 is released
    ... The new version 1.6 of MicroOLAP Database Designer for MySQL has been ... The secure shell (SSH) tunneling is now implemented in Database ...
    (borland.public.delphi.thirdpartytools.general)