By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,257 Members | 925 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,257 IT Pros & Developers. It's quick & easy.

Delete/update Sql/400 Stored Procedure Not Working

P: 1
I am successfully able to perform a direct sql/400 (in iseries) call to the delete statement DELETE FROM RDSUFAQA.SAPXFER

but when I make a call to the same sql statement via a stored procedure below, I get a Reason Code 3 error message. The message contains different reasons including file not being journaled. If this is in fact the reason, can I perform the delete/update without the file being journaled ?

THANK YOU IN ADVANCE!

Sample of stored procedure used:

CREATE PROCEDURE pgmlib08.SAPRICET14
LANGUAGE SQL

BEGIN
DELETE FROM RDSUFAQA.SAPXFER;
END

I compile the above sql/400 statement using:

RUNSQLSTM SRCFILE(RDSUFAQA/QSQLSRC) SRCMBR(SAPRICET14) NAMING(*SQL) OUTPUT(*PRINT) DBGVIEW(*STMT)


Either delete or update, I get the following message:

Additional Message Information

Message ID . . . . . . : SQL7008 Severity . . . . . . . : 30
Message type . . . . . : Diagnostic

Message . . . . : SAPXFER in RDSUFAQA not valid for operation.
Cause . . . . . : The reason code is 3. Reason codes are:
1 -- SAPXFER has no members.
2 -- SAPXFER has been saved with storage free.
3 -- SAPXFER not journaled, or no authority to the journal. Files with an
RI constraint action of CASCADE, SET NULL, or SET DEFAULT must be journaled
to the same journal.
4 and 5 -- SAPXFER is in or being created into production library but the
user has debug mode UPDPROD(*NO).
6 -- Schema being created, but user in debug mode with UPDPROD(*NO).
7 -- A based-on table used in creation of a view is not valid. Either the
table is program described table or it is in a temporary schema.
8 -- The based-on table resides in an ASP which is different than the ASP
Sep 2 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.