Skip to content

Question: Piping SQL Filename to execute #71

@matz3ibm

Description

@matz3ibm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions