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
 

 

Delete records by joining one or more tables

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

New User


Joined: 21 Dec 2007
Posts: 88
Location: My Desk

PostPosted: Fri Oct 09, 2009 4:47 pm    Post subject: Delete records by joining one or more tables
Reply with quote

Hi,

can the records from tables be deleted by joining them... but i got error while trying it in QMF....

can anyone advice is it a possibility.... i thought of another way like declaring the join as cursor , open the cursor and delete current of cursor...

but my environment is not allowing me to execute such try....
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: Fri Oct 09, 2009 10:12 pm    Post subject:
Reply with quote

Hello,

Quote:
can the records from tables be deleted by joining them...
Probably not, but that depends on exactly what you want to do.

Suggest you rethink your question. . . Keep in mind that your questin is completely clear to you, but it may not be clear to those who read it and would like to help.

If you show some rows from the 2(?) tables and what you want as the result of running your query, someone may have a suggestion.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Oct 09, 2009 11:27 pm    Post subject:
Reply with quote

Quote:
but i got error while trying it in QMF


had you looked up the sqlcode or spent 3 minutes in a db2 manual you would learned that join cursors are read only.

can't update a join. (a delete is an update).
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1278
Location: Belgium

PostPosted: Mon Oct 12, 2009 6:06 pm    Post subject:
Reply with quote

Probably you can code the requirement in a delete statement, but you're asking the wrong question.
It 's like asking : "Can i saw a board in two with a screwdriver?"

probably need something like WHERE EXISTS.
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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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