Re: ECPG. Badly stuck

From: "Joachim Wieland" <joe(at)mcknight(dot)de>
To: "Jasbinder Bali" <jsbali(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ECPG. Badly stuck
Date: 2006-07-23 15:19:27
Message-ID: e476101ea426139722fe9b2877168de3@
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On July 22, 7:46 pm "Jasbinder Bali" <jsbali(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Hoksza 2006-07-23 16:50:19 type of b-tree
Previous Message Alvaro Herrera 2006-07-23 14:17:51 Re: Table Inheritance and foreign key problem.