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: 1280
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 Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts To know activities on db2 tables ashek15 DB2 4 Fri Mar 03, 2017 11:23 pm


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