Issue Details (XML | Word | Printable)

Key: CORE-6099
Type: New Feature New Feature
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Ray Holme
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Firebird Core

It would be super if isql had a "-Q" switch for ultra-quiet

Created: 13/Jul/19 12:44 PM   Updated: 14/Jul/19 12:42 PM
Component/s: ISQL
Affects Version/s: 4.0 Beta 1
Fix Version/s: None

Environment: any all - usage in derived files

QA Status: No test


 Description  « Hide
If "-Q" would turn off all blank lines and all headers (names plus the "====" underline lines), it would be super useful for plain files
 being used by other routines where SQL access is kind of hard (e.g. bash scripts, but any program could use these fixed size files).

For me to use SQL output now, I use "-q" and an egrep statement like '^$|=====|COUNT" (if I have a count in the output, else some other field name).
This is somewhat flawed as the latter two conditions could actually occur in data.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Pavel Zotov added a comment - 13/Jul/19 01:44 PM
If you create trivial script:
C:\FB\30SS>echo set heading off;select count(*) from rdb$database; > c:\temp\tmp4isql.tmp

... and run ISQL like this:
C:\FB\30SS>C:\FB\30SS\isql /:e30 -i c:\temp\tmp4isql.tmp

-- then outbut will contain two empty lines and result of count(*), but WITHOUT header and "========":

                    1

PS.
Unfortunately, for some backward compatibility reasons one can not do almost the same but using PIPE (without creating script):

C:\FB\30SS>echo set heading off;select count(*) from rdb$database; | C:\FB\30SS\isql /:e30 -q
Database: /:e30, User: SYSDBA
SQL>
                    1

SQL>

Garbage lines with "SQL>" prompt appear always :(

Ray Holme added a comment - 14/Jul/19 11:51 AM
Nice Pavel. Thank you.

So to summarize and get SUPER quiet -
   a) use "isql -q"
   b) embed the following command before doing anything else
      "set heading off;"

I assume one does not need to specify "-page 999999999" as ALL heading are gone
 and even voluminous output will not get a page heading.

VERY NICE. Thanks again. Close this one and suggest that it go in the FB book.

Ray Holme added a comment - 14/Jul/19 12:42 PM
Just a note in passing, I do NOT get "SQL>" in my output streams.

I suspect that is because isql knows my input is not from a human typing, but from an input stream
I think that is a feature - at least it is in Linux and I like it a lot (don't change that :=]]] )


[rainbow]$ echo 'set heading off;select count(*) from rdb$database;' | isql $DB

           1