Solved

DB2 delete one table constrained by another run from CL

Posted on 2013-06-26
3
477 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
OPENQUERY not recognizing valid table names 6 397
RPG to c# 3 326
Define external data structure with free d specs in RPG 4 310
AS400 Forms 9 97
November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

708 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now