Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Perl and MySql - checking tables for column names

by kschwab (Priest)
on Jan 23, 2017 at 15:16 UTC ( #1180161=note: print w/replies, xml ) Need Help??


in reply to Perl and MySql - checking tables for column names

It wouldn't be portable to databases other than mysql, but you can query directly for table names:

SELECT table_name FROM information_schema.tables;

And, then to get column names for a specific table

SELECT column_name FROM information_schema.columns WHERE table_schema += 'your_database' AND table_name = 'your_table';

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1180161]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2018-07-19 08:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (404 votes). Check out past polls.

    Notices?