X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 70215474E4F for ; Sat, 5 Apr 2003 15:48:34 -0500 (EST) Received: from pollux.cic.ipn.mx (pollux.cic.ipn.mx [148.204.211.160]) by postgresql.org (Postfix) with ESMTP id A958B474E42 for ; Sat, 5 Apr 2003 15:48:33 -0500 (EST) Received: from cguzman (dup-200-64-118-82.prodigy.net.mx [200.64.118.82]) by pollux.cic.ipn.mx (8.12.6/8.12.5) with SMTP id h35KdwAv027244 for ; Sat, 5 Apr 2003 14:40:00 -0600 Message-ID: <001301c2fbb4$9d0b3e40$9264a8c0@cguzman> From: "CIC mail" To: References: Subject: unscribe Date: Sat, 5 Apr 2003 14:47:44 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-MailScanner: Found to be clean Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, hits=-13.6 required=5.0 tests=BAYES_20,ORIGINAL_MESSAGE,QUOTED_EMAIL_TEXT,RCVD_IN_DSBL, RCVD_IN_NJABL,REFERENCES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/79 X-Sequence-Number: 12780 UNSCRIBE Atentamente M. en C. C=E9sar Sa=FAl Guzm=E1n Renter=EDa Jefe de la Unidad de Desarrollo de Aplicaciones Subdirecci=F3n de Investigaci=F3n Aplicada Centro de Investigaci=F3n en Computaci=F3n Tel=E9fono: 57-29-60-00, extensiones: 56551, 56587 ----- Original Message ----- From: "Walter McGinnis" To: Sent: Tuesday, April 01, 2003 10:31 PM Subject: [SQL] pesky plpgsql > Guess I'm an April Fool. When I define the following psql returns > "CREATE": > > -- update all galleries that are categories with their skey and rkey > values > CREATE FUNCTION update_cat_keys() RETURNS integer AS ' > declare > v_row RECORD; > begin > for v_row in select gallery_id, > imagedb_gallery_hierarchy_skey(gallery_id, NULL, '''') as skey, > imagedb_gallery_hierarchy_rskey(gallery_id, NULL, '''') as rskey from > imagedb_galleries where category_p =3D ''t'' loop > > update imagedb_galleries > set skey =3D v_row.skey, rskey =3D v_row.rskey > where gallery_id =3D v_row.gallery_id; > end loop; > return 1; > end; > ' LANGUAGE 'plpgsql'; > > When I call the function I get the following error: > > devpps=3D# select update_cat_keys(); > NOTICE: plpgsql: ERROR during compile of update_cat_keys near line 2 > ERROR: parse error at or near ";" > > The select in the loop runs fine in psql. So I'm stumped... > > I'm pretty ignorant about plpgsql, I'm used to pl/sql. > > TIA, > > Walter > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org >