Why is the below given block giving an exception

DECLARE
TYPE typ_tab_oid IS TABLE OF ncs_domain.sco_item_results.OID%TYPE;
v_tab typ_tab_oid;
CURSOR cur_oid
IS
SELECT OID
FROM ncs_domain.sco_item_results sir
WHERE sir.is_total = 'Y';
v_error_code NUMBER (10);
v_error_messg VARCHAR2 (4000);
BEGIN
BEGIN
OPEN cur_oid;
LOOP
FETCH cur_oid
BULK COLLECT INTO v_tab LIMIT 1000;
EXECUTE IMMEDIATE 'explain plan into ncs_domain.my_plan_table for FETCH cur_oid
BULK COLLECT INTO v_tab LIMIT 1000';
FORALL i IN 1 .. v_tab.COUNT
DELETE FROM ncs_domain.sco_item_results_bkp sir
WHERE sir.OID = v_tab (i);
EXECUTE IMMEDIATE 'explain plan into ncs_domain.my_plan_table for DELETE FROM ncs_domain.sco_item_results_bkp sir
WHERE sir.OID = v_tab (i)';
COMMIT;
EXIT WHEN cur_oid%NOTFOUND;
END LOOP;
CLOSE cur_oid;
EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;
v_error_code := SQLCODE;
v_error_messg := SQLERRM;
INSERT INTO ncs_domain.my_error_log
VALUES (v_error_code, v_error_messg);
COMMIT;
raise_application_error (-20001,
v_error_code || ' ' || v_error_messg
END;
EXCEPTION
WHEN OTHERS
THEN
raise_application_error (-20002, 'can not insert into error log table');
END;
Edited by: user8731258 on Dec 3, 2009 9:26 PM

You still seem to be missing the \ tag before and after your code, which makes it a bit difficult.
A FORALL loop can only run a single statement.
[code]
FORALL i IN 1 .. v_tab.COUNT
  DELETE FROM ncs_domain.sco_item_results_bkp sir
   WHERE sir.OID = v_tab (i);
[/code]
is the extent of the FORALL.  Outside of the FORALL, the variable i is undefined-- that counter only exists in the FORALL so you can't use it in subsequent statements.
You could change the FORALL to a regular FOR loop (in which case you'd lose the bulk bind benefits) so that the loop counter is visible to more of your code
[code]
FOR i IN 1 .. v_tab.COUNT
LOOP
  DELETE FROM ncs_domain.sco_item_results_bkp sir
   WHERE sir.OID = v_tab (i);
  v_plan :='explain plan into ncs_domain.my_plan_table for DELETE FROM ncs_domain.sco_item_results_bkp sir'---line 33
      ||'WHERE sir.OID ='||v_tab (i);
  EXECUTE IMMEDIATE v_plan;
END LOOP;
[/code]
Justin                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Every time I launch the browser the popup blocker option is unchecked. Why does the pop up blocker keep getting unchecked every time browser is launched?

    Every time I launch the browser the popup blocker option is unchecked. Why does the pop up blocker keep getting unchecked every time browser is launched?

    Your above posted system details show outdated plugin(s) with known security and stability risks.
    *Java Plug-in 1.6.0_05 for Netscape Navigator (DLL Helper)
    Update the [[Java]] plugin to the latest version.
    *http://java.sun.com/javase/downloads/index.jsp (Java Platform: Download JRE)

  • Why does the pop up blocker bar not always give you the option to view a blocked pop up?

    Usually when Firefox notifies you that a pop up has been blocked it gives you the option to view the blocked pop up. However, sometimes that option is not there. Typically this isn't a problem at all but once in a while there will be a pop up that I wish to view but there is no option to view it. Does anyone know why the pop up blocker will sometimes give you the fourth option to "Show 'www.blockedwebsite.com'" and sometimes will only give you the three options of "Allow pop-ups for the site", "Edit Pop-Up Blocker Options", and "Don't show this message when pop-ups are blocked"? How can I view a blocked pop-up when it only provides the first three options and not the fourth option to view it? I hope my question was clear enough. Thanks in advance!

    It is possible that you run into this maximum (the default value is 20):
    * http://kb.mozillazine.org/dom.popup_maximum
    To open the <i>about:config</i> page, type <b>about:config</b> in the location (address) bar and press the "<i>Enter</i>" key, just like you type the url of a website to open a website.<br />
    If you see a warning then you can confirm that you want to access that page.<br />
    *Use the Filter bar at to top of the about:config page to locate a preference more easily.
    *Preferences that have been modified show as bold(user set).
    *Preferences can be reset to the default or changed via the right-click context menu.

  • Why is the below IMAP code failing?

    Hi,
    Can any one point me whats wrong in the below code? It always gives no message found devoid of pressence of messages.
        mailStore.connect(username, password);
        inbox = mailStore.getFolder("inbox");
        inbox.open(Folder.READ_WRITE);
        IMAPFolder imapInbox = (IMAPFolder)inbox;
        Flags flg = new Flags(Flags.Flag.RECENT);
        SearchTerm newMess = new FlagTerm(flg, true);
        System.out.println(imapInbox.getMessageCount());
        Message[] mails = imapInbox.search(newMess);
        if(mails.length == 0) {
          System.out.println("No Messages Found");
        } else {
          System.out.println(mails.length + "Mails found");
        }Thanks,
    Harish Srinivasan

    Again, see the debugging section of the FAQ. The protocol trace will be very helpful.

  • (found ipad)why is the email adress blocked out?

    roaming the streets find a ipad mini  turn it on. its been reformated. so i try to start it up and of course the activation lock comes on. the phone number is in japan (dont speak japanese not gonna call) want to email the guy/girl cause at least i can ask a professor to write the email but the freaking email is blocked out. *** man. why block out the email.
    any ideas on what to do.

    Goceman86 wrote:
    Love how i dont get any answer from apple
    This is a user - user forum, no one in the forum works for Apple.
    Hand the iPad you found into your nearest police station.

  • Why Is The Caller Not Blocked Even If It Is In The BlockList? Is It A Bug In The Software? iPhone is updated to 7.0.2

    ???

    We block the HTC Desire on the Play Store due to poor performance on the device. If you would like to use Firefox anyways you can install the Aurora update channel of Firefox from https://www.mozilla.org/en-US/firefox/channel/#aurora

  • Why cannot the below code find cookie?

    Hi,
    Please see the following code in the aspx.cs file:
    public bool IsShow()
    try
    string strAppFloatCnt = string.Empty;
    if (System.Web.HttpContext.Current.Request.Cookies["appFloatCnt"] != null)
    strAppFloatCnt = System.Web.HttpContext.Current.Request.Cookies["appFloatCnt"].Value;
    int appFloatCnt = 0;
    if (!string.IsNullOrEmpty(strAppFloatCnt))
    appFloatCnt = Convert.ToInt32(strAppFloatCnt);
    DateTime expires = DateTime.Now.AddDays(60);
    if (appFloatCnt < 5)
    if (System.Web.HttpContext.Current.Request.Cookies["appFloatCnt"] == null)
    HttpCookie cookie = new HttpCookie("appFloatCnt");
    cookie.Value = (appFloatCnt + 1).ToString();
    cookie.Expires = expires;
    System.Web.HttpContext.Current.Response.Cookies.Add(cookie);
    else
    System.Web.HttpContext.Current.Response.Cookies["appFloatCnt"].Value = (appFloatCnt + 1).ToString();
    System.Web.HttpContext.Current.Response.Cookies["appFloatCnt"].Expires = expires;
    return true;
    else { return false; }
    catch (System.Exception ex)
    return false;
    And then I called this method in the aspx file like the following way:
    <input type="hidden" id="hiddenIsShowAppFloat" value="<%=IsShow()%>" />
    Each time I refresh this page in Google Chrome, System.Web.HttpContext.Current.Request.Cookies["appFloatCnt"] always return NULL. Why?
    Where should I edit the above code so that System.Web.HttpContext.Current.Request.Cookies["appFloatCnt"] can return the correct value instead of always NULL?
    (I am using VS 2012. Operating system is Windows 7 Professional.)
    Please help to sort out this problem. Thank you.
    QQ

    Please use the ASP.NET forums for ASP.NET related questions:
    http://forums.asp.net

  • Why is the clause marked red giving error - unexpected end of sql statement

    INSERT INTO APP_PUBLICATION
    (DESCRIPTION1,
    NU,
    NT,
    CANADA)
         SELECT
    DISTINCT(APP_NPS_GROUP_DESC),
                             (select 0 from ape_summary_a where app_nps_group_desc = a.app_nps_group_desc and province_code != 'B'),
                             (select 0 from ape_summary_a where app_nps_group_desc = a.app_nps_group_desc and province_code != 'B'),                         (select 0 from ape_summary_a where app_nps_group_desc = a.app_nps_group_desc and province_code IN('B')
                        FROM ape_summary_a a ;

    I believe you are missing a parenthesis from the last select statement
    INSERT INTO APP_PUBLICATION
    (DESCRIPTION1,
    NU,
    NT,
    CANADA)
    SELECT
    DISTINCT(APP_NPS_GROUP_DESC),
    (select 0 from ape_summary_a where app_nps_group_desc = a.app_nps_group_desc and province_code != 'B'),
    (select 0 from ape_summary_a where app_nps_group_desc = a.app_nps_group_desc and province_code != 'B'), (select 0 from ape_summary_a where app_nps_group_desc = a.app_nps_group_desc and province_code IN('B') )
    FROM ape_summary_a a ;
    Shakti
    http://www.impact-sol.com
    Developers of Guggi Oracle - Tool for DBAs and Developers

  • Why does the isight signal block the imovie signal?

    I am using iMovie 6.0.3, OS X 10.4.8 and a MacBook Pro.
    I want to import video from a camcorder through a firewire.
    The image on the screen is my isight image.
    When I turn on the camcorder, imovie locks up (spinning color wheel), or the isight image stays in the window.
    I cannot find any way in the prefs box to tell the mac to take the camcorder signal instead of the isight signal.
    How can I switch from the isight signal to the camcorder signal?
    MacBook pro Mac OS X (10.4.8)
    MacBook pro   Mac OS X (10.4.8)  

    Hi mediacy:
    Welcome to discussions.
    This from Apple:
    http://docs.info.apple.com/article.html?artnum=302503
    Turning off your built-in iSight camera
    To turn off the built-in iSight camera, just close
    the active iChat window. The green LED next to the
    camera will go dark, indicating that the built-in
    iSight camera is off and no longer capturing video.
    Does that help?
    Sue
    iChat was never on, so i could not close the window.
    The isight camera DID come on when I selected it in the drop-down box beside the camera icon above the timeline, then I could not select the camcorder because it did not appear in the drop-down menu. I force-quit iMovie.
    I changed firewire cables on the chance that the first was not carrying the signal, but the second one does not produce a camcorder signal either.

  • Why is the music unavailable on my iPad except when connected to wifi?

    Why is it when I look at my music on the iPad is greyed out and unavailable unless I'm connected to wifi?

    You don't need to turn iTunes Match off. Anything that has previously been downloaded before you lose your wifi can be played without wifi, anything that hasn't can't.
    iTunes is essentially for people who's libraries are too large to fit onto the iPad, if your iPad becomes full it removes older titles when you download something new, thereby giving you access (albeit in some instances by wifi only) to your whole library.
    If you have enough room on your iPad for your whole library or at least everything you would like on there, then there is no point in using iTunes Match.

  • Why throws the "weblogic.ejb.extensions.LockTimedOutException" `s exception?

    When a statusful session bean be called frequencely in weblogic 5.1, weblogic throws
    "weblogic.ejb.extensions.LockTimedOutException", why?
    please help me!!thanks!!

    Hmmm, this exception occurs when two or more threads are trying to get an
    exclusive lock on a session(not permitted) or entity bean(times out) at the
    same time. Is it possible that two threads are accessing your session bean
    at the same time?
    "xiaoniao" <[email protected]> wrote in message
    news:3d96cde6$[email protected]..
    >
    When a statusful session bean be called frequencely in weblogic 5.1,weblogic throws
    "weblogic.ejb.extensions.LockTimedOutException", why?
    please help me!!thanks!!

  • Why is the Bridge CS4 Output Workspace an Exception?

    OUTPUT is the only one of eight Bridge CS4 workspaces that does not return to its default configuration upon choosing "Reset Workspace" (although it does do so for the "Reset Standard Workspaces" option). Is there a rationale for this peculiar exception?

    Maybe they thought the user would want to keep his own configuration for further output.
    That module is pretty limited though – I think it's a work-in-progress that was rushed out to meet the stupid marketing deadline.

  • Error in the below sql.

    Hi
    I am getting the below error in the below sql
    Hi
    I am getting the error in the below sql
    DECLARE
       pgm_id                  NUMBER := &1;
       schd_dt                 DATE := TO_DATE('&2','MM/DD/YYYY');
       l_schd_dt               DATE := NULL;
       l_pgm_id                NUMBER :=0;
       l_src_id                NUMBER;
       l_bulkCollectSize       NUMBER;
       l_trace_level           NUMBER := 0;
       l_CommitAllowance       INFT1.PRM_VALUE%TYPE;
       v_insrcdcnt             NUMBER := 0;
       g_ErrorString           VARCHAR2(500) := NULL;
       g_log_error             VARCHAR2(300) := NULL;
       g_recs_upd              NUMBER :=0;
       g_recs_ins              NUMBER :=0;
       g_aud_upd_ts            DATE := NULL;
       l_data_nbr              NUMBER := 0;
       l_ts_1             DATE :=NULL;
       l_ts_2               DATE :=NULL;
       l_rest_empno  emp_STG.mbr_nbr%TYPE :='0';
      l_Commitsize            NUMBER;
       CURSOR curTrnRecs(l_rest_empno VARCHAR)
       IS
        SELECT /* user_hash(tmp) PARALLEL(tmp,8) */  tmp.sec_lbl
        ,tmp.empno
         ,tmp.ename
        ,tmp.sal
        ,tmp.deptno
           FROM emp_stg tmp where tmp.mbr_nbr > l_rest_empno   order by tmp.mbr_nbr;
       TYPE rec_emp_stg is TABLE OF emp_STG%ROWTYPE index by PLS_INTEGER;
      stg_emp_stg rec_emp_stg   ;
       counter                 NUMBER         :=0;
       l_idx                  NUMBER;
       errors                  PLS_INTEGER;
        ins_errors EXCEPTION;
        PRAGMA EXCEPTION_INIT(ins_errors, -24381);
    BEGIN
        /* Copy values into local variables */
        l_pro:= pgm_id;
        l_schd_dt := schd_dt;
            /* Check if this is the first execution of the program; Get the last processed timestamp if the run is a restart */
        /* The restartability of this program is slightly differnt. Data_nbr =1 indicates that the last run was successful. The same program can*/
        /* be called multiple times for the same t47date. The restartability is designed accordingly */
        BEGIN
            SELECT /* SQL_TAG(<$RCSfile: t50lyt_can_hist_trans_load.sql,v $><2>) */
                   data_nbr,1,1,
                    NVL(key_text,'0')
            INTO l_data_nbr,
                 l_ts_1,
                 l_ts_2,
                 l_rest_mbr_nbr
            FROM inft
            WHERE TRUNC(key_ts)=TRUNC(l_schd_dt)
              AND pro_id = l_pro_id;
        EXCEPTION
            WHEN NO_DATA_FOUND THEN
              l_data_nbr:=9;
              NULL;
            WHEN OTHERS then
              g_ErrorString := g_log_error||' : SQLCODE = '||SQLCODE||' , ERRORMESSAGE = '||substr(SQLERRM, 1,200);
              RAISE;
        END;
           IF l_data_nbr = 1 THEN
          crm_msg.msg('Exiting:: Program already run');
          RETURN;
        ELSIF l_data_nbr = 0 THEN
          crm_msg.msg('This is a restart for the date '||l_schd_dt);
        ELSIF l_data_nbr= 9 THEN
            crm_msg.msg('First execution of this program');
       END IF;  
        BEGIN
            if l_data_nbr =9 THEN
             crm_msg.msg('This is the First execution of this program');
             INSERT
             INTO inft
               pgm_id,
               key_ts,
               key_text,
               data_nbr,
               data_ts,
               data_text
             VALUES
               l_pro,
               l_schd_dt,
               0,  --to hold empno
               sysdate,
               0   --no of recs processed
       COMMIT;
        END IF;
      END;
        OPEN curTrn(l_rest_empno);
        LOOP
          BEGIN
               FETCH curTrn BULK COLLECT INTO stg_emp_rec LIMIT 50000;
               IF nvl(curTrnRecs%ROWCOUNT,0)=0 THEN
                 crm_msg.msg('No Historical Data');
               END IF;
           FORALL i in 1..stg_emp_rec.COUNT SAVE EXCEPTIONS
             INSERT INTO emp values stg_emp_stg(i);
          counter := counter + 1;         
           g_recs_ins   := g_recs_ins+SQL%ROWCOUNT;
       EXCEPTION
          WHEN ins_errors THEN
             errors := SQL%BULK_EXCEPTIONS.COUNT;
            for j in 1..errors
            LOOP
            l_idx :=sql%bulk_exceptions(j).error_index;
          UPDATE emp SET src_id=stg_emp_rec(i).empno,ename=stg_emp_rec(i).ename,sal = stg_emp_rec(i).sal,
                 WHERE deptno= stg_emp_rec(i).deptno;  
           g_recs_upd := g_recs_upd + SQL%ROWCOUNT;
       ---END;
    -- EXIT WHEN curTrnRecs%NOTFOUND;
    -- END LOOP;
    -- CLOSE curTrnRecs;
      EXCEPTION
       WHEN OTHERS THEN
       g_ErrorString := g_log_error||' : SQLCODE = '||SQLCODE||' , ERRORMESSAGE = '||substr(SQLERRM, 1,200);
       crm_msg.msg(g_ErrorString);
       RAISE;
       END;
    END
        IF (counter >= l_CommitSize) THEN
            BEGIN /* To keep track of the timestamp of the last record processed inthe batch; for restartability */
                                            UPDATE   inft
                        SET      data_ts      = SYSDATE
                               ,key_text     = l_empno (idx)
                        WHERE    pgm_id       = l_pgm_id
                         AND     TRUNC(key_ts)= TRUNC(l_schd_dt);
                        COMMIT;
                    counter:=0;
                    END IF;
                EXCEPTION
                        WHEN OTHERS THEN
                          g_ErrorString := g_log_error||' : SQLCODE = '||SQLCODE||' , ERRORMESSAGE = '||substr(SQLERRM, 1,200);
                          crm_msg.msg(g_ErrorString);
                          RAISE;
                END;
       COMMIT;
      EXIT WHEN curTrn%NOTFOUND;
    --       END LOOP; --End of looping for the main cursor  fetch
       END LOOP;
      CLOSE curTrn;
       BEGIN /* Update the data_nbr to 1 to indicate the update is complete */
             UPDATE inft
             SET data_nbr=1,
                 data_ts=nvl(g_aud_upd_ts,data_ts),
                 data_text = counter
             WHERE pro_id = l_pgm_id
              AND TRUNC(key_ts)=TRUNC(l_schd_dt);
            COMMIT;
           EXCEPTION
             WHEN OTHERS THEN
               g_ErrorString := g_log_error||' : SQLCODE = '||SQLCODE||' , ERRORMESSAGE = '||substr(SQLERRM, 1,200);
               crm_msg.msg(g_ErrorString);
               RAISE;
        END;
        g_log_error := 'LOGGING SUMMARY';
        crm_msg.msg_tab('RECS UPDATED',g_recs_upd);
        crm_msg.msg_tab('RECS INSERTED',g_recs_ins);
        crm_msg.msg('Program ends Successfully');
    EXCEPTION
       WHEN OTHERS THEN
         g_ErrorString := g_log_error||' : SQLCODE = '||SQLCODE||' , ERRORMESSAGE = '||substr(SQLERRM, 1,200);
         crm_msg.msg(g_ErrorString);
    END;
    Elapsed: 00:00:00.00
      EXCEPTION
    ERROR at line 248:
    ORA-06550: line 248, column 3:
    PLS-00103: Encountered the symbol "EXCEPTION" when expecting one of the following:
    ( begin case declare end exit for goto if loop mod null
    pragma raise return select update when while with
    <an identifier> <a double-quoted delimited-identifier>
    <a bind variable> << continue close current delete fetch lock
    insert open rollback savepoint set sql execute commit forall
    merge pipe purge
    ORA-06550: line 255, column 5:
    PLS-00103: Encountered the symbol "IF" when expecting one of the following:
    ORA-06550: line 314, column 2:
    PLS-00103: Encountered the symbol "EXCEPTION" when expecting one of the following:
    ( begin case declare end exit for goto if loop mod null
    pragma raise return select update while with <an identifier>
    <a double-quoted delimited-
    ORA-06550: line 322, column 0:
    PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
    end not pragma final instantiable order overriding static
    member constructor mapAppreciate ur help on the above?
    Edited by: user1014019 on Oct 3, 2011 6:45 AM
    Edited by: BluShadow on 03-Oct-2011 15:08
    added {noformat}{noformat} tags. Please read {message:id=9360002} and learn to do this yourself.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Please provide a code that can be compiled, the sample that you provided has compilation errors:
    Have made change to your code block, so that it compiles.Try to run the below code block:
    /* Formatted on 2011/10/03 21:08 (Formatter Plus v4.8.5) */
    DECLARE
       pgm_id              NUMBER                 := &1;
       schd_dt             DATE                   := TO_DATE ('&2', 'MM/DD/YYYY');
       l_schd_dt           DATE                   := NULL;
       l_pgm_id            NUMBER                 := 0;
       l_src_id            NUMBER;
       l_bulkcollectsize   NUMBER;
       l_trace_level       NUMBER                 := 0;
       l_commitallowance   inft1.prm_value%TYPE;
       v_insrcdcnt         NUMBER                 := 0;
       g_errorstring       VARCHAR2 (500)         := NULL;
       g_log_error         VARCHAR2 (300)         := NULL;
       g_recs_upd          NUMBER                 := 0;
       g_recs_ins          NUMBER                 := 0;
       g_aud_upd_ts        DATE                   := NULL;
       l_data_nbr          NUMBER                 := 0;
       l_ts_1              DATE                   := NULL;
       l_ts_2              DATE                   := NULL;
       l_rest_empno        emp_stg.mbr_nbr%TYPE   := '0';
       l_commitsize        NUMBER;
       CURSOR curtrnrecs (l_rest_empno VARCHAR)
       IS
          SELECT /* user_hash(tmp) PARALLEL(tmp,8) */ tmp.sec_lbl, tmp.empno,
                    tmp.ename, tmp.sal, tmp.deptno
              FROM emp_stg tmp
             WHERE tmp.mbr_nbr > l_rest_empno
          ORDER BY tmp.mbr_nbr;
       TYPE rec_emp_stg IS TABLE OF emp_stg%ROWTYPE
          INDEX BY PLS_INTEGER;
       stg_emp_stg         rec_emp_stg;
       counter             NUMBER                 := 0;
       l_idx               NUMBER;
       ERRORS              PLS_INTEGER;
       ins_errors          EXCEPTION;
       PRAGMA EXCEPTION_INIT (ins_errors, -24381);
    BEGIN
       /* Copy values into local variables */
       l_pro := pgm_id;
       l_schd_dt := schd_dt;
           /* Check if this is the first execution of the program; Get the last processed timestamp if the run is a restart */
       /* The restartability of this program is slightly differnt. Data_nbr =1 indicates that the last run was successful. The same program can*/
       /* be called multiple times for the same t47date. The restartability is designed accordingly */
       BEGIN
          SELECT /* SQL_TAG(<$RCSfile: t50lyt_can_hist_trans_load.sql,v $><2>) */
                 data_nbr, 1, 1, NVL (key_text, '0')
            INTO l_data_nbr, l_ts_1, l_ts_2, l_rest_mbr_nbr
            FROM inft
           WHERE TRUNC (key_ts) = TRUNC (l_schd_dt) AND pro_id = l_pro_id;
       EXCEPTION
          WHEN NO_DATA_FOUND
          THEN
             l_data_nbr := 9;
             NULL;
          WHEN OTHERS
          THEN
             g_errorstring :=
                   g_log_error
                || ' : SQLCODE = '
                || SQLCODE
                || ' , ERRORMESSAGE = '
                || SUBSTR (SQLERRM, 1, 200);
             RAISE;
       END;
       IF l_data_nbr = 1
       THEN
          crm_msg.msg ('Exiting:: Program already run');
          RETURN;
       ELSIF l_data_nbr = 0
       THEN
          crm_msg.msg ('This is a restart for the date ' || l_schd_dt);
       ELSIF l_data_nbr = 9
       THEN
          crm_msg.msg ('First execution of this program');
       END IF;
       BEGIN
          IF l_data_nbr = 9
          THEN
             crm_msg.msg ('This is the First execution of this program');
             INSERT INTO inft
                         (pgm_id, key_ts, key_text, data_nbr, data_ts, data_text
                  VALUES (l_pro, l_schd_dt, 0,                     --to hold empno
                                              SYSDATE, 0    --no of recs processed
             COMMIT;
          END IF;
       END;
       OPEN curtrn (l_rest_empno);
       LOOP
          BEGIN
             FETCH curtrn
             BULK COLLECT INTO stg_emp_rec LIMIT 50000;
             IF NVL (curtrnrecs%ROWCOUNT, 0) = 0
             THEN
                crm_msg.msg ('No Historical Data');
             END IF;
             FORALL i IN 1 .. stg_emp_rec.COUNT SAVE EXCEPTIONS
                INSERT INTO emp
                     VALUES stg_emp_stg (i);
             counter := counter + 1;
             g_recs_ins := g_recs_ins + SQL%ROWCOUNT;
          EXCEPTION
             WHEN ins_errors
             THEN
                ERRORS := SQL%BULK_EXCEPTIONS.COUNT;
                FOR j IN 1 .. ERRORS
                LOOP
                   l_idx := SQL%BULK_EXCEPTIONS (j).ERROR_INDEX;
                   UPDATE emp
                      SET src_id = stg_emp_rec (i).empno,
                          ename = stg_emp_rec (i).ename,
                          sal = stg_emp_rec (i).sal
                    WHERE deptno = stg_emp_rec (i).deptno;
                   g_recs_upd := g_recs_upd + SQL%ROWCOUNT;
                END LOOP;
    --END;
             -- EXIT WHEN curTrnRecs%NOTFOUND;
    --END LOOP;
    --CLOSE curTrnRecs;
             WHEN OTHERS
             THEN
                g_errorstring :=
                      g_log_error
                   || ' : SQLCODE = '
                   || SQLCODE
                   || ' , ERRORMESSAGE = '
                   || SUBSTR (SQLERRM, 1, 200);
                crm_msg.msg (g_errorstring);
                RAISE;
          END;
          IF (counter >= l_commitsize)
          THEN
             BEGIN
    /* To keep track of the timestamp of the last record processed inthe batch; for restartability */
                UPDATE inft
                   SET data_ts = SYSDATE,
                       key_text = l_empno (idx)
                 WHERE pgm_id = l_pgm_id AND TRUNC (key_ts) = TRUNC (l_schd_dt);
                COMMIT;
                counter := 0;
             EXCEPTION
                WHEN OTHERS
                THEN
                   g_errorstring :=
                         g_log_error
                      || ' : SQLCODE = '
                      || SQLCODE
                      || ' , ERRORMESSAGE = '
                      || SUBSTR (SQLERRM, 1, 200);
                   crm_msg.msg (g_errorstring);
                   RAISE;
             END;
          END IF;
          COMMIT;
          EXIT WHEN curtrn%NOTFOUND;
    --       END LOOP; --End of looping for the main cursor  fetch
       END LOOP;
       CLOSE curtrn;
       BEGIN     /* Update the data_nbr to 1 to indicate the update is complete */
          UPDATE inft
             SET data_nbr = 1,
                 data_ts = NVL (g_aud_upd_ts, data_ts),
                 data_text = counter
           WHERE pro_id = l_pgm_id AND TRUNC (key_ts) = TRUNC (l_schd_dt);
          COMMIT;
       EXCEPTION
          WHEN OTHERS
          THEN
             g_errorstring :=
                   g_log_error
                || ' : SQLCODE = '
                || SQLCODE
                || ' , ERRORMESSAGE = '
                || SUBSTR (SQLERRM, 1, 200);
             crm_msg.msg (g_errorstring);
             RAISE;
       END;
       g_log_error := 'LOGGING SUMMARY';
       crm_msg.msg_tab ('RECS UPDATED', g_recs_upd);
       crm_msg.msg_tab ('RECS INSERTED', g_recs_ins);
       crm_msg.msg ('Program ends Successfully');
    EXCEPTION
       WHEN OTHERS
       THEN
          g_errorstring :=
                g_log_error
             || ' : SQLCODE = '
             || SQLCODE
             || ' , ERRORMESSAGE = '
             || SUBSTR (SQLERRM, 1, 200);
          crm_msg.msg (g_errorstring);
    END;Hope its useful.
    Cheers

  • Why is the New FireFox so different to the previous version?.

    Prior to upgrading if I brought up my FireFox page I had a header the same as my Google Page. The new/latest FireFox Page does not have the header with the options. Those options were,Images-Videos-Maps-News-Shopping-Mail and a More option with a drop-down menu. Why is this the case?.

    ''Why is the New FireFox so different to the previous version?''
    I'll pass pass on the "why", although the reason given would be to improve Firefox by having a page that is on your system -- but the the content is not exactly on your system. I always find it amazing that there is anyone who uses the default home page, especially when Firefox has s builtin search bar. Even a couple of my friends who think the internet is their former ISP have there former ISP's page as their their home page.
    To restore a Google search page you can replace your homepage with http://www.google.com then you will see those Google applications at the top of the window.
    * https://support.mozilla.com/kb/How%20to%20set%20the%20home%20page
    Now that you no longer have the Firefox default home page ("about:home") you had better read item #31 in the following about picking up your previous session from your history menu.
    * http://dmcritchie.mvps.org/firefox/firefox-problems.htm#tabslost
    which is part of the following:
    You can make Firefox '''Firefox 5.0''' look like Firefox 3.6.19, see numbered items 1-10 in the following topic [http://dmcritchie.mvps.org/firefox/firefox-problems.htm#fx4interface Fix Firefox 4.0 toolbar user interface, problems (Make Firefox 5.0, or 4.0.1, look like 3.6)]. ''Whether or not you make changes, you should be aware of what has changed and what you have to do to use changed or missing features.''
    * http://dmcritchie.mvps.org/firefox/firefox-problems.htm#tabslost

  • DropdownByKey UI element is giving Classcast exception

    Hi
    In my webdynpro view if i add "DropdownbyKey" UI element and the run the application,it is giving Classcast Exception.i am getting following error
    The initial exception that caused the request to fail, was:
       java.lang.ClassCastException
        at com.sap.tc.webdynpro.progmodel.context.Paths.getAttributeInfoFor(Paths.java:202)
        at com.sap.tc.webdynpro.clientimpl.html.uielib.standard.uradapter.DropDownByKeyAdapter.setViewAndNodeElement(DropDownByKeyAdapter.java:240)
        at com.sap.tc.webdynpro.clientimpl.html.uielements.adaptmgr.URAdapterManager.getAdapterFor(URAdapterManager.java:231)
        at com.sap.tc.webdynpro.clientimpl.html.uielements.adaptmgr.URAdapterManager.getAdapterFor(URAdapterManager.java:64)
        at com.sap.tc.webdynpro.clientimpl.html.uielib.standard.uradapter.FlowLayoutAdapter$Items.getControl(FlowLayoutAdapter.java:318)
        ... 39 more
    Please help
    thanks
    Prasad

    Hi Sriram,
    You need to bind the property "selectedKey"  for the DropdownByKey UIElement
    http://help.sap.com/saphelp_nw04/helpdata/en/08/13dbfb6e779743bb2ca641ebcb3411/frameset.htm
    Regards, Anilkumar

Maybe you are looking for

  • Invalid Argument Exception on Java API's DB Close

    When closing the database via the Java API's close method, I am getting an invalid argument exception... how can this be fixed... subsequent access to the DB causes the JVM to crash?? ERROR: An exception has occurred: java.lang.IllegalArgumentExcepti

  • Attach files to a Shopping Cart in SRM portal using a ABAP program.

    Hello. We need to attach files to a Shopping Cart using a ABAP program and see them in SRM portal. Currently we know how to attach files in the backend using the function Xxxxxxxxxx but with this function we can not see the attachment in the SRM port

  • Can I buy replacement screws for the underside of my mac laptop

    I bought a refurbished macbook last year, but recently the little screws that hold the underside onto the body of the computer have come out and I lose them. How can I buy replacements? These don't seem like things that are at the genius bar at my ap

  • Sharing photos on two macs

    Is there is a way that if you upload pix or video to iPhoto or iMovie that it goes on both computers?

  • Classic dynpro : hide area and auto adjust hights

    Hi, I want to develop a similar user interface as is used in standard transaction MIGO. first, Iu2019d like to show / hide a sub screen area using a button (similar to the header data or the item details in transaction MIGO) Second, Iu2019d like to a