Re: ECPG Questions

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Jim Parker <hopeye(at)cfl(dot)rr(dot)com>
Cc: PostgreSQL mailing list <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: ECPG Questions
Date: 2002-07-12 13:58:04
Message-ID: 20020712135804.GQ6147@feivel.credativ.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

On Thu, Jul 11, 2002 at 11:01:27AM -0400, Jim Parker wrote:
> For example: I have a table that contains an id plus other information
> then a second table that contains an id as a foriegn key plus an arbitray
> number of data points. the two table are associated with an index table.
>
> I want to retrieve the data and put it into a linked list of structs, the
> data points in an
> array inside the struct.

The data points are not stored as one attribute of array type, but
rather as several tuples?

> Is there an easy way to do this.
>
> I was think that I would open a cursor to get the info from the first table
> (which includes a column for number of data points) Then allocate an array
> and open a second cursor to retrieve the data points, then put all the data
> into a list element and move to the next truple.

You can use an empty pointer to that array, libecpg will allocate the
memory if you fill the array at once. No need to use a cursor.

Michael
--
Michael Meskes
Michael(at)Fam-Meskes(dot)De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Thomas Lockhart 2002-07-12 14:25:00 Re: Can I have multiple cursors open ...
Previous Message Warren W. Gay VE3WWG 2002-07-12 13:55:06 Re: Wish List: Client access to NUMERIC/DECIMAL type functions