embedded SQL cursos declare fails

Поиск
Список
Период
Сортировка
От Thalis A. Kalfigopoulos
Тема embedded SQL cursos declare fails
Дата
Msg-id Pine.LNX.4.21.0106181545180.24987-100000@aluminum.cs.pitt.edu
обсуждение исходный текст
Ответы Re: embedded SQL cursos declare fails  (Michael Meskes <meskes@postgresql.org>)
Список pgsql-general
Taken almost literally from the tutorial example (http://www.postgresql.org/idocs/index.php?app-ecpg.html) the
followingcode: 

<connectino establishment succesfull up to here>
EXEC SQL DECLARE my_cursor CURSOR FOR SELECT a,b FROM lala WHERE a= :i;
EXEC SQL FETCH FORWARD NEXT FROM my_cursor INTO :tmpa,:tmpb;

throws the following error in the logs:

2001-06-18 15:41:02 DEBUG:  query: begin transaction
2001-06-18 15:41:02 DEBUG:  ProcessUtility: begin transaction
2001-06-18 15:41:02 DEBUG:  query: fetch forward next from my_cursor
2001-06-18 15:41:02 DEBUG:  ProcessUtility: fetch forward next from my_cursor
2001-06-18 15:41:02 NOTICE:  PerformPortalFetch: portal "my_cursor" not found

I check the .c file generated by ecpg and the cursor declaration is commented out :-(

#line 10 "main.pgc"

    /* declare my_cursor  cursor for select  a  , b   from lala where a  = ?   */
#line 11 "main.pgc"

what's missing?


thanks,
thalis

ps there is a spelling mistake in the tutorial:
EXEC SQL FETCH foo_bar INTO :FooBar,DooDad; should be
EXEC SQL FETCH foo_bar INTO :FooBar,:DooDad;


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: aggregate function for median calculation
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Apache with PHP and PGSQL crashing ...