oracle - Passing argument from psql command invoked from batch or shell to a .sql file postgres -


scenerio

i calling .sql file runtest.sql , seeting variable through -v command

psql.exe -w -f  d:\testfolder1\runtest.sql  -v v1='test' -o d:\testfolder1\test1.txt 

content of runtest.sql

select :v1  \copy ( select 2+3 )to c:\:v1.txt;  

the first command working per expectation v1 printed test

but second command od copy giving error :v1 not defined . want make file run time parameteres passed


Comments

Popular posts from this blog

java - Unable to make sub reports with Jasper -

scala - play framework: Modules were resolved with conflicting cross-version suffixes -

Passing Variables from AngelScript to C++ -