my ($sth) = $dbh->column_info(undef,undef,$tablename,'%') or die $dbh->errstr(); while(my $row = $sth->fetchrow_hashref()){ print "Name: ",$row->{COLUMN_NAME},"\tType: ",$row->{TYPE_NAME},"\n"; }
-----Ursprungliche Nachricht----- Von: Umesh Barik [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 30. September 2005 13:36 An: dbi-users@perl.org Betreff: need help to know the column names and data types Hi I am new to DBI programming. I am trying to write a generic package which will handle all the database operations like create table, insert records, delete and also modify records. For a query user need to enter the table name only and the package will get the column names, data types, do the query and return the records. For that I need to know is there any way to get the column names and data types for those columns from the database? Please help me. umesh