Re: How to display the queries' header on top with IDS2000
Posted in 2000
Topics: Stored Procedures & SPL, Server Administration, Migration, Import/Export & Data Conversion
The easiest way I can think of is by using "output".
output to "filename" WITHOUT HEADING
SELECT * FROM xyz;
Instead of "filename" , you could use any program name to pass the result
of the query. e.g.
output to PIPE more WITHOUT HEADING
SELECT * FROM xyz;
Vivek
______________________________ Reply Separator _________________________________
Subject: Re: How to display the queries' header on top with IDS2000
Author: rferdy (rferdy@americasm01.nt.com) at internet
Date: 8/1/00 3:26 PM
dbaccess's behaviour under IDS2000 is related to two things
1. IDS2000 database (and a lot of other entities) name length limitation
is now 128 bytes (AFAIK) as against 18 bytes under 7.x.
2. Dbaccess's display switches when the return columns exceed 80 chars
in length.
The best best, AFAICS, is to change your design to unload SQL results
and parse that file. e.g
echo "unload to $TMP_FILE select ...."
awk -F "|" $TMP_FILE ....
OR,
modify your code (this could lead to truncations) to
echo 'select name[1,18] from ...'
Rudy
DH wrote:
> For example the output of the command:
>
> echo 'select name from sysdatabases order by name'|dbaccess
> sysmaster 2> /dev/null
>
> in 7.x:
>
> name
>
> sysmaster
> sysutils
>
> in IDS2000:
>
> name sysmaster
>
> name sysutils
>
> Can I setup IDS2000's dbaccess to display the output as in IDS
> 7.x to avoid rewrite the shell scripts which were written for
> 7.x?
It works with this select:
echo 'set isolation to dirty read; output to pipe more without
headings select name from sysdatabases order by name'|
dbaccess sysmaster 2> /dev/null | grep -v "^$"
but not with:
echo 'set isolation to dirty read;
output to pipe more without headings
select sysdatabases.name database, sysdbspaces.name dbspace
from sysdatabases, sysdbspaces
where sysdbspaces.dbsnum = round(sysdatabases.partnum / (
1048576),0)
order by 1' | dbaccess sysmaster 2>/dev/null | grep -v "^$"
will have output as below:
sysmaster
rootdbs
sysutils
rootdbs
PS: I still have to use "grep -v "^$" to remove the blank lines.
Can I remove them with informix?
Thanks again.
DH.
-----------------------------------------------------------
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com