Re: Error when trying to use a FOR loop

From: George Weaver <gweaver(at)shaw(dot)ca>
To: Kevin Nikiforuk <Kevin(dot)Nikiforuk(at)Acrodex(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Error when trying to use a FOR loop
Date: 2006-07-20 20:45:34
Message-ID: 005301c6ac3d$735dd6b0$6400a8c0@Dell4500
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


----- Original Message From: "Kevin Nikiforuk"

<snip>

>xp512-0715-0716=# FOR LV in 1..10 LOOP

<snip>

It appears that you are trying to use the For .. Loop structure from the
psql command line. This structure is not plain SQL - its meant to be used
within PL/pgSQL. Have you tried incorporating it into a PL/pgSQL function?

See
http://www.postgresql.org/docs/8.1/static/plpgsql-control-structures.html#PLPGSQL-CONTROL-STRUCTURES-LOOPS

Regards,
George

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Broersma Jr 2006-07-20 20:47:52 Re: simple problem???
Previous Message Richard Broersma Jr 2006-07-20 20:28:04 Re: Help with privilages please