Hello, colleages,
I have run a C program with embedded SQL, but the changes (insert sentences) don't keep data in the
database. When I connect to the database by writting "psql database" and I do the selects, nothing
appears.
If I write the same SQL sentences in psql, the changes keep done.
I wasn't using transactions, but now I have included them, although the same thing happens again.
Any idea about this?
The code is:
EXEC SQL BEGIN DECLARE SECTION;
...
...
EXEC SQL END DECLARE SECTION;
EXEC SQL CONNECT TO db USER username;
EXEC SQL BEGIN TRANSACTION;
EXEC SQL INSERT INTO table (...) VALUES (...);
EXEC SQL INSERT INTO table (...) VALUES (...);
EXEC SQL INSERT INTO table (...) VALUES (...);
...
EXEC SQL COMMIT TRANSACTION;
EXEC SQL DISCONNECT;
------------------------------------------
Rosa Maria Carro Salas
E.T.S.Informatica
Universidad Autonoma de Madrid
Cantoblanco 28049, Madrid (Spain)
phone: +34 1 348 2291