Subject Re[2]: [ib-support] Changing metadata in a production database
Author Daniel Rail
Hi,

> Jason,

> I'm using the "Database Explorer" that comes with delphi. So, I'm
> connecting via BDE.
> I did not commit any changes... Only rollback

> What I found is that if I don't change "field2" and rollback, it works
> (field1 return to ""), but if i update field2 in the same transaction (i
> didn't commit, or rollback), looks like that bde commit my changes and
> starts a new transaction...

> (1) Start transaction
> (1) SELECT * FROM table1 (field1 "")
> (1) UPDATE table1 SET field1='T' where id=1
> (2) ALTER TABLE table1 add field2 VARCHAR(10)
> (1) UPDATE table1 SET field2="test" where id=1
> (*) - I think BDE here COMMIT and Starts another transaction

Or, it might be that it does a prepare on the UPDATE statement and
doesn't find "field2", because you didn't commit the ALTER TABLE
statement. It's generally not a good idea to mix DDL(Data Definition
Language, i.e.: ALTER TABLE) and DML(Data Manipulation Language, i.e.:
SELECT and UPDATE), within the same transaction. You're seeing one
of the side effects of mixing them.

> (1) SELECT * FROM table1 (both fields "T" and "test")
> (1) ROLLBACK
> (1) SELECT * FROM table1 (field1 "T")


Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.accramed.ca)