Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> what is the the best approach for...?

what is the the best approach for...?

From: Giovanni Azua <bravegag_at_hotmail.com>
Date: Wed, 13 Nov 2002 11:57:10 +0100
Message-ID: <aqtb7n$d4bdr$1@ID-114658.news.dfncis.de>


Hello all,

I developed a complete Oracle solution Java Web Application deployed on J2EE with a substantial amount of complementing PL/SQL packages. The problem I am facing now is because of calling a PL/SQL method which achieves a bulking operation of adding customers to a campaign like is shown bellow (both procedures do the same but one getting the source customers from an array of IDs and the other from a filtering WHERE clause statement).

In this case I get an exception when two web users are trying to add the same
customers to the same campaign, of course using any level locking is not desirable
at all but a more flexible alternative, I would specifically like that the FORALL
ignore any duplicated key insertion as will happen in this case and react only by jumping to the next insertion candidate something like the Visual Basic "On Error Resume Next" ;-)

PROCEDURE FOGSP_ADDCAMPAIGNCUSTOMERS (

PROCEDURE FOGSP_ADDCAMPAIGNCUSTOMERS (

pvCUSTOMERSID_VARRAY INT_VARRAY;

BEGIN

  IF pvCUSTOMERSID_VARRAY.COUNT > 0 THEN    FORALL indx IN pvCUSTOMERSID_VARRAY.FIRST .. pvCUSTOMERSID_VARRAY.LAST

      INSERT INTO CAMPAIGN_PERSON
    (SELECT ipCAMPAIGN_ID AS CAMPAIGN_ID, pvCUSTOMERSID_VARRAY(indx) AS PERSON_ID
          , 0 AS FLAG_REACTED, ipUSER_ID AS USER_ID, SYSDATE AS LAST_UPDATE FROM DUAL);
  END IF;
END FOGSP_ADDCAMPAIGNCUSTOMERS; TIA,
Best Regards,
Giovanni Received on Wed Nov 13 2002 - 04:57:10 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US