Unix Technical Forum

dbaccess

This is a discussion on dbaccess within the Informix forums, part of the Database Server Software category; --> When I make SELECT * from systables I get: tabname pcr_users owner informix partnum 1048702 tabid 137 rowsize 377 ...


Go Back   Unix Technical Forum > Database Server Software > Informix

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 06:21 PM
Mitja Udovc
 
Posts: n/a
Default dbaccess

When I make SELECT * from systables I get:

tabname pcr_users
owner informix
partnum 1048702
tabid 137
rowsize 377
ncols 10
nindexes 2
nrows 33
created 03-07-02
version 9043971
tabtype T
locklevel P
npused 3
fextsize 16
nextsize 16
flags 0
site
dbname
type_xid 0
am_id 0

tabname pcr_sled_last
owner informix
partnum 1048706
tabid 139
rowsize 34
ncols 7
nindexes 4
nrows 1765067
created 03-08-05
version 9633794
tabtype T
locklevel R
npused 33304
fextsize 100000
nextsize 100000
flags 0
site
dbname
type_xid 0
am_id 0
..
..
..
..
..


I would like to have data presented in rows like that
tabname owner partnum tabid ....
pcr_sled_last informix ....

When I have instead of * only two fields, then it is OK. Is there any way to
solve this?


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 06:22 PM
Scott Burns
 
Posts: n/a
Default Re: dbaccess

Mitja Udovc wrote:

>When I make SELECT * from systables I get:
>
><SNIP>
>
>
>I would like to have data presented in rows like that
>tabname owner partnum tabid ....
>pcr_sled_last informix ....
>
>When I have instead of * only two fields, then it is OK. Is there any way to
>solve this?
>
>
>
>

It's your screen. isql will try to put them accross the screen but if
it hasn't the room, it will put them top to bottom. You may have luck
with resizing your scrren, although this didn't work for me.

My only real suggestion is...

$ echo "database ...;select * from systables" | isql > out.tmp

.... and then edit the file with a perl script or such to join all the
lines together and split on double newlines.

--
Scott Burns

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-19-2008, 06:22 PM
Paul Watson
 
Posts: n/a
Default Re: dbaccess

Not straightforward, go to www.iiug.org and download SQLcmd by
the Jonathan Leffler

Mitja Udovc wrote:
>
> When I make SELECT * from systables I get:
>
> tabname pcr_users
> owner informix
> partnum 1048702
> tabid 137
> rowsize 377
> ncols 10
> nindexes 2
> nrows 33
> created 03-07-02
> version 9043971
> tabtype T
> locklevel P
> npused 3
> fextsize 16
> nextsize 16
> flags 0
> site
> dbname
> type_xid 0
> am_id 0
>
> tabname pcr_sled_last
> owner informix
> partnum 1048706
> tabid 139
> rowsize 34
> ncols 7
> nindexes 4
> nrows 1765067
> created 03-08-05
> version 9633794
> tabtype T
> locklevel R
> npused 33304
> fextsize 100000
> nextsize 100000
> flags 0
> site
> dbname
> type_xid 0
> am_id 0
> .
> .
> .
> .
> .
>
> I would like to have data presented in rows like that
> tabname owner partnum tabid ....
> pcr_sled_last informix ....
>
> When I have instead of * only two fields, then it is OK. Is there any way to
> solve this?


--
Paul Watson #
Oninit Ltd # Growing old is mandatory
Tel: +44 1436 672201 # Growing up is optional
Fax: +44 1436 678693 #
Mob: +44 7818 003457 #
www.oninit.com #
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-19-2008, 06:22 PM
Art S. Kagel
 
Posts: n/a
Default Re: dbaccess

On Thu, 07 Aug 2003 03:32:25 -0400, Mitja Udovc wrote:

> When I make SELECT * from systables I get:
>
> tabname pcr_users
> owner informix
> partnum 1048702
> tabid 137
> rowsize 377
> ncols 10
> nindexes 2
> nrows 33
> created 03-07-02
> version 9043971
> tabtype T
> locklevel P
> npused 3
> fextsize 16
> nextsize 16
> flags 0
> site
> dbname
> type_xid 0
> am_id 0

<SNIP>
>
> I would like to have data presented in rows like that tabname owner
> partnum tabid .... pcr_sled_last informix
> ....
>
> When I have instead of * only two fields, then it is OK. Is there any
> way to solve this?


Ya, dbaccess will switch to that format if the output is >= 80 columns.
You have two good alternatives. First there are scripts on the IIUG
Software Repository to reformat the output, so you would output to disk
and run the scripts. Another as Paul mentioned is to get Jonathan
Leffler's latest sqlcmd package from the Repository. It can output in
several formats including UNLOAD, CSV, fixed field width, etc. These
formats are all much easier to reformat into whatever format you want.
Options are available to output column names and/or types both of which
are omitted by default.

Art S. Kagel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:25 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com