Re: Program Syntax Help Needed

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alan Simon <simon(at)hslc(dot)org>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Program Syntax Help Needed
Date: 2010-06-04 20:16:16
Message-ID: 22843.1275682576@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Alan Simon <simon(at)hslc(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Leif Biberg Kristensen 2010-06-05 08:22:51 Re: Program Syntax Help Needed
Previous Message Luiz Eduardo Cantanhede Neri 2010-06-04 12:07:28 sum multiple tables gives wrong answer?