Subject | Re[2]: [ib-support] Changing metadata in a production database |
---|---|
Author | Daniel Rail |
Post date | 2003-02-14T11:59:35Z |
Hi,
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.
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.accramed.ca)
> Jason,Or, it might be that it does a prepare on the UPDATE statement and
> 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
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")Daniel Rail
> (1) ROLLBACK
> (1) SELECT * FROM table1 (field1 "T")
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.accramed.ca)