Variable interpolation in vertica client
Hi all,
A basic question regarding variable interpolation in the vsql client - how can it be done within strings?
For example:
\set schemaname myschema
select count(*) from :schemaname.foo; -- works
select analyze_statistics(:schemaname'.foo', 10); -- throws error
The intent for the second command is to interpolate schemaname into the string being passed in to analyze_statistics. I've tried various forms of syntax, but without success. Thanks.
0
Comments
This works
Thanks, that does the trick! I must admit I'm not aware of the subtleties of quoting here - is there a reference I should look at?
Ideally I'd like to make this work with shell expansion too, like the below:
Maybe this?