plpgsql Cursor Mismatched Parentheses

From: <cnliou(at)eurosport(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: plpgsql Cursor Mismatched Parentheses
Date: 2002-07-12 08:32:36
Message-ID: 200207120832.24c4@th00.opsion.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi!

I have never successfully used bounded parameterized
cursors. Error occurs when opening cursor. Please see
below and help!

Regards,

CN
===========================
CREATE FUNCTION test(SMALLINT,SMALLINT) RETURNS
BOOLEAN AS '
DECLARE
y1 ALIAS FOR $1;
m1 ALIAS FOR $2;

o TEXT;
y2 SMALLINT;
m2 SMALLINT;

c CURSOR (o TEXT,y1 SMALLINT,m1 SMALLINT,y2
SMALLINT,m2 SMALLINT) IS
SELECT column1,column2 FROM table1 WHERE column9=o
AND column3 BETWEEN (SELECT column3 FROM table1 WHERE
column9=o AND column1=y1 AND column2=m1) AND (SELECT
column3 FROM table1 WHERE column9=o AND column1=y2
AND column2=m2) ORDER BY 1,2;

BEGIN
o:=''xxx'';
y2:=2002;
m2=7;

OPEN c(o,y1,m1,y2,m2);
CLOSE c;

RETURN TRUE;
END;' LANGUAGE 'plpgsql';
======================
database=# select test(2002,5);
NOTICE: plpgsql: ERROR during compile of test near
line 17
ERROR: mismatched parentheses

--------------------------------------------------------
You too can have your own email address from Eurosport.
http://www.eurosport.com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thirumoorthy Bhuvneswari 2002-07-12 08:54:11 Re: Query Speed!!!
Previous Message Uros Gruber 2002-07-12 08:26:57 What is better any why