fetch in embedded sql

Поиск
Список
Период
Сортировка
От Heinrich Retzlaw
Тема fetch in embedded sql
Дата
Msg-id 9efmu2$3rl$1@news.tht.net
обсуждение исходный текст
Список pgsql-general
hello,
i have written the following method for c++

bool DB::getPresentations(Presentations &pr)
{
        exec sql begin declare section;
                int     rID;
                char    pre[20];
        exec sql end declare section;

        rID = pr.roomID;

        exec sql BEGIN TRANSACTION;
        exec sql        DECLARE cur CURSOR FOR
                        SELECT  Presantation
                        FROM    Presantations
                        WHERE   RoomID=:rID;

        exec sql OPEN cur;

        // here
        exec sql FETCH FORWARD 1 IN cur INTO :pre;

        // and here
        exec sql CLOSE cur;
        exec sql COMMIT TRANSACTION;
}

if i start this method i get the following error belonging to the comments
"here" and "and here" in the code above

NOTICE:  current transaction is aborted, queries ignored until end of
transaction block
NOTICE:  current transaction is aborted, queries ignored until end of
transaction block

if i do the begin, declare cursor and fetch statement manually in the psql
database there is no error
thanks for every answer
best regards heinrich retzlaw



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

Предыдущее
От: Mayan
Дата:
Сообщение: Help with C++
Следующее
От: alla@sergey.com (Alla)
Дата:
Сообщение: Return cursor