Informix

 View Only
Expand all | Collapse all

DBACCESS_COLUMNS environment variable

  • 1.  DBACCESS_COLUMNS environment variable

    Posted Wed March 25, 2020 12:45 AM
    Hi,
    The DBACCESS_COLUMNS environment variable doesn't seem to be found in the knowledge center.
    Does anyone know what the maximum value is?

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

    #Informix


  • 2.  RE: DBACCESS_COLUMNS environment variable

    Posted Thu March 26, 2020 03:23 AM
    Edited by System Fri January 20, 2023 04:11 PM
      |   view attached
    Hi SangGyu,

    you are right: if you did not attend the Informix Roadshow ( Thanks Scott and Carlton for the great job!), you will never know about this simple but great feature.
    For those who don't know about this new feature, it's an environment variable (export DBACCESS_COLUMNS=1024) for instance, that display the dbaccess output in one line of (1024 screen columns here) maximum, instead of beyond 80 columns or some similar value, where the table columns value is displayed one line per column. I attach a screen dump so that you can see the result.

    The limit seems to be 32768 (smallint) because at 32769 dbaccess returns a core dumped :-(

    Sincerely, the code dumped is not a beautiful thing, but 32K is enough for me

    ------------------------------
    [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.
    ------------------------------

    Attachment(s)



  • 3.  RE: DBACCESS_COLUMNS environment variable

    Posted Thu March 26, 2020 03:40 AM
    Edited by System Fri January 20, 2023 04:24 PM
    Hi Eric,
    Thanks for the example and explanation.
    Before 12.10.xC9, this function was not provided, so I had to use unload, awk, and perl. (Of course I still use the old method)
    In fact, I think setting 1024 is enough to use.

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



  • 4.  RE: DBACCESS_COLUMNS environment variable

    Posted Thu March 26, 2020 03:46 AM

    Unless you have very good eyes, yes, you are right 1024 is a reasonable value ��

     

    About awk and perl, I was a great fan of awk in the 90's, until I discovered Perl for scripting.
    The great advantage of Perl is that it is 99.99% portable on different platforms, including Windows, beyond the fact it is a real language with tons of libraries(modules)

    I rewrote then ALL my utilities ksh/awk based to Perl.

     

    The con of Perl is that sometimes it may be somewhat difficult to read when it comes to elaborate regular expressions, but regexp are  also a great value

     

    My 001 cents of contribution

    Eric Vercelletto
    Data Management Architect and Owner / Begooden IT Consulting
    Board of Directors, International Informix Users group
    IBM Champion 2013,2014,2015,2016,2017,2018,2019,2020
    ibm-champion-rgb-130px

    Tel:     +33(0) 298 51 3210
    Mob : +33(0)626 52 50 68
    skype: begooden-it
    Google Hangout: eric.vercelletto@begooden-it.com
    Email:
    eric.vercelletto@begooden-it.com
    www :
    http://www.vercelletto.com
    www  https://kandooerp.org

    image001.jpg@01CDC3E9.1425CBB0

    image002.jpg@01CDC3E9.1425CBB0

    image003.jpg@01CDC3E9.1425CBB0

     

     






  • 5.  RE: DBACCESS_COLUMNS environment variable

    Posted Thu March 26, 2020 09:12 AM
    Docfix has been requested and forwarded to the appropriate person.
     
    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 Informix Roadshow page is here:

    https://www.ibm.com/developerworks/mydeveloperworks/wikis/home?lang=en_US#/wiki/Informix%20Roadshow%20-%20Informix%20is%20Everywhere

    Shortcut to the Informix Roadshow Page:

    http://bit.ly/ifmx_roadshow

    All presentations and the agenda used by the Roadshow can be found there.
     
    The current ZACS Informix Page can be found here:
     
     
     





  • 6.  RE: DBACCESS_COLUMNS environment variable

    Posted Thu March 26, 2020 09:33 AM
    @Scott Pickett
    that is a good news! ​

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



  • 7.  RE: DBACCESS_COLUMNS environment variable

    IBM Champion
    Posted Thu March 26, 2020 09:34 AM

    The other con for Perl is it not always available at all customers, awk/sed etc always are there

     

    Cheers

    Paul

     






  • 8.  RE: DBACCESS_COLUMNS environment variable

    Posted Thu March 26, 2020 09:50 AM
    @Paul Watson
    Yes. I'd like to use perl or python in the customer's production environment if possible, but most of them are not installed or have different versions. So, I tend to use the utility (awk, sed..etc) installed by default. :)
    Of course, the story would be different on a system that I manage myself! ​​​​​ ​​

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



  • 9.  RE: DBACCESS_COLUMNS environment variable

    IBM Champion
    Posted Thu March 26, 2020 10:03 AM
    Exactly Paul. The only problem is that there are at least five flavors of AWK with different capabilities. Just because I am bored, here is a rundown. Feel free to ignore it:
    • AIX's awk - based on the original BSD code, this is the least capable of the awkers with some features of the awk specification that are broken. In particular the '-v var=value' option is broken. 
    • Solaris's awk - based on the original AT&T System V code, this is a bit better.
    • mawk - a fork from an early GNU awk release. Not sure what it can and cannot do.
    • nawk - a more advanced awker available on nearly both AIX and Solaris. Almost as good as GNU awk, but fewer extensions.
    • GNU awk (gawk on some systems) fully functional to the System V awk specification with many many extensions. However, using the extensions makes your awk scripts less portable. GNU awk is usually installed on AIX and the native awk on Linux. On Solaris you may have to install the GNU package separately.
    Art

    Art S. Kagel, President and Principal Consultant
    ASK Database Management


    Disclaimer: Please keep in mind that 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.








  • 10.  RE: DBACCESS_COLUMNS environment variable

    IBM Champion
    Posted Thu March 26, 2020 10:35 AM

    Multiple versions of sed as well, the solaris one does't support the –i option – very annoying J

     

     






  • 11.  RE: DBACCESS_COLUMNS environment variable

    Posted Thu March 26, 2020 11:43 AM

    @Paul Watson I may have been lucky for the 10 last years, but I NEVER had to face lack of perl on any system.

    The only case I had was windows, where installing Strawberry perl worked great (customer was ok with that)
    I did a bit everything like AIX, Solaris, Linux all flavors and hp-ux

     

    I was about to think as you did, but never had this issue.

    Curious to know on which platform you did nont have perl ?

     

     






  • 12.  RE: DBACCESS_COLUMNS environment variable

    IBM Champion
    Posted Thu March 26, 2020 11:51 AM

    I am not saying it doesn't exist on platforms, just that is not installed and not allowed to be installed.

     

    OAT/InformixHQ are all great (enough), but if you are not allowed to install them then you are back to the "always there" tools, dbaccess and onstat etc

     

     






  • 13.  RE: DBACCESS_COLUMNS environment variable

    Posted Thu March 26, 2020 06:20 AM
    Not answering your question which was answered by Eric but in general usage this gives a good dbaccess experience (if using bash):

    alias dbaccess='DBACCESS_COLUMNS=$COLUMNS rlwrap dbaccess'

    If not using bash but still with Linux/Unix this may also work:

    alias dbaccess='DBACCESS_COLUMNS=`tput cols` rlwrap dbaccess'

    The use of rlwrap is not new but it may be a useful reminder it exists.

    Ben.

    ------------------------------
    Benjamin Thompson
    ------------------------------



  • 14.  RE: DBACCESS_COLUMNS environment variable

    Posted Thu March 26, 2020 09:30 AM
    Edited by System Fri January 20, 2023 04:15 PM
    Hi Ben, Thanks for reply.
    rlwrap is a really useful utility! This utility seems to have been released quite a long time ago, but I saw it for the first time today. (Lazy with new technology?) 😅
    I am used to running the command like echo "select * from customer "| dbaccess stores_demo at the OS prompt and then reusing the old commands with the j, k keys.

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