dbaccess select, tabular output
Posted in 2021
Gary McNair complained that dbaccess switches to one column per line when output exceeds 80 characters, even on wide terminals. SangGyu Jeong answered that setting the DBACCESS_COLUMNS environment variable, for example to 1000, fixes this; it is supported from 12.10.xC9. Alexandre Marini suggested unload or output to file and Paul Watson mentioned the sqlcmd replacement. Gary confirmed the variable solved it.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Topics: Server Administration, Platform-Specific Issues
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
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
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 ------------------------------
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 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. ------------------------------
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
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: https://community.ibm.com/community/user/hybriddatamanagement/viewdocument/informix-1410xc2-features?CommunityKey=cf5a1f39-c21f-4bc4-9ec2-7ca108f0a365&tab=librarydocuments All presentations and the agenda used by the Roadshow can be found there. Website for Internet Of Things https://www.ibm.com/internet-of-things/ Website for Informix https://www.ibm.com/analytics/us/en/technology/informix/
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 ------------------------------
Thankyou everyone. The DBACCESS_COLUMNS environment variable is what I need. SQLCMD looks interesting also. ------------------------------ Gary McNair ------------------------------