call myStoredProcedure('update dummyTbl set columnA = 1 where columnB = ''Jia'' ')
The error message says that
Message: [SQL7008] dummyTbl in schemaA not valid for operation. Cause . . . . . : The reason code is 3. Reason codes are: 1 -- dummyTbl has no members. 2 -- dummyTbl has been saved with storage free. 3 -- dummyTbl not journaled, no authority to the journal, or the journal state is *STANDBY. Files with an RI constraint action of CASCADE, SET NULL, or SET DEFAULT must be journaled to the same journal.The interesting thing is that I get error free when I run the same SQL query in System i Navigator.
After doing research, I found that, on IBM i DB2, a table is journaled by default if it is created with SQL statement in i Navigator. On the other hand, the table is not journaled by default when it is created under green screen. And the walking around is adding the following statement in the stored procedure before executing the input string that is actually sql statement,
SET TRANSACTION ISOLATION LEVEL NO COMMIT
This could only be temporary walking around solution. To be serious, it is better to review tables setting about journaling and isolation level. However, for an existing complex database system, this walking around might be a good choice too.
No comments:
Post a Comment