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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-interfaces by date

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