pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedForming Query
2+ messages / 2 participants
[nested] [flat]
* Forming Query
@ 1998-09-03 11:56 Ronnie Doggart <rdoggart@netcomuk.co.uk>
0 siblings, 1 reply; 2+ messages in thread
From: Ronnie Doggart @ 1998-09-03 11:56 UTC (permalink / raw)
To: pgsql-sql
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
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [SQL] Forming Query
@ 1998-09-04 08:57 Federico Passaro <fede@link.it>
parent: Ronnie Doggart <rdoggart@netcomuk.co.uk>
0 siblings, 0 replies; 2+ messages in thread
From: Federico Passaro @ 1998-09-04 08:57 UTC (permalink / raw)
To: Ronnie Doggart <rdoggart@netcomuk.co.uk>; pgsql-sql
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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~1998-09-04 08:57 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-09-03 11:56 Forming Query Ronnie Doggart <rdoggart@netcomuk.co.uk>
1998-09-04 08:57 ` Federico Passaro <fede@link.it>
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