Solved

DB2 delete one table constrained by another run from CL

Posted on 2013-06-26
3
495 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 37

Accepted Solution

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

Assisted Solution

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

752 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