USE OF CURSORS IN ECPG

Поиск
Список
Период
Сортировка
От Maurizio
Тема USE OF CURSORS IN ECPG
Дата
Msg-id 001101c048db$38a74d60$7394fea9@maurizio
обсуждение исходный текст
Ответы Re: USE OF CURSORS IN ECPG  (Michael Meskes <meskes@postgresql.org>)
Список pgsql-interfaces
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 was deleted and I receive some errors.
 
At open cursor : sqlca.sqlcode = -230 Invalid statement namei in line ......
at fetch           : NOTICE : PerformPortalFetch: portal "cur_unimpianto" not found
 
Please could anyone help me ?
 
thanks
 
regards
Maurizio Cauci
DREAMTECH di Cauci Maurizio
Via Ronchetti, 2 - 21013 Gallarate (VA)
www.dreamtech-it.com

В списке pgsql-interfaces по дате отправления:

Предыдущее
От: "Christopher R. Jones"
Дата:
Сообщение: Re: Access 2000 and empty fields
Следующее
От: Will Dennis
Дата:
Сообщение: PoPy make error