473,405 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

ROWID Equivalent

OK. I have a problem and need some help from DB2 Gurus. In ORACLE, I
have a trigger which fires on an update event, sending the ROWID and
TRANSACTION_ID via a pipe to my application. The application can then
issue SQL to read the row that was updated (directly accessing it by
ROWID) and confirm that the transaction has committed before taking
this information by looking at open transactions.

QUESTIONS:

1) Is there ANY concept of ROWID in DB2 that is accessible to the
program?
2) Is there any concept of transaction_id accessible to the program?
3) What is the best equivalent of dbms_pipes in DB2? Is it to send
via MQSeries? Is this transactionally controlled so I would not need
transaction_id?

Thanks in advance!
Nov 12 '05 #1
2 9570
Scott Holland wrote:
OK. I have a problem and need some help from DB2 Gurus. In ORACLE, I
have a trigger which fires on an update event, sending the ROWID and
TRANSACTION_ID via a pipe to my application. The application can then
issue SQL to read the row that was updated (directly accessing it by
ROWID) and confirm that the transaction has committed before taking
this information by looking at open transactions.

QUESTIONS:

1) Is there ANY concept of ROWID in DB2 that is accessible to the
program? Not in DB2 UDB for LUW. That's what primary keys are for. Given that you
just accessed the row it should be in the bufferpool (i.e. cheap to get
the second time) 2) Is there any concept of transaction_id accessible to the program? No 3) What is the best equivalent of dbms_pipes in DB2? Is it to send
via MQSeries? I don't knwo what DBMS pipes are, but I suppose you could either
implement a pipe through a C-UDF or use MQ Series.Is this transactionally controlled so I would not need transaction_id?

Not sure with MQ Series. Should be described in the SQL Ref though.

You got some weird logic there. What's the purpose of these acrobatics?
Maybe there is another way to do the same thing...
E.g. Note that the second application would not be able to read the row
until the triggering app has commited unless you use dirty reads.
So your app should naturally wait for the transaction to clear.

Cheers
Serge
Nov 12 '05 #2
Scott,
fyi:
- Doesn't solve your problem directly, but maybe some food for
thought.

The performance/overhead of this is USELESS if you are doing high
transaction rates!!

we use it just to be able to keep track of clp transactions (normally
txn_ids
are supplied from the app. server via one of the special client
registers).

We used the appl_id and sequence monitor elements to identify
transaction boundaries.

i.e if 2 statements occured in the same transaction we wanted to know
that
in the trigger. The mechanism we used was
SET (v_appl_id, v_sequence_no) = (SELECT appl_id,sequence_no
FROM TABLE (SNAPSHOT_APPL_INFO('DBNAME',CAST(NULL AS
INTEGER))) t
WHERE t.appl_id = dba.application_id());

- where dba.application_id() is a function from developer works.

In this way you can keep a seperate 'transaction table' where you can
easily apply a surrogate txn id to all statements in the same
transaction.

How you get this back to the app. is another problem which I have no
input on.

Paul.
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: droope | last post by:
I am trying to retrieve the rowid from a datatable without any success. When in the immediate window I can look at the rowid value, ex: ?DataSetName.Tables(0).Rows.Find(SearchValues).RowId ...
4
by: Corrine | last post by:
Hi, I am creating a global temporary table that is session-specific. I insert a BLOB into this table, and then select the BLOB from this table into a ResultSet. The ResultSet sees this BLOB...
2
by: tracy | last post by:
when i run the statement: SQL> select rowid from student_semester; ERROR at line 1: ORA-01445: cannot select ROWID from a join view without a key-preserved table student_semester is a view...
2
by: captain | last post by:
hi, Want to count rowid. One row by one row and on each do a calculation and than go to next or previous row. In oracle it is Rowid, wonder how to do in SAS for going by row. e.g. in Oracle...
1
by: Tenkre | last post by:
Hello! 1. How can I know exactlly what row is locked? Is data in "resource" column of sp_lock usable? For example, resource = 03000d8f0ecc 51 14 0 0 DB S GRANT...
3
by: TP | last post by:
Can someone please explain or provide examples of how to use ROWID in DB2 on Z/OS. I am using v7.1.1. Here is the table I created with the ROWID column. CREATE TABLE XXX.EMP_PHOTO_RESUME1 ...
0
by: UJ | last post by:
I have a datatable that I want to display the first 10 records, then display the next 10 records, and so forth. I'm storing the dataset in a session variable because as the user makes changes, they...
2
by: arivudai2 | last post by:
Hello, I am doing a migration of db from informix to db2.In informix there is a query with rowid.The same query with rowid is not working for DB2.Can anyone help me in this regard. for Ex. ...
0
by: kaapie | last post by:
Oracle does not know which table's rowid to return from this view and thus it gives an error. What this means is that one of the underlying tables in the view has to have either a primary key or...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.