CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: DBI:
How to get all tables name from database....

 



dashang.trivedi
Novice

May 30, 2011, 6:33 AM

Post #1 of 5 (8535 views)
How to get all tables name from database.... Can't Post

Hello Every one......

my objective is to fetch all the TABLE NAME from database..i want to fetch the META-DATA of database....
which is the easiest way to do this???
Is their any module is available for that...???


FishMonger
Veteran / Moderator

May 30, 2011, 9:06 AM

Post #2 of 5 (8529 views)
Re: [dashang.trivedi] How to get all tables name from database.... [In reply to] Can't Post

http://search.cpan.org/~timb/DBI-1.616/DBI.pm#tables


miller
User

May 31, 2011, 2:20 PM

Post #3 of 5 (8490 views)
Re: [dashang.trivedi] How to get all tables name from database.... [In reply to] Can't Post

Just use DBI like FishMonger suggested to connect to the database, and to the sql query "SHOW TABLES".

- Miller


dashang.trivedi
Novice

May 31, 2011, 10:46 PM

Post #4 of 5 (8481 views)
Re: [FishMonger] How to get all tables name from database.... [In reply to] Can't Post

hi sir thank you for replying...

I check DBI link already....and i found this way.....
i want for oracle and Postgres database

Code
my @tables = $dbh->tables ( ); 
foreach $table (@tables ){
print "Table Name $table\n";
#print TXT "$table \n";
}



but this is very time consuming process ...u know any other way....????
and one more thing
In Postgres SQL i can search a pattern $dbh->tables ('','','tbl%','' );

In Oracle how this thing is done ???


(This post was edited by dashang.trivedi on May 31, 2011, 10:47 PM)


dashang.trivedi
Novice

May 31, 2011, 10:50 PM

Post #5 of 5 (8479 views)
Re: [miller] How to get all tables name from database.... [In reply to] Can't Post

hi miller thank you for reply me second time and help me.....

Miller SHOW TABLES is only work in MYSQL ...u know for POSTGRES SQL and ORACLE....?????

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives