Skip site navigation (1) Skip section navigation (2)

ECPG dynamic cursor, SQLDA support

From: Boszormenyi Zoltan <zb(at)cybertec(dot)at>
To: Michael Meskes <meskes(at)postgresql(dot)org>
Cc: Hans-Juergen Schoenig <hs(at)cybertec(dot)at>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: ECPG dynamic cursor, SQLDA support
Date: 2009-06-24 09:51:57
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

attached is our latest patch extending ECPG:

1. Support computed cursorname (DECLARE :cursorname ..., etc)
    No change in that part, it's purely a parser-only change, there's no
    ECPGdo() change you criticized or any other bad juju. Because of
    adding support for :cursorname and the dynamically generated
    ECPG grammar, we needed to modify the main gram.y as well,
    to make way for computed cursor names. The fetch_direction and
    FetchStmt change was needed in gram.y because otherwise
    "FETCH fetch_direction from_in cursor_name" and
    "MOVE fetch_direction from_in cursor_name" rules caused
    shift/reduce conflicts in the "fetch_direction" rule in ECPG grammar.
    This modification was a little sacrifice in gram.y but it allowed
    keeping the ECPG grammar clean and little change in the automatic
    grammar generation.

2. Support SQLDA structure in ECPG, both in USING DESCRIPTOR
    and INTO DESCRIPTOR, if Informix-compatible mode is set.
    This means the following changes
    - introduce the pg_sqlda_t and pg_sqlvar_t structures, ECPGt_sqlda type
      and SQLNNN contants in sqltypes.h
    - make a distinction between DESCRIPTOR and SQL DESCRIPTOR
      in Informix mode
    - Support FETCH ... USING DESCRIPTOR in Informix mode only,
      that works the same way as FETCH ... INTO DESCRIPTOR.
    The support was added as a new, exported ECPGdescribe2() function
    in descriptor.c, the old unsupported ECPGescribe() interface was
left intact
    so the major library version doesn't need to be changed.
Best regards,
Zoltán Böszörményi

Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics

Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH

Attachment: ecpg-dyncursor-sqlda-8.4cvs-11-ctxdiff.patch
Description: text/x-patch (55.2 KB)


pgsql-hackers by date

Next:From: Peter EisentrautDate: 2009-06-24 10:07:52
Subject: Re: dblink for 8.4 should work without user-mappings
Previous:From: Brendan JurdDate: 2009-06-24 09:38:26
Subject: Re: BUG #4862: different results in to_date() between 8.3.7 & 8.4.RC1

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group