I have a file named insert_all.sql
which contains the content as below. Here v1 is the parameter to be passed.
do $$
begin
delete from tabledetails where table_name = '$(v1)';
end;
$$;
I am trying to execute the query in that file (insert_all.sql) with the command as given below. But it is not working. What's wrong with my command? If it is wrong, advice me on this.
psql.exe -U postgres -p 5454 -h 127.0.0.1 -d desk -f D:\insert_all.sql -v v1='statusTable'