IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Delete records by joining one or more tables


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Fri Oct 09, 2009 10:12 pm
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
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: 1281
Location: Belgium

PostPosted: Mon Oct 12, 2009 6:06 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts DELETE SPUFI DB2 1
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top