Please add a csvq option for setting an SQL variable on the command line. This would be particularly useful for SQL queries specified using the --source option. For example, the command
would define SQL variables @a and @b and assign them the values 1 and 2, respectively, and would be equivalent to csvq executing the statement VAR @a := 1, @b := 2; before executing SQL source select-query.sql. SQL source file select-query.sql could then refer to these variables:
SELECT @a AS a, @b AS b;
The earlier csvq example command would be equivalent to the query
Please add a
csvq
option for setting an SQL variable on the command line. This would be particularly useful for SQL queries specified using the--source
option. For example, the commandwould define SQL variables
@a
and@b
and assign them the values 1 and 2, respectively, and would be equivalent tocsvq
executing the statementVAR @a := 1, @b := 2;
before executing SQL sourceselect-query.sql
. SQL source fileselect-query.sql
could then refer to these variables:The earlier
csvq
example command would be equivalent to the query