Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

DB2 delete one table constrained by another run from CL

Posted on 2013-06-26
3
Medium Priority
?
504 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 500 total points
ID: 39278624
0
 
LVL 18

Assisted Solution

by:Dave Ford
Dave Ford earned 500 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

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…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

972 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