473,614 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 9613
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,sequenc e_no
FROM TABLE (SNAPSHOT_APPL_ INFO('DBNAME',C AST(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
2691
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 When I try to assign the value to a variable declared as integer I get the following error.
4
13706
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 object, and I am able to get the binary input stream from this blob. However, when I invoke InputStream.read(byte) on this input stream, I get the following exception: java.io.IOException: ORA-01410: invalid ROWID
2
16405
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 with the sql : CREATE OR REPLACE VIEW "ICEM_USER"."STUDENT_SEMESTER" ("STUD_ID", "SEMESTER_STATUS_ID","SEMESTER_STATUS_YEAR", "SEMESTER_STATUS_SEMESTER","SEMESTER_STATUS_PROGRAM",
2
11282
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 Select * from table1 where rowid > rowid+1
1
3861
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 51 14 277576027 1 KEY (03000d8f0ecc) X GRANT 51 14 277576027 1 PAG 1:1112
3
10164
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 (EMPNO CHAR(6) NOT NULL, EMP_ROWID ROWID NOT NULL GENERATED ALWAYS, EMPNAME CHAR(10), PRIMARY KEY(EMPNO)) ; What I really want to know is can this ROWID be used to generate pagination of the kind you see in search engine results....
0
1182
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 don't want them saved until they press the save button. Which means I need to initially load the datatable getting rows 1-10 from the db and display those. Works fine. When the user goes to the next set, I need to have the first set somewhere...
2
7870
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. In Informix, select rowid from tablename or select * from tablename where rowid = 225
0
3258
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 a unique index that will ensure the result is unique. The result of the query does not have to contain the key of the table but must act as though the key was used....
0
8198
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8142
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8642
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8591
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8294
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7115
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6093
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4138
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.