Skip to content

How to specify table names in the command line and use them inside a .sql script #123

Answered by mithrandie
kpym asked this question in Q&A
Discussion options

You must be logged in to vote

You cannot specify environment variables directly as table names, but you can assemble a string and execute it.

EXECUTE "SELECT * FROM %s" USING @%T;

cf. https://mithrandie.github.io/csvq/reference/built-in.html#execute

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@kpym
Comment options

@mithrandie
Comment options

@kpym
Comment options

Answer selected by kpym
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants