Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 1381BDE314A for ; Tue, 3 Apr 2012 06:23:38 -0300 (ADT) Received: from nm14.bullet.mail.bf1.yahoo.com ([98.139.212.173]) by makus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1SEzxh-0002Fe-DX for pgsql-sql@postgresql.org; Tue, 03 Apr 2012 09:23:38 +0000 Received: from [98.139.212.150] by nm14.bullet.mail.bf1.yahoo.com with NNFMP; 03 Apr 2012 09:23:24 -0000 Received: from [98.139.215.253] by tm7.bullet.mail.bf1.yahoo.com with NNFMP; 03 Apr 2012 09:23:24 -0000 Received: from [127.0.0.1] by omp1066.mail.bf1.yahoo.com with NNFMP; 03 Apr 2012 09:23:24 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 563788.42851.bm@omp1066.mail.bf1.yahoo.com Received: (qmail 81500 invoked by uid 60001); 3 Apr 2012 09:23:24 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1333445004; bh=ARDwGieCxbkWwM2erxFfWlWafjaxm4FJDFzk+73jiCM=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=CnMySbd7hmzTKkIBr4KxF1X+qP6pv/I8xfc7PpcP9YF2oG12xd7adJKGfYqMh4VUmqGZJGid2w7COx92AnbHaqZX4O0N5tjrbpk8pXzegtiJL727ZLuKpJdCs/h797yPuS1dBYfXvdTEEgsZlWkhUTTzZfa7iIElWM57cwQuhbQ= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=6fPkxfq5M4PkPsmBKtwytWMGLIjeVKWlBxy9ZJq0PSW8cUTjVtdgJuwvMH/epSSjr2C44JfX41RkmwC/OLXxhx26LnJhsEYgtV2q510pUSnuFlnkutM1n7SVH+6Bgkyv0vIGzLnq7s1xhPrrjYekXlRpPfPLdhZiBYiODKi4mIE=; X-YMail-OSG: bFpc4XMVM1mbMK6tK81YiCEM1oAnQw7bWVgIH8eyV..bZ1D SEiHEpPBfqpDic1hraoKdaMHXwr8ALhOwran3cHQXuh9cFXWwKByRfUHeOCA iwetL79P4YfRBfPaCmky9JgJVP668m3yDdw3aouX1lO9FSLa2Jv.RGnLKCw_ OzieR8_Z3UI6mAYDbcH04rjyxvp9i935SP8m46P8i6djXI82dCFBEDg98ohM 2gsLfZRbPRraZbfeWuAU_TUvEswIsQ8gLBtW2CEjtNasa.C4vA0bvhUs5EoP hJljt8fQJ86M_5wfcSpbWy7l9SU8fsNhvfqprlXB7guUWcuD5.iQj0kg9Bfl lmSjC8jNVHLpcpyh6BxVopBblq1x1Tl9uTB8QLi7BYqTPQ19TafBNHZlp4Qx 93bl.egdTMVcXkhv4sJHeaBcv6XNTcEmXEi8EUcstajcEQ9t4VVGypDkID5n wV73L2Q-- Received: from [182.178.215.135] by web162202.mail.bf1.yahoo.com via HTTP; Tue, 03 Apr 2012 02:23:24 PDT X-Mailer: YahooMailWebService/0.8.117.340979 Message-ID: <1333445004.77078.YahooMailNeo@web162202.mail.bf1.yahoo.com> Date: Tue, 3 Apr 2012 02:23:24 -0700 (PDT) From: La Chi Reply-To: La Chi Subject: Cursor Error To: "pgsql-sql@postgresql.org" MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="2102937278-1782827037-1333445004=:77078" X-Pg-Spam-Score: 2.6 (++) X-Archive-Number: 201204/3 X-Sequence-Number: 36480 --2102937278-1782827037-1333445004=:77078 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hello every one=0A=0Ai have created this function to test cursors , but whe= n i execute this funtion it give me this error , how can i fix this error= =0A=0ACREATE OR REPLACE FUNCTION foo(custid int) returns table(userid int) = as=0A$BODY$=0A=0ADECLARE rs cursor for Select customer_name from customer;= =0A=0ABEGIN=0Afetch forward 5 in rs;=0A=A0=0AEND;=0A$BODY$=0ALANGUAGE plpgs= ql;=0A=0Aerror--=0A=0AERROR: =A0syntax error at or near ";"=0ALINE 7: =A0fe= tch forward 5 in rs;=0A=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 ^=0A=0A********** Error **********=0A=0AERROR: syntax error at or n= ear ";"=0ASQL state: 42601=0ACharacter: 172=0A --2102937278-1782827037-1333445004=:77078 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hello= every one

i have created th= is function to test cursors , but when i execute this funtion it give me th= is error , how can i fix this error

CREATE OR REPL= ACE FUNCTION foo(custid int) returns table(userid int) as
= $BODY$

DECLARE rs cursor for Select customer_name from customer;
BEGIN=09
=09fetch= forward 5 in rs;
=09 
END;
$BODY$
LANGUAGE plpgsql;

error--

ERROR:  syntax error at or near= ";"
LINE 7:  fetch forward 5 in rs;
        &nb= sp;                     ^=
********** Error **********

ERROR: syntax error at or near ";"
SQL = state: 42601
Character: 172

--2102937278-1782827037-1333445004=:77078--