Re: ECPG. Badly stuck - Mailing list pgsql-general

From Joachim Wieland
Subject Re: ECPG. Badly stuck
Date
Msg-id e476101ea426139722fe9b2877168de3@
Whole thread Raw
In response to ECPG. Badly stuck  ("Jasbinder Bali" <jsbali@gmail.com>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Table Inheritance and foreign key problem.
Next
From: David Hoksza
Date:
Subject: type of b-tree