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 > Database Server Software > Informix > Need query for getting the table information

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-02-05, 13:19
vkagiri vkagiri is offline
Registered User
 
Join Date: Dec 2005
Posts: 2
Arrow Need query for getting the table information

I have a database say "mydb" and i have tables in that with different owners
I want a query which gets me all the information regarding the table.

For example if i give the tablename as emp then i want the output as

empno Integer --
ename char 20
doj date --
desig varchar 30

Please help me out i am in a serious need of it.

Last edited by vkagiri; 12-02-05 at 13:22.
Reply With Quote
  #2 (permalink)  
Old 12-02-05, 15:16
June C. Hunt June C. Hunt is offline
Registered User
 
Join Date: Feb 2005
Posts: 43
From the command line you could use the 'dbschema' command.

$ dbschema -d <database> -t <table>

So, using your examples:

$ dbschema -d mydb -t emp

You can also get information on all tables:

$ dbschema -d mydb -t all

Does this help you?
Reply With Quote
  #3 (permalink)  
Old 12-03-05, 11:14
vkagiri vkagiri is offline
Registered User
 
Join Date: Dec 2005
Posts: 2
my rquirement is to embed this in to a esql code

Hi,
the command u gave me works good when i do from command prompt but
my rquirement is to embed this in to a esql code so that i can populate the result got by this on to a gui.


please help me out.
Reply With Quote
  #4 (permalink)  
Old 12-04-05, 06:56
linux linux is offline
Registered User
 
Join Date: Nov 2003
Location: sweden
Posts: 17
Hi!

whith this sql you can get al linfo about the table or view.
you can run this through dbaccess or you can make a script that take an arg which could be the tabname and run it.

select *
from systables
where tabname = ' table name '

good luck
__________________
Linux
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