By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,953 Members | 1,143 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,953 IT Pros & Developers. It's quick & easy.

How to use execute statement? Getting error: syntax error at or near "USING"

P: 61
I use the EXECUTE statement in a procedure which has 2 parameters, one is to hold the query, and the other for the value used in the query
Expand|Select|Wrap|Line Numbers
  1. create or replace function delete_from_table1(character varying , integer ) 
  2. RETURNS void as '
  3. DECLARE
  4. query ALIAS FOR $1;
  5. id  ALIAS FOR $2;
  6.  
  7. BEGIN
  8. EXECUTE query 
  9. USING id ;
  10.  
  11. END;'
  12.  
  13. language 'plpgsql';
  14.  
but I have an error:
ERROR: syntax error at or near "USING"

may any one solve this problem?

THANKS.
Oct 21 '10 #1
Share this Question
Share on Google+
3 Replies


Expert 100+
P: 700
What postgres version do you use.
Oct 25 '10 #2

P: 61
Postgres 8.3 for windows
Oct 26 '10 #3

Expert 100+
P: 700
Expand|Select|Wrap|Line Numbers
  1. EXECUTE .. USING
  2.  
appeared in 8.4 version.
See here http://www.postgresql.org/docs/8.4/s...lease-8-4.html
Oct 26 '10 #4

Post your reply

Sign in to post your reply or Sign up for a free account.