Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DUP_VAL_ON_INDEX : how to give parameters

537163Oct 12 2011 — edited Oct 12 2011
Hi

i want to indicate the key that gives me the DUP_VAL_ON_INDEX exception but my query contains a subselect within th from clause

BEGIN
insert into SYSADM.PS_BGL_VISIT_ACTVT_LOB
(select
BGL_VISIT_ACTVT_ID
, BGL_VST_ID
from SYSADM.PS_BGL_VISIT_ACTVT PBVA
WHERE PBVA.ROW_ADDED_DTTM >= TO_DATE(vLASTRUN, 'YYYYMMDD')
AND PBVA.ROW_ADDED_DTTM <= TO_DATE(vCURRENTRUN, 'YYYYMMDD')
);

COMMIT;
EXCEPTION
WHEN DUP_VAL_ON_INDEX THEN
vComment := 'Error Duplicate Key. BGL_VST_ID: ' || BGL_VST_ID || '|BGL_VISIT_ACTVT_ID: '|| BGL_VISIT_ACTVT_ID;

END;

How can i give those 2 values ?

thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 9 2011
Added on Oct 12 2011
5 comments
354 views