vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello We are using DB2 server V9.5 for our migration project on HP-UX IA64 platform. My question is: Can we do labeling to a particular transaction?. If so how can we do that?. Basically we want to give label to transaction , so that use this label in other logic. Please let me know whether transaction labeling feature is available or not? Thanks in advance Prakash |
| |||
| Prakash wrote: > Hello > > We are using DB2 server V9.5 for our migration project on HP-UX IA64 > platform. > My question is: > > Can we do labeling to a particular transaction?. If so how can we do > that?. > Basically we want to give label to transaction , so that use this > label in other logic. > > Please let me know whether transaction labeling feature is available > or not? The simple answer is no, but I'm curious as to what problem you're trying to solve. Perhaps there are other means to get to the same spot. Cheers Serge -- Serge Rielau DB2 Solutions Development IBM Toronto Lab |
| ||||
| Prakash wrote: > Hello > > We are using DB2 server V9.5 for our migration project on HP-UX IA64 > platform. > My question is: > > Can we do labeling to a particular transaction?. If so how can we do > that?. > Basically we want to give label to transaction , so that use this > label in other logic. > > Please let me know whether transaction labeling feature is available > or not? Generally, if you need a transaction identifier, you have a problem in your code and a broken design. Period. However, you could do something like the following to generate a unique identifier for each transaction. DROP PROCEDURE getTransactionId@ DROP TABLE session.transaction_id@ CREATE PROCEDURE getTransactionId ( OUT transactionId CHAR(13) FOR BIT DATA ) LANGUAGE SQL BEGIN DECLARE CONTINUE HANDLER FOR SQLSTATE '42710' BEGIN END; DECLARE GLOBAL TEMPORARY TABLE session.transaction_id ( id CHAR(13) FOR BIT DATA NOT NULL ) ON COMMIT DELETE ROWS NOT LOGGED ON ROLLBACK DELETE ROWS; SET transactionId = ( SELECT id FROM session.transaction_id ); IF transactionId IS NULL THEN SET transactionId = GENERATE_UNIQUE(); INSERT INTO session.transaction_id VALUES ( transactionId ); END IF; END@ -- Knut Stolze DB2 z/OS Utilities Development IBM Germany |