Solved

DB2 delete one table constrained by another run from CL

Posted on 2013-06-26
3
487 Views
Last Modified: 2013-06-27
I have a simple delete query with a subselect

Delete from Table1 T1 where F1 in (Select F2 from Table2 T2 where T1.F1 = T2.F2 and T2.F3 =  'constantvalue')

I have done this many times and interactively it works fine, but when I try to execute the sql from a CL with RUNSQLSTM SRCFILE(XX/YY) SRCMBF(ZZZZ) it fails to run with the following error:

SQL7008 Position 1 Table1 in XX not valid for operation

I know that uncorrelated sub-selects can cause issues when running from a CL but that is not the case here, any suggestions?
0
Comment
Question by:RSchnabel
3 Comments
 
LVL 37

Accepted Solution

by:
momi_sabag earned 125 total points
ID: 39278624
0
 
LVL 18

Assisted Solution

by:daveslash
daveslash earned 125 total points
ID: 39278696
I experience this error message if I'm doing an INSERT, UPDATE, or DELETE on a non-journaled file while running under some level of commitment-control except *NONE.

Either start journaling on the file (which would be the better option), or specify *NONE on the "commitment control" parameter of RunSQLStm.

HTH,
DaveSlash
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question