pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
User input in psql
2+ messages / 2 participants
[nested] [flat]

* User input in psql
@ 2005-11-02 23:40  Ashok Agrawal <Ashok.Agrawal@Sun.COM>
  0 siblings, 1 reply; 2+ messages in thread

From: Ashok Agrawal @ 2005-11-02 23:40 UTC (permalink / raw)
  To: pgsql-sql; tgl@sss.pgh.pa.us

Hi .

Just wanted to know what is equivalent of "Oracle &" in postgresql.

select count(*) from table1 where id =&1 where sqlplus plus will
prompt to enter value for 1. I would like to do the same in psql.

Thanks
Ashok




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: User input in psql
@ 2005-11-03 07:48  Richard Huxton <dev@archonet.com>
  parent: Ashok Agrawal <Ashok.Agrawal@Sun.COM>
  0 siblings, 0 replies; 2+ messages in thread

From: Richard Huxton @ 2005-11-03 07:48 UTC (permalink / raw)
  To: Ashok.Agrawal@Sun.COM; +Cc: pgsql-sql; tgl@sss.pgh.pa.us

Ashok Agrawal wrote:
> Hi .
> 
> Just wanted to know what is equivalent of "Oracle &" in postgresql.
> 
> select count(*) from table1 where id =&1 where sqlplus plus will
> prompt to enter value for 1. I would like to do the same in psql.

There isn't an equivalent feature, I'm afraid. There are variables you 
can use, but no interactive prompting.
   \set myvar foo
   SELECT count(*) FROM table1 WHERE id = :foo;

-- 
   Richard Huxton
   Archonet Ltd



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2005-11-03 07:48 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-11-02 23:40 User input in psql Ashok Agrawal <Ashok.Agrawal@Sun.COM>
2005-11-03 07:48 ` Richard Huxton <dev@archonet.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox