473,387 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

DB2 trigger error

I am getting following error for a trigger, please let me know if anyone knows how to fix the problem. Thks in advance for the help.

SQLCODE = -20100, ERROR: AN ERROR OCCURRED WHEN BINDING A TRIGGERED SQL STATEMENT. INFORMATION RETURNED: SECTION
NUMBER : 2 SQLCODE -104, SQLSTATE 42601, AND MESSAGE TOKENS -,TABLE STATEMENT , . SCROLL INSENSITIVE SENSITIVE
ASENSITIVE NO

--#SET TERMINATOR ~

CREATE TRIGGER CWSRCAL0
AFTER INSERT ON CLAIM_TRANSACTION
REFERENCING NEW AS N
FOR EACH ROW MODE DB2SQL
WHEN (N.CTX_TRS_TYPE_CD < 90)
BEGIN ATOMIC
DECLARE WS-COUNT INTEGER;
SET WS-COUNT =
(SELECT COUNT (*)
FROM CLAIM_SUPPORT_1_V1 CS01_COV_DESC
WHERE CS01_COV_DESC.CS01_TABLE_ID = 'C280'
AND CS01_COV_DESC.CS01_CODE =
(SELECT COVDESC.CCP_COV_MOD_CD
FROM CLM_COV_PKG_V1 COVDESC
WHERE COVDESC.CCP_CLAIM_NBR = N.CTX_CLAIM_NBR
AND COVDESC.CCP_PKG_TYPE_CD = N.CTX_COV_TYPE_CD));
IF WS-COUNT = 0 THEN
INSERT INTO CLM_ACTIVITY_LOG_V
(CAL_CLAIM_NBR
,CAL_ACY_TYPE_CD
,CAL_SORT_TS
,CAL_OBJECT_ID
,CAL_ORT_CLT_ID
,CAL_ACTIVITY_DES
,CAL_ACTIVITY_AMT
,CAL_CLN_CLT_ID)
SELECT
N.CTX_CLAIM_NBR
,'CTX'
,N.CTX_SORT_TS
,CLAIM.CLM_CSR_CLAIM_NBR
,ORIGINATOR.SEC_USR_CLT_ID
,RTRIM(CHAR(( 'Added ' ||
RTRIM(CS01_FIN_TYPE.CS01_CODE_DES )||' '||
RTRIM(CS01_TRANS_TYPE.CS01_CODE_DES ) ||' '||
RTRIM(CS01_COVERAGE_TYPE.CS01_CODE_DES ) ), 100))
,N.CTX_TRS_AMT
,N.CTX_CLIENT_ID
FROM
CLAIM_TAB_V1 CLAIM
,SEC_USRS_V ORIGINATOR
,CLAIM_SUPPORT_1_V1 CS01_COVERAGE_TYPE
,CLAIM_SUPPORT_1_V1 CS01_FIN_TYPE
,CLAIM_SUPPORT_1_V1 CS01_TRANS_TYPE
WHERE
(N.CTX_CLAIM_NBR = CLAIM.CLM_CLAIM_NBR)
AND (N.CTX_COV_TYPE_CD = CS01_COVERAGE_TYPE.CS01_CODE
AND CS01_COVERAGE_TYPE.CS01_TABLE_ID IN ('C039','C169'))
AND (N.CTX_FIN_TYPE_CD = CS01_FIN_TYPE.CS01_CODE
AND CS01_FIN_TYPE.CS01_TABLE_ID='C046')
AND (N.CTX_TRS_TYPE_CD = INTEGER(CS01_TRANS_TYPE.CS01_CODE)
AND CS01_TRANS_TYPE.CS01_TABLE_ID='C044')
AND (N.CTX_ENTRY_OPR_ID = ORIGINATOR.SEC_USR_ID);
ELSE
INSERT INTO CLM_ACTIVITY_LOG_V
(CAL_CLAIM_NBR
,CAL_ACY_TYPE_CD
,CAL_SORT_TS
,CAL_OBJECT_ID
,CAL_ORT_CLT_ID
,CAL_ACTIVITY_DES
,CAL_ACTIVITY_AMT
,CAL_CLN_CLT_ID)
SELECT
N.CTX_CLAIM_NBR
,'CTX'
,N.CTX_SORT_TS
,CLAIM.CLM_CSR_CLAIM_NBR
,ORIGINATOR.SEC_USR_CLT_ID
,RTRIM(CHAR(( 'Added ' ||
RTRIM(CS01_FIN_TYPE.CS01_CODE_DES )||' '||
RTRIM(CS01_TRANS_TYPE.CS01_CODE_DES ) ||' '||
RTRIM(CS01_COVERAGE_TYPE.CS01_CODE_DES ) ||' '||
RTRIM(CS01_COV_DESC.CS01_CODE_DES ) ), 100))
,N.CTX_TRS_AMT
,N.CTX_CLIENT_ID
FROM
CLAIM_TAB_V1 CLAIM
,SEC_USRS_V ORIGINATOR
,CLAIM_SUPPORT_1_V1 CS01_COVERAGE_TYPE
,CLAIM_SUPPORT_1_V1 CS01_FIN_TYPE
,CLAIM_SUPPORT_1_V1 CS01_TRANS_TYPE
,CLAIM_SUPPORT_1_V1 CS01_COV_DESC
WHERE
(N.CTX_CLAIM_NBR = CLAIM.CLM_CLAIM_NBR)
AND (N.CTX_COV_TYPE_CD = CS01_COVERAGE_TYPE.CS01_CODE
AND CS01_COVERAGE_TYPE.CS01_TABLE_ID IN ('C039','C169'))
AND (N.CTX_FIN_TYPE_CD = CS01_FIN_TYPE.CS01_CODE
AND CS01_FIN_TYPE.CS01_TABLE_ID='C046')
AND (N.CTX_TRS_TYPE_CD = INTEGER(CS01_TRANS_TYPE.CS01_CODE)
AND CS01_TRANS_TYPE.CS01_TABLE_ID='C044')
AND (N.CTX_ENTRY_OPR_ID = ORIGINATOR.SEC_USR_ID)
AND (CS01_COV_DESC.CS01_TABLE_ID ='C280'
AND CS01_COV_DESC.CS01_CODE =
(SELECT COVDESC.CCP_COV_MOD_CD
FROM CLM_COV_PKG_V1 COVDESC
WHERE COVDESC.CCP_CLAIM_NBR = CLAIM.CLM_CLAIM_NBR
AND COVDESC.CCP_PKG_TYPE_CD = N.CTX_COV_TYPE_CD));
END-IF;
END

