Re: NULLs in ecpg - Mailing list pgsql-interfaces

From Peter Eisentraut
Subject Re: NULLs in ecpg
Date
Msg-id 200407221951.39787.peter_e@gmx.net
Whole thread Raw
In response to Re: NULLs in ecpg  (<wespvp@syntegra.com>)
List pgsql-interfaces
wespvp@syntegra.com wrote:
> What is the scope of a BEGIN or an implicit transaction in ECPG?  Is
> it a physical subroutine, or can it span functions containing EXEC
> SQL statements?

It is independent of the control flow of your C program.  Only the order 
of the actually executed SQL statements matters.

> For example, if I have:
>
>
> void a (xxx)
> {
>    EXEC SQL SELECT ... for UPDATE;
>    EXEC SQL UPDATE ...
> }
>
> void b (xxx)
> {
>    EXEC SQL begin;
>
>    a(xxxx);
>
>    a(yyyy);
>
>    EXEC SQL COMMIT;
> }
>
>
> Do the multiple calls to 'a' remain in the same transaction?

Indeed

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/



pgsql-interfaces by date:

Previous
From:
Date:
Subject: Re: NULLs in ecpg
Next
From: Peter Eisentraut
Date:
Subject: Re: libpq: usage of PQoidValue to obtain serial primary key after insert