If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Perl and the DBI > How to get all tables name from database....

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-30-11, 09:35
dashang.trivedi dashang.trivedi is offline
Registered User
 
Join Date: May 2011
Posts: 5
How to get all tables name from database....

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...???
Reply With Quote
  #2 (permalink)  
Old 05-30-11, 12:22
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,263
depednms on the database
most modern db's store the metadata within the db itself, however you may not have access to that data.

it may help if you provide the name of the db you are using as each db handles it it its own way
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 05-31-11, 01:37
dashang.trivedi dashang.trivedi is offline
Registered User
 
Join Date: May 2011
Posts: 5
If i want to get table name of POSTGRES and ORACLE database....any idea???
Reply With Quote
  #4 (permalink)  
Old 05-31-11, 03:33
dashang.trivedi dashang.trivedi is offline
Registered User
 
Join Date: May 2011
Posts: 5
i have one idea ..but its time consuming........


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

but its very time consuming.....

for example in POSTGRES data base their is one table call pg_class that store all the table name in relname field......but for oracle i dont know......
is their any module in perl which get all table name list......?????

Last edited by dashang.trivedi; 05-31-11 at 04:30.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On