Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 3 of 3 total |
sql rollback |
Wed, Jul 12 2006 10:47 AM | Permanent Link |
Jerry Blumenthal | I'm not sure how to do a try-except-rollback with a series of SQL
statements. Please tell me if the following is correct. (Using D4 and dbisam 2.12) 1. Put a tDBISAMdatabase onto the form and set its databasename to 'myDB' and its name to MainDB 2. Put a tdbisamquery onto the form and set its databaseName to 'myDB' and its name to Q1 3. code as follows: maindb.StartTransaction; Q1.sql.clear; q1.sql.add('ALTER TABLE "table1.dat" ADD FaxPhone char(14)'); q1.execsql; maindb.commit; except maindb.rollback; end; Is this correct? Jerry |
Wed, Jul 12 2006 1:20 PM | Permanent Link |
Bernd Kuhlmann | Jerry,
> I'm not sure how to do a try-except-rollback with a series of SQL > statements. Please tell me if the following is correct. (Using D4 and > dbisam 2.12) > > 1. Put a tDBISAMdatabase onto the form and set its databasename to > 'myDB' and its name to MainDB > > 2. Put a tdbisamquery onto the form and set its databaseName to 'myDB' > and its name to Q1 > > 3. code as follows: > maindb.StartTransaction; > Q1.sql.clear; > q1.sql.add('ALTER TABLE "table1.dat" ADD FaxPhone char(14)'); > q1.execsql; > maindb.commit; > except > maindb.rollback; > end; > > Is this correct? Yes if you use a select, update or delete statement. No if you alter the table. From the manual: The following operations are not compatible with transactions and will cause a transaction to commit if encountered during a transaction: Backing Up and Restoring Databases Verifying and Repairing Tables Creating and Altering Tables Adding and Deleting Indexes from a Table Optimizing Tables Upgrading Tables Deleting Tables Renaming Tables Emptying Tables Copying Tables Bernd |
Wed, Jul 12 2006 2:09 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Bernd,
<< No if you alter the table. From the manual: The following operations are not compatible with transactions and will cause a transaction to commit if encountered during a transaction: >> Quick note - under 2.x, the behavior was that the transaction was ignored during those operations. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |