Informix

 View Only
  • 1.  dbaccess select, tabular output

    Posted Wed June 30, 2021 11:20 PM
    Hello,

    dbaccess presents select query output as a "table", one row per line, if the line is less than 80 chars, and switches to one column per line when greater than 80 chars.  It does this in a linux terminal regardless of the width being well over 80 chars.  This is very frustrating when you want to read your data as a "table".  Does anybody know a way around this behaviour?  Thankyou in advance, Rob.

    For example:

    rake_no fibre fibre_flg ccs ccs_flg harv_dttm

    1 1736 P 1205 L 2021-06-07 14:54:17
    2 1736 I 1205 N 2021-06-07 15:43:01

    Becomes:

    rake_no 1
    fibre 1736
    fibre_flg P
    ccs 1205
    ccs_flg L
    harv_dttm 2021-06-07 14:54:17
    crush_dttm 2021-06-08 11:50:00

    rake_no 2
    fibre 1736
    fibre_flg I
    ccs 1205
    ccs_flg N
    harv_dttm 2021-06-07 15:43:01
    crush_dttm 2021-06-08 11:57:00


    ------------------------------
    Gary McNair
    ------------------------------

    #Informix


  • 2.  RE: dbaccess select, tabular output

    Posted Thu July 01, 2021 01:25 AM
    Hi, Gary.
    You always have some more options.
    Increase the max length columns per line (sorry I cannot remenber the variable name for that, others will help).
    You can also unload or even output to files, depending on your needs (if you want a csv do via unload, if you want just the output, output).
    You can search official manuals on how to execute those, right?

    HTH
    Alexandre Marini






  • 3.  RE: dbaccess select, tabular output

    Posted Thu July 01, 2021 01:37 AM
    You can do this by setting the DBACCESS_COLUMNS environment variable. It is supported from 12.10.xC9 version.
    Example:
    export DBACCESS_COLUMNS=1000

    ------------------------------
    SangGyu Jeong
    Software Engineer
    Infrasoft
    Seoul Korea, Republic of
    ------------------------------



  • 4.  RE: dbaccess select, tabular output

    Posted Thu July 01, 2021 02:48 AM
    The kind of feature that you can know about only if you attend Scott Pickett and Carlton Doe's Informix Roadshow.
    ( or read posts in this community )

    Thank you @Scott Pickett @Carlton Doe for casting the Informix Spell around this planet

    ------------------------------
    [eric] [Vercelletto] []
    [Founder]
    [kandooerp.org]
    [Pont l'Abbé] [France]
    [+33 626 52 50 68]

    Disclaimer: My own opinions are my own opinions and do not reflect on the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves.
    ------------------------------



  • 5.  RE: dbaccess select, tabular output

    Posted Thu July 01, 2021 10:12 AM
    It is nice to know that Carlton and I are thought of so highly by our Informix Community. As stated by other herein, this particular feature had first come up, for me, at the German IUG in Munich 3 years ago and elsewhere since. Over the past 15 years, there have been a lot of miles. To say we appreciate our Informix User Community worldwide is an understatement.
     
    Informix Roadshows have been grounded of late for obvious reasons and with no clear end in sight to this. The situation is very uneven and unpredictable worldwide presently and backsliding unfortunately in some places.
     
    For me, in my 35th year of non-stop Informix work, and in many different roles, it has been an honor to assist and work within this community. Thank you.
     
    Thank you.
     
    Scott Pickett
    IBM Informix WW Technical Sales
    IBM Informix WW Cloud Technical Sales
    IBM Informix WW Cloud Technical Sales ICIAE
    IBM Informix WW Informix Warehouse Accelerator Sales
    Boston, Massachusetts USA
    spickett@us.ibm.com
    617-899-7549
    33 Years Informix User
     
    The current Informix Roadshow presentations are here:
     







  • 6.  RE: dbaccess select, tabular output

    IBM Champion
    Posted Thu July 01, 2021 10:32 AM
    Scott:

    NO! Thank YOU! And thanks to Carlton! You guys rock it year on year!

    Art

    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 7.  RE: dbaccess select, tabular output

    IBM Champion
    Posted Thu July 01, 2021 07:29 AM
    You can also download JL's sqlcmd replacement for dbaccess

    Cheers
    Paul

    Paul Watson
    Oninit LLC
    +1-913-387-7529
    www.oninit.com
    Oninit®️ is a registered trademark of Oninit LLC





  • 8.  RE: dbaccess select, tabular output

    Posted Thu July 01, 2021 08:07 PM
    Thankyou everyone.  The DBACCESS_COLUMNS environment variable is what I need.  SQLCMD looks interesting also.

    ------------------------------
    Gary McNair
    ------------------------------