pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Ashok.Agrawal@Sun.COM
Cc: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: User input in psql
Date: Thu, 03 Nov 2005 07:48:45 +0000
Message-ID: <4369C0DD.60608@archonet.com> (raw)
In-Reply-To: <43694E71.4080208@Sun.COM>
References: <43694E71.4080208@Sun.COM>

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



view thread (2+ messages)

Message-ID: <4369C0DD.60608@archonet.com>
Permalink:  ../4369C0DD.60608@archonet.com/
Also on:    postgresql.org/message-id/4369C0DD.60608@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dev@archonet.com, Ashok.Agrawal@Sun.COM, tgl@sss.pgh.pa.us
  Subject: Re: User input in psql
  In-Reply-To: <4369C0DD.60608@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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