I would be glad if someone could point me in the right direction.I want the user to be prompted for the value in the WHERE (filter) clause, e.g.For example, given the SQL statement below:Hi All,I wanted to find out how to use a substitution variable in an SQL statement that would cause the user to be prompted for a value. Something similar to the ampersand (&&) in ORACLE.
SELECT <col1>,<col2>,<col3>
FROM <table>
WHERE <col5> = 35
SELECT <col1>,<col2>,<col3>
FROM <table>
WHERE <col5> = ?
That would be a client-side feature. The only client supported on this list is psql. psql does not have this capability. It does have the "\prompt" meta-command which will serve in this specific case.
\prompt 'Enter a value for varname' varname
SELECT ... WHERE <col5> = :'varname';
David J.