~

--#SET TERMINATOR ;

COMMIT ;

Dec 22 '09 #1
1 2835
Hello Amijai,

you dont have properly set the terminator for the statement ...

you can run it with
db2 -td terminator

and put the terminator after each section which needs to be run before continuing ...
Jan 13 '10 #2

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

Similar topics

3
by: Michael Teja via SQLMonster.com | last post by:
I made a trigger for delete just like this. " CREATE TRIGGER ON . FOR DELETE AS Declare @severity int, @IdNmbr nvarchar(10) Set @Severity = 0
1
by: Jen S | last post by:
I feel like I'm missing something obvious here, but I'm stumped... I have a stored procedure with code that looks like: INSERT INTO MyTableA ( ...fields... ) VALUES (...values...) IF...
0
by: Dave Sisk | last post by:
I've created a system or external trigger on an AS/400 file a.k.a DB2 table. (Note this is an external trigger defined with the ADDPFTRG CL command, not a SQL trigger defined with the CREATE...
4
by: Alexander Pope | last post by:
I am using db2 udb v8.2 AIX I have created trigger, however I am not confident it meets industry standards. If I make it fail, I cant tell from the message where it is failing. what can I add to...
12
by: Bob Stearns | last post by:
I am trying to create a duplicate prevention trigger: CREATE TRIGGER is3.ard_u_unique BEFORE UPDATE OF act_recov_date ON is3.flushes REFERENCING NEW AS N FOR EACH ROW MODE DB2SQL WHEN...
5
by: Bob Stearns | last post by:
I have two (actually many) dates in a table I want to validate on insertion. The following works in the case of only one WHEN clause but fails with two (or more), with the (improper?...
3
by: ChrisN | last post by:
Hello all, I have a quick question. I'm using a C# object to commit new rows to a database. In the database I have an INSERT Trigger watching values come in. If the record to be committed...
2
by: Juan Jose Costello Levien | last post by:
Hello, I am trying to use a trigger function I wrote in C. Basically what I want to do is to audit a table when a row is inserted into another table by copying the row to the new table. It...
5
by: Bruno Rafael Moreira de Barros | last post by:
function test1() { trigger_error('My error'); } application.php //code... test1(); //code...
11
by: tracy | last post by:
Hi, I really need help. I run this script and error message appeal as below: drop trigger log_errors_trig; drop trigger log_errors_trig ERROR at line 1: ORA04080: trigger 'LOG_ERRORS-TRIG'...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.