Search Postgresql Archives

Re: user input during runtime

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ashish Karalkar wrote:
> Hello All,
> I want to prompt user to input some value and do some action on that value in runtime of a sql script.
> Is there any psql command to do this ??
> I can use \echo do display massage 
> but to take input what is the command?
> Thanks in advance

You can do:

	\echo -n 'Enter value: '
	\set x `read && echo $REPLY`

in psql. I think we will have \prompt in 8.3.

-- 
  Bruce Momjian  <bruce@xxxxxxxxxx>          http://momjian.us
  EnterpriseDB                               http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux