Re: dbaccess
Posted in 2003
U can unload with delimiter "|" and then write and run an awk like this -
awk -F"|" '{printf("%10s %9s %10s ..... ",$1,$2,$3,$4...)}' fil.unl
Rgds
Preetinder
Jean Sagi wrote:
> I consider a better design both. Not only one.
>
> So, Nor The Oracle way Nor The Informix way is the better to me.
>
> To me the best alternative is that the display option could be dinamically configured and some one could be defined as the default.
>
> Chucho!
>
> -----Original Message-----
> From: "malcolm.iiug" <malcolm.iiug@btopenworld.com>
> To: "Mitja Udovc" <mitja.udovc@zrs-tk.si>, <informix-list@iiug.org>
> Date: Fri, 8 Aug 2003 09:17:17 +0100
> Subject: Re: dbaccess
>
> Yes, buy Oracle - that does this as standard. And to be frank it's a mess!
> Let's try to understand why it is a mess on oracle.
>
> Firstly, when you select columns from a table you want to read the required
> information - which means that you convert binary to printable numerics, you
> add spaces between columns, and you convert dates to character strings etc.
> All that is implied by the select * from tablename. So, if the resultant
> output gives ore than 80 characters then you need to wrap to another line.
> And if it exceeds 160 a third line is needed, etc.
> I have seen many tables where the condensed row size is more than 250 bytes
> and some where the condensed row size even exceeds 2K. A 2K row size would
> take in excess of 25 lines to display one record, and that is more than a
> screenful.
> Informix gave this a great deal of thought when planning their system and
> decided that if a user was doing a select statement in SQL then the
> readability of the output was important. They came up with an algorithm
> that says "for each column the resultant column width is the maximum of the
> length of the column-name or the column character width". Add theresultant
> column widths for each column and the number of columns -1 for a single
> space character between each column. If the result is greater than 80 then
> display one column per line else display one row per line.
> You can get the sort of thing you want by UNLOAD TO "file.out" DELIMITER
> " " SELECT * FROM systables
>
> It's not pretty and there are no column headings. Also, trailing spaces are
> removed from character strings, leading characters are removed from
> numerics, etc. So it isn't tabular. But with careful choice of a delimiter
> and piping the output though one of the system utilities on UNIX you can get
> a reasonably tabular output.
>
> Having worked for many years on 3rd generation systems where the standard
> for file display was the Orcale way I found Informix's fourth generation
> approach much easier to work with.
>
> regards
>
> Malcolm Weallans
>
> ----- Original Message -----
> From: "Mitja Udovc" <mitja.udovc@zrs-tk.si>
> To: <informix-list@iiug.org>
> Sent: Thursday, August 07, 2003 8:32 AM
> Subject: 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?
> >
> >
>
> sending to informix-list
>
> Jean Sagi
> jeansagi@myrealbox.com
> jeansagi@netscape.net
>
> sending to informix-list
sending to informix-list