Re: ECPG usage

Поиск
Список
Период
Сортировка
От Michael Meskes
Тема Re: ECPG usage
Дата
Msg-id 20060725200755.GA14177@1
обсуждение исходный текст
Ответ на ECPG usage  ("Jasbinder Bali" <jsbali@gmail.com>)
Список pgsql-general
>        while(1)
>        {
>                EXEC SQL FETCH IN c_movie INTO :movie_title;
>              printf("%s\n",movie_title);
>              movie_title = NULL;
>        }
>
>      free (movie_title);

As a side note, you should free movie_title each time, not just set it
to NULL if you use auto allocation.

> At while loop, it keeps on looping forever and my table has 2 records for
> the query that is eventually build.
> Does that mean         EXEC SQL WHENEVER NOT FOUND DO BREAK;   is not
> working.

No, that would be the first time I hear about this. You could run your
program with debugging enabled (see test/*.pgc for example). Also I'd
like to know which version of ecpg you're using.

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

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

Предыдущее
От: John DeSoi
Дата:
Сообщение: Re: Mapping/DB Migration tool
Следующее
От: Reece Hart
Дата:
Сообщение: Re: Mapping/DB Migration tool