Re: Prompt for parameter value in psql
| От | Melvin Davidson |
|---|---|
| Тема | Re: Prompt for parameter value in psql |
| Дата | |
| Msg-id | CANu8FizB-1cYE__SRj3+2oHMGVQBpEZ23KHogz4Yk1Eb5RgzHg@mail.gmail.com обсуждение исходный текст |
| Ответ на | Prompt for parameter value in psql (Tiffany Thang <tiffanythang@gmail.com>) |
| Список | pgsql-general |
On Fri, Mar 16, 2018 at 11:12 AM, Tiffany Thang <tiffanythang@gmail.com> wrote:
Thanks.select * from emp where empid=&empidvalue;In oracle, we use the & sign, for example,Hi,Would it be possible to prompt for a user input in psql like in Oracle sqlplus?
https://www.postgresql.org/docs/9.6/static/app-psql.html
\prompt [ text ] name
Prompts the user to supply text, which is assigned to the variable name. An optional prompt string, text, can be specified. (For multiword prompts, surround the text with single quotes.)
By default, \prompt uses the terminal for input and output. However, if the -f command line switch was used, \prompt uses standard input and standard output.
--Melvin Davidson
Maj. Database & Exploration Specialist
Universe Exploration Command – UXC
Employment by invitation only!
В списке pgsql-general по дате отправления: