|
-
you would write the exception similar to what I gave in the example. with your code it would look something like this
Pro*C compilers come with the Oracle installation I believe, unless they weren't installed by whoever did it. Check around and see if they're available, you'll also need to learn how to write it. If you're not familiar with C to begin, let alone the SQL aspects with it might be a lot more development time than it's worth.
However it would be a nice learning experience :)
<font face="courier">
for c1rec in c1 loop
-- altered code under here, notice no select or if statement
-- make sure to keep the original file before making changes
-- this is off the top of my head so try to understand what it's doing,
-- then figure out if it's correct, or make changes if you need
BEGIN
INSERT INTO acct_static_details
VALUES
(c1rec.ACCT_ID
,c1rec.ACCT_STA_TYP
,c1rec.PTY_ID
,c1rec.PTY_STA_TYP
,c1rec.ACCT_NO
,c1rec.BNK_NM
,c1rec.ACCT_NM
,c1rec.BR_COD
,c1rec.BRN_NM
,c1rec.CLNT_ID
,c1rec.CLNT_ENT_NM
,c1rec.AP1_ACCT_FAM_NAM
,c1rec.AP2_ACCT_FAM_NAM
,c1rec.LGL_NAM
,c1rec.CUST_REF_ID
,c1rec.CUST_BAS_NO
,c1rec.GFCID
,c1rec.BR_TAX_ID
,c1rec.ACCT_CCY
,c1rec.ENTPRISE_DES
,c1rec.LAST_STMT_DT
,c1rec.ACCT_TYP
,c1rec.DR_IND_PRN
,c1rec.BRN_ID
,c1rec.GFCID_ID
,c1rec.CUST_BAS_NO_ID
,c1rec.AP_PTY_ID
,c1rec.AP_ACCT_ID
,c1rec.AP_PTY_STA_TYP
,c1rec.AP_PTY_ROLE_TYP
,c1rec.AP_ACCT_STA_TYP
,c1rec.AP_ACCT_PTY_STA_TYP ) ;
EXCEPTION
WHEN OTHERS THEN
INSERT INTO acct_static_details_exceptions
VALUES
(c1rec.ACCT_ID
,c1rec.ACCT_STA_TYP
,c1rec.PTY_ID
,c1rec.PTY_STA_TYP
,c1rec.ACCT_NO
,c1rec.BNK_NM
,c1rec.ACCT_NM
,c1rec.BR_COD
,c1rec.BRN_NM
,c1rec.CLNT_ID
,c1rec.CLNT_ENT_NM
,c1rec.AP1_ACCT_FAM_NAM
,c1rec.AP2_ACCT_FAM_NAM
,c1rec.LGL_NAM
,c1rec.CUST_REF_ID
,c1rec.CUST_BAS_NO
,c1rec.GFCID
,c1rec.BR_TAX_ID
,c1rec.ACCT_CCY
,c1rec.ENTPRISE_DES
,c1rec.LAST_STMT_DT
,c1rec.ACCT_TYP
,c1rec.DR_IND_PRN
,c1rec.BRN_ID
,c1rec.GFCID_ID
,c1rec.CUST_BAS_NO_ID
,c1rec.AP_PTY_ID
,c1rec.AP_ACCT_ID
,c1rec.AP_PTY_STA_TYP
,c1rec.AP_PTY_ROLE_TYP
,c1rec.AP_ACCT_STA_TYP
,c1rec.AP_ACCT_PTY_STA_TYP
,current_dt) ;
END;
end loop;
commit;
</font>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|