Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] DB2 Advice Required -- Row Change Timestamp

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] DB2 Advice Required -- Row Change Timestamp
 Login/Join
 
Virtuoso
posted
I have a unique record extraction requirement where I need to pull records that have changed recently but that don't have an explicit timestamp in the table's fields. I've stumbled across a couple of threads on the Internet that say things on the line of

quote:

if you use DB2 v9 or later, you can use row change timestamp even if you didn't have the timestamp column

SELECT 1 FROM T1 WHERE ROW CHANGE TIMESTAMP FOR TAB t1 > current timestamp - 1 hours;


Is there anyone in WebFOCUS/Data Migrator land that has coded to this kind of concept that can help me with some of the basics? I'd be much obliged.

J.

This message has been edited. Last edited by: <Kathryn Henning>,



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Platinum Member
posted Hide Post
Dear John,
The idea seems very appealing to me, so although I have not used it, I tried to work with it and found out in our DB2 V9.5 it is not working as you suggest.
According to the IBM DB2 manual you indeed do need a timestamp column on the table defined with CREATE/ALTER table defined as GENERATED FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP.
It seems it will become an implicitly hidden column, therefor it seems the table does not have the timestamp, but apparantly it should have been defined in this way to be used in your SELECT statement.

As stated, I did not know about this DB2 feature, and it might be different in other version than our V9.5 (LUW), but this is what I found in the DB2 manual.


WebFocus 8206M, iWay DataMigrator, Windows, DB2 Windows V10.5, MS SQL Server, Azure SQL, Hyperstage, ReportCaster
 
Posts: 168 | Registered: March 29, 2013Report This Post
Virtuoso
posted Hide Post
It looks like DB2 is an MVCC family database, so it's possible that you could get the information you want from something akin to a transaction id for the records. In general, the higher the transaction id the more recent the row.

Whether that helps depends on what you consider "changed" though. Inserted and updated records will be visible to your current transaction (if committed, of course) and you might be able to obtain the id of the transaction they originated from. Deleted (committed) records however won't be visible to your transaction.

I'm not sure this applies to DB2, but it's worth a shot.

You might want to mention what version and flavour of DB2 we're talking about here Wink

Edit: Google says: http://www.ibm.com/developerwo...icle/dm-0505stolze2/


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Guru
posted Hide Post
It appears that DB2 support of ROW CHANGE TIMESTAMP varies with platform (z/OS, Linux, Windows) and release (9.1, 9.2, etc.) so check that the expression works through the native DB2 client.

In the current Release 7.7.05 you can enclose DB2 dialect specific syntax in DB_EXPR(...) or you can create a synonym for an external SQL script and use that as a source.

In any DataMigrator release with a DBMS SQL Flow you can use any valid DB2 SQL expression that returns a result.


N/A
 
Posts: 397 | Location: New York City | Registered: May 03, 2007Report This Post
Virtuoso
posted Hide Post
quote:
DB_EXPR(


I'm on 7.7.04D and that function isn't available to me. It's a nice idea though, looking forward to it someday.

Thanks for the response. I have a similar post on the I-Way forums and maybe someone knows another way to skin the cat.

J.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] DB2 Advice Required -- Row Change Timestamp

Copyright © 1996-2020 Information Builders