470,614 Members | 1,458 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,614 developers. It's quick & easy.

Urgent: Input of values (that is, dynamic queries)

How can I execute a query which prompt the user for input?
Something like
SELECT [target list]
FROM Table
WHERE Name=[value input from user]

In Oracle PL/SQL, you use & before variable names to have the SQL*Plus
ask for input.
In Postgres PLpg/SQL, I read that the EXECUTE statement should let you
do something like this, but I tried
EXECUTE 'SELECT * FROM Employeers WHERE id=' || quote_literal(emp_id);
and the psql client tells me
ERROR: syntax error at or near "'SELECT * FROM Employeers WHERE id='"
at character 9
LINE 1: EXECUTE 'SELECT *.....
^
Could you help me, please?
Sep 24 '05 #1
0 1293

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by David | last post: by
4 posts views Thread by John | last post: by
14 posts views Thread by Frank Swarbrick | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.