RE: Return PGresult

From: "anuj" <Anuj(at)in-control(dot)de>
To: <pgsql-general(at)postgresql(dot)org>
Subject: RE: Return PGresult
Date: 2000-07-21 04:31:19
Message-ID: NEBBICAAMKOEBEPFMFPBAEKBCBAA.Anuj@in-control.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks,
Now, I am able to return PGresult. Pointer to pointer is working fine.
And about memory allocation. Before the PQexec we can't decide required
memory. So, PQexec doing the memory allocation.
Cherries
Anuj
>Try
>dbQuery("tempdb","select * from tbltemp",&totalrec,&resu);
>and the function declaration
>dbQuery(char *dbName,char *sqlststatement,int *totalrec,PGresult **res);
>and then within the function reference it as *res=

-----Original Message-----
From: pgsql-general-owner(at)hub(dot)org [mailto:pgsql-general-owner(at)hub(dot)org]On
Behalf Of Dave Smith
Sent: Thursday, July 20, 2000 5:46 PM
To: anuj
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Return PGresult

anuj wrote:
>
> Thanks,I'm trying PGresult pointer to pointer.
> And Why don't PGresult pointer variable reqiure memory allocation
(malloc()?
> Like /* resu = (PGresult *)(malloc(sizeof(PGresult)); */
>
I believe that the PQexec is doing the allocation. That is why it has
to be pointer to pointer.

--
Dave Smith
Candata Systems Ltd.
(416) 493-9020
dave(at)candata(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephane Bortzmeyer 2000-07-21 07:39:34 Re: Re: [HACKERS] 8Ko limitation
Previous Message Tim Howe 2000-07-21 03:27:45 Re: strange JDBC error