[ADMIN] parametrized query

2004-04-28 Thread Ben Kim
I tried but couldn't find an answer if this is possible in psql. Create a file named test.sql select * from mytable where id = ? (or use $1, $2...) Then in psql do \i test.sql 337 to achieve the same effect select * from mytable where id=337 as I would in perl $sth =

Re: [ADMIN] parametrized query

2004-04-28 Thread Andreas Schmitz
Put it into a shell script like echo select * from mytable where id = $1; | psql $DBNAME That can be executed using the shell function in psql \! [COMMAND] execute command in shell or start interactive shell regards, -Andreas On Wednesday 28 April 2004 17:46, Ben Kim wrote: I tried but