Re: embedded sql pointer to structure question - Mailing list pgsql-general

From Michael Meskes
Subject Re: embedded sql pointer to structure question
Date
Msg-id 20010316140257.B4082@feivel.fam-meskes.de
Whole thread Raw
In response to embedded sql pointer to structure question  (Feite Brekeveld <feite.brekeveld@osiris-it.nl>)
List pgsql-general
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;

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@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!

pgsql-general by date:

Previous
From: "Richard Huxton"
Date:
Subject: Re: need hint for a trigger...
Next
From: "Trewern, Ben"
Date:
Subject: RE: I wonder why I don't get an exception on delphi?