Re: Program Syntax Help Needed - Mailing list pgsql-novice

From Tom Lane
Subject Re: Program Syntax Help Needed
Date
Msg-id 22843.1275682576@sss.pgh.pa.us
Whole thread Raw
In response to Program Syntax Help Needed  (Alan Simon <simon@hslc.org>)
List pgsql-novice
Alan Simon <simon@hslc.org> writes:
> -- Import copy_note data
> CREATE OR REPLACE FUNCTION add_copy_notes() RETURNS integer AS '
> DECLARE
>     copynote RECORD;
> BEGIN;
>     FOR copynote IN SELECT * FROM asset.copy ac

One fairly common gotcha is that you can't put a semicolon directly
after BEGIN ...

> psql:generate_notes.sql:26: ERROR: syntax error at or near "RECORD"
> LINE 3: copy RECORD;
> ^

... although this error message suggests there's something else wrong in
the immediate vicinity.  But since what that shows doesn't match up with
what you show above, I wonder whether you're confusing yourself by
editing the wrong file.  We've all done it :-(

            regards, tom lane

pgsql-novice by date:

Previous
From: Alan Simon
Date:
Subject: Program Syntax Help Needed
Next
From: Leif Biberg Kristensen
Date:
Subject: Re: Program Syntax Help Needed