Re: [INTERFACES] esql\c documentation - Mailing list pgsql-interfaces

From Michael Meskes
Subject Re: [INTERFACES] esql\c documentation
Date
Msg-id 19990617104041.A2131@gmx.net
Whole thread Raw
In response to Re: [INTERFACES] esql\c documentation  (Craig Orsinger <orsingerc@epg-gw1.lewis.army.mil>)
Responses Re: [INTERFACES] esql\c documentation
List pgsql-interfaces
On Wed, Jun 16, 1999 at 02:33:06PM -0700, Craig Orsinger wrote:
> cursors rather differently from the way PostgreSQL does. There are three
> different types defined: non-scroll, SCROLL (SELECT), and FOR UPDATE. The
> FETCH statement has no IN/OUT clause, since ESQL/C seems to be able to
> remember what type of cursor each one is. What makes this a porting 
> challenge is that the ESQL/C parser will not accept and IN/OUT clause if
> it is there. SCROLL cursors, OTOH, have a position clause, which 
> ...

What do you mean with IN/OUT? Please try your syntax directly via psql to
see whether this is an ECPG problem. DECLARE/FETCH commands are handled by
the backend.

>         I've found that replacing the FREE <cursor id> with a COMMIT
> statement works pretty well for me, since Informix offers the ability 
> to not use transactions - a feature my applications don't require.

You can do the same with postgresql, i.e. each statement is its own
transaction.

> track of the fact that you've already declared it (using a flag, 
> presumably). How well would that work in ECPG? [BTW, ESQL/C does flag
> the FREE <cursor id> statement as being non-compliant with ANSI SQL.]

I think we only have FREE for prepared statements not for cursors. I cnnot
remember reading anything about freeing cursor in SQL92.

> EXEC SQL BEGIN DECLARE SECTION ;
>    char field_a[FIELD_A_LEN+1] ;
> EXEC SQL END DECLARE SECTION ;

Should work. You have to EXEC SQL DEFINE FIELD_A_LEN 1 before.

Michael
-- 
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael.Meskes@gmx.net          | Use PostgreSQL!


pgsql-interfaces by date:

Previous
From: Bernie
Date:
Subject: Does version 6.5 of the JDBC driver support JDBC 2.0?
Next
From: StOo
Date:
Subject: psql command access through libpq/libpq++