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

Re: NULLs in ecpg

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: <wespvp(at)syntegra(dot)com>, <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: NULLs in ecpg
Date: 2004-07-22 17:51:39
Message-ID: 200407221951.39787.peter_e@gmx.net (view raw or flat)
Thread:
Lists: pgsql-interfaces
wespvp(at)syntegra(dot)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/


In response to

pgsql-interfaces by date

Next:From: Peter EisentrautDate: 2004-07-22 17:54:15
Subject: Re: libpq: usage of PQoidValue to obtain serial primary key after insert
Previous:From: wespvpDate: 2004-07-22 17:29:03
Subject: Re: NULLs in ecpg

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