Re: ECPG Questions - Mailing list pgsql-interfaces

From Michael Meskes
Subject Re: ECPG Questions
Date
Msg-id 20020712135804.GQ6147@feivel.credativ.de
Whole thread Raw
In response to ECPG Questions  (Jim Parker <hopeye@cfl.rr.com>)
Responses Re: ECPG Questions
List 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@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!


pgsql-interfaces by date:

Previous
From: "Warren W. Gay VE3WWG"
Date:
Subject: Re: Wish List: Client access to NUMERIC/DECIMAL type functions
Next
From: Alexaki Sofia
Date:
Subject: Re: arrays as input parameter for c functions