On July 22, 7:46 pm "Jasbinder Bali" <jsbali@gmail.com> wrote:
> I have a C program and have some ECPG code in it.
>
> How do i display the data that i retrieve from the postgres database
> using a simple select statment or calling a stored procedure.
>
> Is it mandatory to use cursor or there's any other way to print the
> retrieved data..
There is no copy to stdout if this is what you want. Normally you retrieve
the data with SELECT INTO and then you print the variables in the usual
way. And yes, if there are several rows in your result set you can
iterate over them by means of a cursor.
If you're developing a console based program, of course you (sometimes)
just write the values to stdout but other programs might not be console
based but might use some widget set. Displaying values in those contexts
has nothing to do with ecpg.
Joachim