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
 

 

DB2 delete row from one table with a reference to a diff tab

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

New User


Joined: 11 Apr 2013
Posts: 1
Location: India

PostPosted: Thu Apr 11, 2013 12:08 pm    Post subject: DB2 delete row from one table with a reference to a diff tab
Reply with quote

Hello,

I have two tables. Details given below:
Code:

EDA0TAA_REL_KEY
-----------------------
Type                Column                  VALUE                       
                     
CHAR(8)          IIPANAM                 EDASTC3
CHAR(20)         IIPARVA                PERIOD
CHAR(80)         NIPARLD                00092
CHAR(7)          IDBSLUP                 I03546A
TIMESTMP         DDBSLUT              2008-11-11-06.43.45.951237


Code:
EDASTC3_SESSION
----------------------------
Type                Column Name          VALUE

CHAR(40)         SECURITY_TOKEN    QUHYIONDL8709977
CHAR(7)          USER_ID                  IN4061
TIMESTMP         CREATE_TIMESTAMP 2011-09-09-17.14.47.671000


My requirement is to :

Delete the records from EDASTC3_SESSION table with a create time stamp older than XX days defined in the EDA0TAA_REL_KEY . ie) DELETE all rows in table EDASTC3_SESSION older than the number of days in table EDA0TAA_REL_KEY .

Here we can take XX as 92 days.

Could anyone please help to write a query to achieve the same?

Thanks

Code'd and subject de-capped
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Thu Apr 11, 2013 1:22 pm    Post subject: Reply to: DB2 delete row from one table with a reference to
Reply with quote

Please don't try to draw attention to your question by using all capitals in the subject. The effect will usually be the opposite of what you want.

Please do use the Code tags and Preview to preserve spacing and ensure your question looks how you want it to before Submit.
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 SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm
This topic is locked: you cannot edit posts or make replies. Sort card to replace text using cross... Susanta SYNCSORT 32 Tue Sep 13, 2016 4:17 pm


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