Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to identify which columns are getting update in DB2 ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
ankvardhan

New User


Joined: 05 Sep 2008
Posts: 14
Location: Mumbai

PostPosted: Tue Jun 22, 2010 5:07 pm    Post subject: How to identify which columns are getting update in DB2 ?
Reply with quote

Hi,

As per my requirement, i want to know in there is any alternative way to identify the Columns which are getting update in DB2 Tables?

Excluding the following ways to identify:
1) Search String using: Opt ISPF 3.14
2) Looking into the component (Source code) and check whether there are any Insert, Update, or Cursor with Update Option query.
3) Referential Integrity/Cascade

I am looking is there is any utility which can generate the report for the specific Column which is getting updated in DB2 table by some specific Transactions...?

Thanks in Advance
Ank
Back to top
View user's profile Send private message

GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1280
Location: Belgium

PostPosted: Tue Jun 22, 2010 7:11 pm    Post subject:
Reply with quote

You can parse the info in SYSPACKSTMT, which is a PITA (and I don't mean "Flat bread of Mediterranean origin")

or

IF everything is explained in DB2 v8 or DB2 9 :
You can find the updated columns with this fancy query (DB2 9 only):

Code:
select
  xmlquery('$c/UPDATE/TAB-REF[1]/text()' passing xmlparse(a.node_data) as "c") as Tablename
, x.col
, p.progname
, p.version

from explowner.dsn_query_table a
   , xmltable('$c/UPDATE/SET/ASSIGN/COLUMN[1]' passing xmlparse(a.node_data) as "c"
          columns tno char(3)        path '@TNO'
                , col varchar(100) path './text()') as x
   , table (select * from explowner.plan_table pl where pl.queryno = a.queryno and pl.bind_time = a.explain_time
fetch first 1 row only) p
where a.type = 'UPDATE'
and a.query_stage = 'BEFORE'
--and xmlexists('$c/UPDATE[TAB-REF[1]="tbcreator.tbname"]' passing xmlparse(a.node_data) as "c")


You'll have to learn some XML, but you could do something similar for Insert ,update where current
Back to top
View user's profile Send private message
ankvardhan

New User


Joined: 05 Sep 2008
Posts: 14
Location: Mumbai

PostPosted: Wed Jun 23, 2010 1:52 pm    Post subject: Reply to: How to identify which columns are getting update i
Reply with quote

Hi,
Thanks for the response....!!

But still this wont work ...as per my requirement...!!
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Jun 23, 2010 7:10 pm    Post subject:
Reply with quote

Hello,

Quote:
But still this wont work ...as per my requirement...!!

If this will not work, you need to explain why. . . And more clearly explain the "requirement".
Back to top
View user's profile Send private message
ankvardhan

New User


Joined: 05 Sep 2008
Posts: 14
Location: Mumbai

PostPosted: Thu Jun 24, 2010 12:53 pm    Post subject: But still this wont work ...as per my requirement...!!
Reply with quote

Hi,

As we can identify the particular clumns in table which are getting updated by transactions.

Now lets say there are 10 components which are updating 5 coulumns of some table say X.Employee_Tbl.... Now i need to identify the names of those particular 10 components which are doing an updation(this updation may be insert/delete). .........!!

Is it possible from the following approaches that I mentioned earlier, is any alternative way to find the same....!! as looking into the components and then check the SQL's ...is quiet a time taken process....!!

Hope this gives u a clear idea..?

Ank
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us