Re: ECPG usage - Mailing list pgsql-general

From Michael Meskes
Subject Re: ECPG usage
Date
Msg-id 20060725200755.GA14177@1
Whole thread Raw
In response to ECPG usage  ("Jasbinder Bali" <jsbali@gmail.com>)
List 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 by date:

Previous
From: John DeSoi
Date:
Subject: Re: Mapping/DB Migration tool
Next
From: Reece Hart
Date:
Subject: Re: Mapping/DB Migration tool