Re: Check whether in transaction or not
Posted in 1997
Art Kagel wrote: > > Jayakumar George wrote: > > > > Hi , > > > > Is there a way to check whether we are in a transaction in 4gl. > > > > (Apart from using a begin work with whenever error statements). > > Just set a global variable when you begin work to keep track of your > current transaction status. Common practice is to write functions to handle these commands: begin_work() BEGIN WORK commit_work() COMMIT WORK rollback_work() ROLLBACK WORK These functions check the type of database via global variables set at database open time, (i.e. if it supports transactions and which type), and issue the command if appropriate. This would be the ideal place to set such a global flag. Cheers, -- Mark. +----------------------------------------------------------+-----------+ |Mark D. Stock - Informix SA http://www.informix.com |//////// /| |mailto:mdstock@informix.com FAQ http://www.iiug.org |///// / //| | +-----------------------------------+//// / ///| | Tel: +27 11 807 0313 |If it's slow, the users complain. |/// / ////| | Fax: +27 11 807 2594 |If it's fast, the users keep quiet.|// / /////| |Cell: +27 83 250 2325 |Therefore, "No news: travels fast"!|/ ////////| +----------------------+-----------------------------------+-----------+