Re: embedded sql pointer to structure question

From: Feite Brekeveld <feite(dot)brekeveld(at)osiris-it(dot)nl>
To: Michael Meskes <meskes(at)postgresql(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: embedded sql pointer to structure question
Date: 2001-03-16 20:51:20
Message-ID: 3AB27CC8.C3C10F41@osiris-it.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Meskes wrote:

> On Fri, Mar 16, 2001 at 12:58:06PM +0100, Feite Brekeveld wrote:
> > ...
> > Exec sql begin declare section;
> > MYREC *pmr = &mr;
> >
> > exec sql end declare section;
> > ...
> > I get the message : ERROR: The variable id is not declared
> > ...
>
> Yes, this is a known limintation. It's even listed in the TODO file. For
> ECPG to be able to understand your variable it has to know the definition of
> the struct. Since it is not listed in your declare section it cannot learn
> the details and thus won't be able to parse the construct.
>
> Please try:
>
> exec sql begin declare section;
> struct {
> int id;
> char value[40];
> } *pmr;
> exec sql end declare section;

If I do that ( tried that already ) I get an eror message:

pmr is not a pointer

at the point where I reference to it in the query:

exec sql select ....bla bla ... where id = :pmr->id

Is there more detailed documentation somewhere then whats going with the
postgres distribution ?

>
>
> This should work. But be sure to use the latest CVS version as there was a
> small bug in this bug. I'm actually committing the fix right now.
>
> Michael
> --
> Michael Meskes
> Michael(at)Fam-Meskes(dot)De
> Go SF 49ers! Go Rhein Fire!
> Use Debian GNU/Linux! Use PostgreSQL!

--
Feite Brekeveld
feite(dot)brekeveld(at)osiris-it(dot)nl
http://www.osiris-it.nl

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron Chmara 2001-03-16 21:28:22 Re: ssl connections with psql
Previous Message Jan Wieck 2001-03-16 20:30:39 Re: need hint for a trigger...