Re: [SQL] Forming Query
| От | Federico Passaro |
|---|---|
| Тема | Re: [SQL] Forming Query |
| Дата | |
| Msg-id | 35EFAB65.80F7A51B@link.it обсуждение исходный текст |
| Ответ на | Forming Query (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
В списке pgsql-sql по дате отправления: