Search Postgresql Archives

psql Windows and variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I need to loop from DOS [sic] on a set of files to get them imported
into a table.

I noticed that psql is wrapped up in a import.bat

I wrote another bat that substantially do

rem import.bat
FOR %%f in (pattern) do "longpathtopsql.bat" --variable csvfile=%%f
-f some.sql


-- some.sql
\copy import.transaction from :csvfile


but I get 
some.sql:3: :csvfile: No such file or directory

I tried -v --set etc...

Same result.

How can I pass variables to a sql script?

thanks

-- 
Ivan Sergio Borgonovo
http://www.webthatworks.it


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux