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 > Query Informix table in command line

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-28-05, 15:26
jaygamini jaygamini is offline
Registered User
 
Join Date: Oct 2005
Posts: 2
Query Informix table in command line

I would really appreciate if somebody can help on answering the following two questions…
I have basic knowledge in oracle SQL query. The current Job I’m working requires Informix.
In oracle SQL Plus , the table names can be found by , “select * from tab” . what is the replacement in Informix. I need to do this from the command line . Example after doing “dbaccess <dbName> - -“

Once I dumped the table names , what is the command to describe the attributes. In oracle we do “ desc <table_name> . What is the replacement in Informix.
Thanks a lot
Reply With Quote
  #2 (permalink)  
Old 10-28-05, 16:17
June C. Hunt June C. Hunt is offline
Registered User
 
Join Date: Feb 2005
Posts: 43
After issuing the 'dbaccess' command, enter:

select tabname from systables where tabid >= 100;

In IDS 9.4, for example, tabname is defined as NVARCHAR(128). You might want to narrow down the length of that by using something like:

select tabname[1,32] from systables where tabid >= 100;

Also, tables with a tabid < 100 are reserved.

For more information about this, see the IBM Informix Guide to SQL: Reference. That manual describes the system tables for you. There is also a DB-Access User's Guide. You can find the manuals online at
http://www-306.ibm.com/software/data.../pubs/library/


To get the details of individual tables, you would use the 'dbschema' command. For example:

dbschema -d <database> -t <tablename>


HTH.
Reply With Quote
  #3 (permalink)  
Old 10-28-05, 16:31
artemka artemka is offline
Registered User
 
Join Date: May 2004
Location: New York
Posts: 248
Also if you want to see the data from the command line you can use

dbaccess dbname <<!!
select here
!!

this will dump the data to the screen
Reply With Quote
  #4 (permalink)  
Old 10-30-05, 01:50
jaygamini jaygamini is offline
Registered User
 
Join Date: Oct 2005
Posts: 2
Thanks a lot ...

Thanks a lot ...
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