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

Transaction: Begin, Lock

From: Margarita Barvinok <brita(at)umich(dot)edu>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Transaction: Begin, Lock
Date: 1999-09-13 14:58:43
Message-ID: Pine.SOL.4.10.9909131044130.5490-100000@joust.rs.itd.umich.edu (view raw or flat)
Thread:
Lists: pgsql-interfaces
Hi,

I have two questions about transactions.
This is part of my C code.

EXEC SQL CONNECT TO ...
for (i=2; i<x: i++) {
  strncpy(oid_c, entries[i].val, 10);  /* get oid */
  oid_rec = atoi(oid_c);
  EXEC SQL BEGIN WORK;
  EXEC SQL DELETE FROM phonebook
           WHERE oid = :oid_rec;
  EXEC SQL COMMIT WORK;
}
EXEC SQL DISCONNECT;

1. Why i get the following message when I run this code?
NOTICE: BeginTransactionBlock and not in default state

2. How should I lock the table phonebook during this transaction?

Thank you,

-Margarita
-------------------------------
Margarita Barvinok
System Administrator II
University of Michigan
Department of Biology
-------------------------------


Responses

pgsql-interfaces by date

Next:From: Craig OrsingerDate: 1999-09-13 18:49:03
Subject: RE: [INTERFACES] ecpg and getting just assigned serial number
Previous:From: Kevin MulhollandDate: 1999-09-13 14:53:48
Subject: subscribe

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