View previous topic :: View next topic
|
Author |
Message |
PrabakarV
New User
Joined: 21 Dec 2007 Posts: 88 Location: My Desk
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
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 |
|
|
|