Re: plpgsql For SQLQuery Loop Flags Error - Mailing list pgsql-bugs

From Greg Sabino Mullane
Subject Re: plpgsql For SQLQuery Loop Flags Error
Date
Msg-id 433bf31544d31e85aa32c0ff1b2deb1b@biglumber.com
Whole thread Raw
In response to plpgsql For SQLQuery Loop Flags Error  (Puneet Paul <paulptech@yahoo.com>)
List pgsql-bugs
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> I get error "missing ".." at end of SQL expression"
...
> Can someone help please

The problems appear to be in your declare block:

>  curTrackList char(15) ALIAS for $1;
>  sliceFile varchar ALIAS for $2;
>  lmfpLimit integer ALIAS for $3

You need a semicolon after the #3, and if declaring a
variable as an alias, you do /not/ put in the data type
(because you already declared it). In other words:

  curTrackList ALIAS fOR $1;
  sliceFile    ALIAS FOR $2;
  lmfpLimit    ALIAS FOR $3;

That may or may not be what is causing the error you saw:
plpgsql's error reporting is not always as helpful as
it should be. Just start at the top of the file and
work your way down, looking for easy stuff. Then cut things
out of the function until it works, and add things back in a
line at a time until you figure out the problem(s).

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200312182010

-----BEGIN PGP SIGNATURE-----

iD8DBQE/4lDovJuQZxSWSsgRAulsAJ0bvUiXWiKmUDLV6esHoZtuQ6D5eQCgi5AA
xKH9t+TM59YbXa2dc7CyjRY=
=yapu
-----END PGP SIGNATURE-----

pgsql-bugs by date:

Previous
From: "Russell Garrett"
Date:
Subject: Re: Urgent: Key constraints behaving weirdly
Next
From: Bruce Momjian
Date:
Subject: Re: libpq3 + ssl memory leak