Richard Huxton <[EMAIL PROTECTED]> writes:
> I think it's just the brackets () - plpgsql's parser isn't terribly
> sophisticated.
It's not plpgsql's fault --- you'll get the same result if you put
parentheses around a DELETE command at the SQL command line.
regression=# (delete from fool);
ERROR
Amazing what a bracket can do :)
Thanks for the help.
>>> Richard Huxton <[EMAIL PROTECTED]> 2007-09-04 12:45 >>>
Bart Degryse wrote:
> I'm trying to use a delete statement with returning clause in a function:
> FOR rec IN (
> delete from billing_errors_new where errortypeid IN (1,2) re
Bart Degryse wrote:
I'm trying to use a delete statement with returning clause in a function:
FOR rec IN (
delete from billing_errors_new where errortypeid IN (1,2) returning *)
LOOP
I get following error though:
ERROR: syntax error at or near "delete" at character 4
QU
I'm trying to use a delete statement with returning clause in a function:
CREATE OR REPLACE FUNCTION "public"."test_delete"() RETURNS void AS
$body$
DECLARE
rec billing_errors_new;
BEGIN
FOR rec IN (
delete from billing_errors_new where errortypeid IN (1,2) returning *)
LO