Re: ecpg weird behavior

From: "Nicolas Bazin" <nbazin(at)ingenico(dot)com(dot)au>
To: "Michael Meskes" <meskes(at)postgresql(dot)org>
Cc: <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: ecpg weird behavior
Date: 2002-03-18 04:34:56
Message-ID: 000801c1ce36$4197d570$660d090a@software.ingenico.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces


----- Original Message -----
From: "Michael Meskes" <meskes(at)postgresql(dot)org>
To: "Nicolas Bazin" <nbazin(at)ingenico(dot)com(dot)au>
Cc: <pgsql-interfaces(at)postgresql(dot)org>
Sent: Friday, March 15, 2002 7:21 PM
Subject: Re: [INTERFACES] ecpg weird behavior

> On Thu, Mar 14, 2002 at 05:16:41PM +1100, Nicolas Bazin wrote:
> > It will know the variables when the cursor is declared. Here is the
syntax
> > that we currently use with INFORMIX and it also corresponds to the
syntax in
> > the PostgreSQL documentation:
>
> Where did you find this in the PostgreSQL docs?
Ooops sorry I was refering to the documentation of the SQL commands in the
reference manual, but I guess it is not fully relevent here.

>
> It certainly is not implemented.
>
> > EXEC SQL DECLARE curs_currency CURSOR FOR
> > SELECT DISTINCT
> > FT_devises.dvs_devise,pays.pys_coddevalp,pays.pys_nbrdecimal
> > INTO :pays.pys_coddevnum, :pays.pys_coddevalp, :pays.pys_nbrdecimal
> > FROM pays, FT_devises WHERE FT_devises.dvs_code =
:stpe.tpe_profdevise
> > AND FT_devises.dvs_devise = pays.pys_coddevnum;
> >
> > EXEC SQL FETCH curs_currency;
>
> Anyone out there with more knowledge about standards? I thought this was
> not standard at all.
>
> > > Yes, I am. Please send it to me directly at meskes(at)postgresql(dot)org(dot)
> > This patch breaks backward compatibility. The idea was to change the
output
> > of the preproc when it parses EXEC SQL type mytpe is ... from comment to
the
> > proper typedef definition. Then the typedef doesn't have to be added
> > manually. If you still want it, I can send it.
>
> I still want it. After all I can change the behaviour with a command
> line option.

OK this patch includes the following (I hope it's in the right order this
time):
1.
EXEC SQL type mytype is .... does not need a typedef after.
2.
EXEC SQL begin declare section;
typedef struct {
int field1;
} mytype;
mytype var1;
EXEC SQL end declare sction;

I still have a problem when the grammar is parsed by bison. I get the
following message:
conflicts: 12 shift/reduce

As I told you before I'm not very familiar with yacc or bison so if you
could help me in finding what is the problem.

Nicolas BAZIN

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

Attachment Content-Type Size
preproc.diff application/octet-stream 4.5 KB

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message PG Explorer 2002-03-18 20:54:21 Re: TCP/IP database connection problem with pgaccess
Previous Message Nicolas Bazin 2002-03-17 23:41:41 Re: ecpg weird behavior