pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Federico Passaro <fede@link.it>
To: Ronnie Doggart <rdoggart@netcomuk.co.uk>
To: PostgreSQL sql <pgsql-sql@postgreSQL.org>
Subject: Re: [SQL] Forming Query
Date: Fri, 04 Sep 1998 10:57:09 +0200
Message-ID: <35EFAB65.80F7A51B@link.it> (raw)
References: <35EE83FD.426DC43F@netcomuk.co.uk>

Ronnie Doggart wrote:

> Hi All,
>
> I want to prompt a user for information in a query. In Oracle the format
> would be
>
> select part_no, description from pricing where part_no like '&1';
>
> what is it using psql and postgresql.
>
> Regards
> Ronnie Doggart

  At the best of my knowledge there is no such a feature in psql, but you
can use a shell script like the following one:

_________________________________________________________________
#!/bin/bash

echo -n "Type Part No: "
read  PART_NO

psql <your database name>  <<EOF

select part_no, description from pricing where part_no like  ${PART_NO};

EOF
_________________________________________________________________


Cheers

federico




view thread (2+ messages)

Message-ID: <35EFAB65.80F7A51B@link.it>
Permalink:  ../35EFAB65.80F7A51B@link.it/
Also on:    postgresql.org/message-id/35EFAB65.80F7A51B@link.it

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: fede@link.it, rdoggart@netcomuk.co.uk
  Subject: Re: [SQL] Forming Query
  In-Reply-To: <35EFAB65.80F7A51B@link.it>
  References: <35EE83FD.426DC43F@netcomuk.co.uk> <35EFAB65.80F7A51B@link.it>

* 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