I want to do something like this:

    \set tmp :acct 'a value'
    \i query.sql

where query.sql looks like this:

select sum(amount), dr_acct from ledger where dr_acct = :acct group by dr_acct; select sum(amount), cr_acct from ledger where cr_acct = :acct group by cr_acct;
    select
       (select sum(amount) from ledger where dr_acct = :acct )
     - (select sum(amount) from ledger where cr_acct = :acct );

However, this is what I get:

    psql:pnc.sql:1: ERROR:  column "a value" does not exist

Is there a different way I should be doing this? (I'm used to Oracle's &1...&n parameters.)

Geoffrey
--
Geoffrey S. Knauth | http://knauth.org/gsk




---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to