Catalog() in Win32::ODBC for MySQL - Perl
This is a discussion on Catalog() in Win32::ODBC for MySQL - Perl ; 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'" ) )
...
-
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?
-
Re: multipost (was: Catalog() in Win32::ODBC for MySQL)
dmittleider schreef:
> I'm trying to pull
Don't multipost. You could have crossposted, with the followup-to set to
the fittest group, but that is also not the best way to get answers.
Cancel your messages and try again.
--
Affijn, Ruud (September is nigh)
"Gewoon is een tijger."
Similar Threads
-
By Application Development in forum Adobe Photoshop
Replies: 1
Last Post: 08-21-2007, 11:01 AM
-
By Application Development in forum Perl
Replies: 1
Last Post: 12-23-2005, 09:27 AM
-
By Application Development in forum Perl
Replies: 0
Last Post: 10-03-2005, 07:04 AM
-
By Application Development in forum Perl
Replies: 2
Last Post: 09-05-2005, 12:46 PM
-
By Application Development in forum Inetserver
Replies: 1
Last Post: 10-29-2003, 08:41 PM