Unix Technical Forum

ids 9.4 select output format

This is a discussion on ids 9.4 select output format within the Informix forums, part of the Database Server Software category; --> Hi informixer, I issue a SQL command in ids9.4: database sysmaster; select * from sysextents; the output look like ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-20-2008, 12:19 PM
roger@star2000.com.tw
 
Posts: n/a
Default ids 9.4 select output format

Hi informixer,
I issue a SQL command in ids9.4:
database sysmaster;
select * from sysextents;
the output look like :
dbsname rootdbs
tabname TBLSpace
start 1048589
size 50

How can I make the ouput format like ids 7.x :

dbsname tabname start size

rootdbs TBLSpace 1048589 50
rootdbs TBLSpace 1171277 50

roger

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-20-2008, 12:19 PM
Jonathan Leffler
 
Posts: n/a
Default Re: ids 9.4 select output format

roger@star2000.com.tw wrote:
> I issue a SQL command in ids9.4:
> database sysmaster;
> select * from sysextents;
> the output look like :
> dbsname rootdbs
> tabname TBLSpace
> start 1048589
> size 50
>
> How can I make the ouput format like ids 7.x :
>
> dbsname tabname start size
>
> rootdbs TBLSpace 1048589 50
> rootdbs TBLSpace 1171277 50


You can't easily. IDS 9.40 has 32-character user names and
128-character table and database names, so the data doesn't fit across
the page in 9.40 like it did in 7.31.

If you want reliably formatted output, either use a reporting tool like
ACE (part of ISQL) or use a tool like SQLCMD (IIUG Software Archive)
that has always generated across the page formats. You probably want to
use the fixsep format (fixed width fields, separated).

Alternatively, but not reliably, cast the dbsname and tabname values to
CHAR(18) for compatibility with 7.31.

--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-20-2008, 12:19 PM
John Miller
 
Posts: n/a
Default Re: ids 9.4 select output format

I believe this will get something close, but the names maybe truncated.
This is run in version 10 so I combine the chunk and offset into an
int8.

John


select
(trim(dbsname)||'.'||trim(tabname))::char(48),
chunk::int8*4294967295+offset as start, size
from sysextents


roger@star2000.com.tw wrote:
> Hi informixer,
> I issue a SQL command in ids9.4:
> database sysmaster;
> select * from sysextents;
> the output look like :
> dbsname rootdbs
> tabname TBLSpace
> start 1048589
> size 50
>
> How can I make the ouput format like ids 7.x :
>
> dbsname tabname start size
>
> rootdbs TBLSpace 1048589 50
> rootdbs TBLSpace 1171277 50
>
> roger
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-20-2008, 12:19 PM
Bernhard Gramberg
 
Posts: n/a
Default Re: ids 9.4 select output format / use [1,20]

I like to use

SELECT dbsname[1,20], tabname[1,20] ....

this limits output to less than 80 chars.


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 09:15 AM.


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