jsqsh
jsqsh copied to clipboard
Question: Piping SQL Filename to execute
I can call jsqsh like: jsqsh -e SSLDB2CONNECTION -o=out.txt --input-file=./zos-syscat-countTables.sql
Is it possible to "pipe in" the name or SQL-File itself via stdin to avoid text replacing via cmd-line?
Eg. more zos-syscat-countTables.sql | jsqsh -e SSLDB2CONNECTION -o=out.txt
or
find . -name "*.sql" -print0 | xargs -0 jsqsh -e SSLDB2CONNECTION -o=out.txt
or even 'major':
find . -name "*.sql" -print0 | xargs -0 jsqsh -e SSLDB2CONNECTION -o=out -oo=awt -os=out -oi=true where -oo => outputfile options => "append-with-timestamp" -os=>outputfile suffix => ".out" -oi=>include stdin, executed sqls/lines
creating a file:: out_20251209-08:21.out for each sql file piped.