Re: ECPG usage

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Jasbinder Bali <jsbali(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ECPG usage
Date: 2006-07-25 20:07:55
Message-ID: 20060725200755.GA14177@1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)jabber(dot)org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

In response to

  • ECPG usage at 2006-07-20 19:56:34 from Jasbinder Bali

Browse pgsql-general by date

  From Date Subject
Next Message Reece Hart 2006-07-25 21:49:34 Re: Mapping/DB Migration tool
Previous Message John DeSoi 2006-07-25 19:31:40 Re: Mapping/DB Migration tool