Re: User input in psql

From: Richard Huxton <dev(at)archonet(dot)com>
To: Ashok(dot)Agrawal(at)Sun(dot)COM
Cc: pgsql-sql(at)postgresql(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Re: User input in psql
Date: 2005-11-03 07:48:45
Message-ID: 4369C0DD.60608@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Axel Rau 2005-11-03 12:54:36 Re: Poor performance in inet << cidr join (Resolved)
Previous Message Ashok Agrawal 2005-11-02 23:40:33 User input in psql