agarwalritesh11
New User
Joined: 29 Aug 2007 Posts: 2 Location: bangalore
|
|
|
|
hi all,
i am using following query.
EXEC SQL
DECLARE ACCOUNT_CURS CURSOR FOR
SELECT A.ACCOUNT_NO
,A.BANK_NO
,A.PRODUCT_C
,A.SUBPRODUCT_C
,A.OPEN_DA
,A.DOWNLOAD_DA
,A.OD_DA
,A.OD_LIMIT_A
,A.FOLLOWUP_DA
,A.CLOSE_DA
,A.ACTUAL_CLOSE_DA
,A.END_DA
.
.skipping middle data
.
FROM DQG1.ORB00HQ.ACCOUNT A
LEFT OUTER JOIN
DQG1.ORB00HQ.AGENCY_COLLECTION BA ON
A.BANK_NO = BA.BANK_NO AND
A.ACCOUNT_NO = BA.ACCOUNT_NO AND
A.PRODUCT_C = BA.PRODUCT_C
LEFT OUTER JOIN
DQG1.ORB00HQ.PAYMENT_RCPT DA ON
A.BANK_NO = DA.BANK_NO AND
A.ACCOUNT_NO = DA.ACCOUNT_NO AND
A.PRODUCT_C = DA.PRODUCT_C
LEFT OUTER JOIN
DQG1.ORB00HQ.TRAIN AE ON
A.BANK_NO = AE.BANK_NO AND
A.ACCOUNT_NO = AE.ACCOUNT_NO AND
A.PRODUCT_C = AE.PRODUCT_C
WHERE A.STATUS_C IN ('END', 'ENP')
WITH URI
here primary key is account no....
base table is ACCOUNT table
problem is here some account no are not present in other tables so when it start writing fetch data for other three table tables it gives SAC7 error.
so what i did i compare one the null indicator value from each of these AGENCY_COLLECTION
PAYMENT_RCPT
Turntable = zero then program went fine but it did written a single record for other three tables (AGENCY_COLLECTION
PAYMENT_RCPT
TRAIN)
Can anybody can help me with this |
|