Received: from smtp3.libero.it (smtp3.libero.it [193.70.192.53]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eA7GoDs63642 for ; Tue, 7 Nov 2000 11:50:14 -0500 (EST) (envelope-from maurizio@dreamtech-it.com) Received: from maurizio (151.29.213.66) by smtp3.libero.it; 7 Nov 2000 17:49:43 +0100 Message-ID: <001101c048db$38a74d60$7394fea9@maurizio> From: "Maurizio" To: Subject: USE OF CURSORS IN ECPG Date: Tue, 7 Nov 2000 17:52:00 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0007_01C048E3.6DF62D80" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200011/90 X-Sequence-Number: 126 Messaggio in formato MIME composto da pił parti. ------=_NextPart_000_0007_01C048E3.6DF62D80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I'm just starded using ecpg and I have some problem with cursors. I wrote this lines exec sql begin declare section; char query[500]; int CodImpianto; int Cod1; int Cod2; char Descr[100]; exec sql end declare section; strcpy(query, "select ............"); exec sql connect db; sub1() { exec sql prepare stmtunimpianto from :query; exec sql declare CUR_UNIMPIANTO cursor for stmtunimpianto; . . . exec sql open CUR_UNIMPIANTO using :CodImpianto; exec sql fetch CUR_UNIMPIANTO into :CodImpianto, :Descr; . . exec sql close CUR_UNIMPIANTO; exec sql execute StmtUpdImpianti using :Cod1, :Descr, :Cod2; exec sql commit; } I call this routine a lot of time. If I rem the commit all works fine but if I execute the commit the cursor w= as deleted and I receive some errors. At open cursor : sqlca.sqlcode =3D -230 Invalid statement namei in line ...= ... at fetch : NOTICE : PerformPortalFetch: portal "cur_unimpianto" n= ot found Please could anyone help me ? thanks regards Maurizio Cauci DREAMTECH di Cauci Maurizio Via Ronchetti, 2 - 21013 Gallarate (VA) www.dreamtech-it.com ------=_NextPart_000_0007_01C048E3.6DF62D80 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
I'm just starded using ecpg and I have som= e problem=20 with cursors.
 
I wrote this lines
 
exec sql begin declare section;
    char query[500];=
    int CodImpianto;=
    int Cod1;
    int Cod2;
    char Descr[100];
exec sql end declare section;<= /DIV>
strcpy(query, "select ............");
 
exec sql connect db;
 
sub1()
{
    exec sql prepare stmtun= impianto=20 from :query;
    exec sql declare CUR_UN= IMPIANTO=20 cursor for stmtunimpianto;
    .
    .
    .
 
    exec sql open CUR_UNIMP= IANTO=20 using :CodImpianto;
    exec sql fetch CUR_UNIM= PIANTO=20 into :CodImpianto, :Descr;
    .
    .
 
    exec sql close=20 CUR_UNIMPIANTO;
    exec sql execute StmtUpdImpi= anti=20 using :Cod1, :Descr, :Cod2;
    exec sql commit;=
}
 
I call this routine a lot of time.<= /DIV>
If I rem the commit all works fine but if = I execute=20 the commit the cursor was deleted and I receive some errors.
 
At open cursor : sqlca.sqlcode =3D -230 In= valid=20 statement namei in line ......
at=20 fetch           : NO= TICE=20 : PerformPortalFetch: portal "cur_unimpianto" not found
 
Please could anyone help me ?
 
thanks
 
regards
Maurizio Cauci
DREAMTECH di Cauci=20 Maurizio
Via Ronchetti, 2 - 21013 Gallarate (VA)
www.dreamtech-it.com
<= /BODY> ------=_NextPart_000_0007_01C048E3.6DF62D80--