Update Optimizer stats

Hi everyone,
This is really urgent,
Early watch report has showed that our update optimizer statistics are not up to date.So i m thinking to schedule Update optimizer job thro DB13.My system setup is very big n is linux based.So when do u feel is the best time to schedule that(load wise),and how much time will it take(system is on cluster plus 14 app servers),so its a real big one and an Early watch has to be schedule jst after that.
Please advise.
Its urgent

Hi,
you can use brconnect as ora<sid>
if you want to update all tables you can use:
brconnect -u / -c -f stats -t all -p <number of parallel threads>
check the follwing links for more details about brconnect:
http://help.sap.com/saphelp_nw2004s/helpdata/en/88/fce73a86e99c77e10000000a114084/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/88/fce73a86e99c77e10000000a114084/frameset.htm
Regards
Ermanno

Similar Messages

  • Error in Computing Database statistics while running Update optimizer stati

    Dear All,
    I am getting following error while executing Update optimizer statistics on my ECC Production Server.
    BR0280I BRCONNECT time stamp: 2011-09-07 06.00.34
    BR0815I Number of indexes in schema of owner SAPFEP: 82458
    BR0815I Number of indexes in schema of owner SAPFEPDB: 403
    BR0825E Table/Index '/SAPAPO/MATKEY' not found in database
    BR0182E Checking parameter/option 'stats_dbms_stats' failed
    BR0806I End of BRCONNECT processing: cegskeaq.sta 2011-09-07 06.00.34
    BR0280I BRCONNECT time stamp: 2011-09-07 06.00.34
    BR0804I BRCONNECT terminated with errors
    You are requested to please suggest the corrective action.
    Regards,
    Manish Sachan

    Hiu2026u2026u2026
    Please find the complete Log u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026
    BR0801I BRCONNECT 7.00 (34)
    BR0805I Start of BRCONNECT processing: cegxrutc.sta 2011-10-05 06.00.16
    BR0484I BRCONNECT log file: /oracle/FEP/sapcheck/cegxrutc.sta
    BR0101I Parameters
    Name                           Value
    oracle_sid                     FEP
    oracle_home                    /oracle/FEP/102_64
    oracle_profile                 /oracle/FEP/102_64/dbs/initFEP.ora
    sapdata_home                   /oracle/FEP
    sap_profile                    /oracle/FEP/102_64/dbs/initFEP.sap
    system_info                    fepadm/orafep fjeccprd1 AIX 3 5 00F67F154C00
    oracle_info                    FEP 10.2.0.2.0 8192 114671 3007543000 fjeccprd1 UTF8 UTF8
    sap_info                       700 SAPFEP 0002LK0003FEP0011H01500816140015Maintenance_ORA
    make_info                      rs6000_64 OCI_102 May 31 2008
    command_line                   brconnect -u / -jid STATS20080725060000 -c -f stats -t ALL
    stats_table                    ALL
    stats_dbms_stats               ALL:R:2,/SAPAPO/MATKEY:B:3
    stats_change_threshold         50
    stats_parallel_degree          1
    BR0280I BRCONNECT time stamp: 2011-10-05 06.00.27
    BR0813I Schema owners found in database FEP: SAPFEP*, SAPFEPDB%
    BR0280I BRCONNECT time stamp: 2011-10-05 06.00.37
    BR0814I Number of tables in schema of owner SAPFEP: 68904
    BR0836I Number of info cube tables found for owner SAPFEP: 93
    BR0814I Number of tables in schema of owner SAPFEPDB: 264
    BR0280I BRCONNECT time stamp: 2011-10-05 06.00.47
    BR0815I Number of indexes in schema of owner SAPFEP: 82459
    BR0815I Number of indexes in schema of owner SAPFEPDB: 403
    BR0825E Table/Index '/SAPAPO/MATKEY' not found in database
    BR0182E Checking parameter/option 'stats_dbms_stats' failed
    BR0806I End of BRCONNECT processing: cegxrutc.sta 2011-10-05 06.00.47
    BR0280I BRCONNECT time stamp: 2011-10-05 06.00.47
    BR0804I BRCONNECT terminated with errors
    Regards,
    Manish Sachan

  • DB13 Check and update optimizer stat error: ORA-01652: unable to extend tem

    Hi SAP Gurus,
    When running Check and Update Optimizer Statistics in DB13, an error occurs.
    BR0280I BRCONNECT time stamp: 2011-03-10 06.35.52                    
    BR0301E SQL error -1652 at location stats_tab_collect-16             
    ORA-01652: unable to extend temp segment by 12137 in tablespace SYSTEM
    BR0886E Checking/collecting statistics failed for table SAPR3.ACCTIT 
    BR0280I BRCONNECT time stamp: 2011-03-10 06.36.49                    
    BR0850I 3 of 39479 objects processed - 3.522 of 342.781 units done   
    BR0204I Percentage done: 1.03%, estimated end time: 15:47            
    Looking at tablespace SYSTEM in DB02, the percent used is 58. Auto-extent feature is OFF. Will turning the auto-extent ON, remove the error?

    It seems like Your user (by a mistake) have tablespace SYSTEM as temporary tablespace.
    Connect as sysdba in Your database and check which temp tablespaces awaiable, and size of them:
    select tablespace_name, sum(bytes)/1024/1024 "Size of TEMP TBS in MB" from dba_temp_files  group by tablespace_name;
    Check which users having SYSTEM as tamp-tbs:
    select username, temporary_tablespace from dba_users where temporary_tablespace like 'SYSTEM' order by 1;
    Change those users to have one of your temp-tablespaces:
    alter user &username temporary tablespace &&TempTBS;
    It's also a good idea to have autoextend on on Your temp TBS, but remember to set maxsize so you doesn't fill up your disksystem.
    Hope this solve Your problems.
    Regards
    Audun
    DBA

  • Error in Update optimizer statistics - index is in unusable state

    Hello,
    we have this error in log Check and update optimizer statistics:
    12.02.2009     23:21:20     'BEGIN DBMS_STATS.GATHER_TABLE_STATS (OWNNAME => '"SAPPB1"', TABNAME => '"/BIC/FZPPC0002"', ESTIMATE_PERCENT => 10, METHOD_OPT =
    12.02.2009     23:21:20     ORA-20000: index "SAPPB1"."/BIC/FZPPC0002~010"  or partition of such index is in unusable state
    12.02.2009     23:21:20     ORA-06512: at "SYS.DBMS_STATS", line 13452
    12.02.2009     23:21:20     ORA-06512: at "SYS.DBMS_STATS", line 13472
    12.02.2009     23:21:20     ORA-06512: at line 1
    12.02.2009     23:21:20     BR0886E Checking/collecting statistics failed for table SAPPB1./BIC/FZPPC0002
    i can temporary fix this problem when i delete and recreate index via SE14,  but this help only for one next running update statistics, every next running update statistics has same error:  index "SAPPB1"."/BIC/FZPPC0002~010"  or partition of such index is in unusable state. Exist any definitive solution for this problem. Thanks

    Hi,
    Two methods for checking/repairing Indexing issues
    1)RSRV for a particular cube
    2)SAP_INFOCUBE_INDEXES_REPAIR report
    You can also use this sql to rebuild an Index.
    alter index <index name> rebuild online; Or you can rebuild Index by using ABAP report 'RSANAORA'.
    Please check below thread it may help you.
    /message/6483705#6483705 [original link is broken]
    https://forums.sdn.sap.com/click.jspa?searchID=12942068&messageID=2052264
    Thanks,
    Sushil

  • Problem in updates  optimizer

    Hi All,
    I am facing a problem in updates  optimizer while runing through db13 but it is runing successfully at os lavel.
    Log is given below :
    18.01.2008     17:48:18     Job started
    18.01.2008     17:48:18     Step 001 started (program RSDBAJOB, variant &0000000002580, user ID JITENDRA)
    18.01.2008     17:48:18     Execute logical command BRCONNECT On host bslprtl
    18.01.2008     17:48:18     Parameters:-u / -jid STATS20080118174818 -c -f stats -t PSAPPRD
    18.01.2008     17:48:19     ld.so.1: brconnect: fatal: libclntsh.so.10.1: open failed: No such file or directory
    18.01.2008     17:48:19     Process died due to signal 9
    18.01.2008     17:48:19     Job finished
    Kindly help how to resolve this issue.....
    Regards,
    Jitendra Tiwari

    hi,
    to Jitendra:
    > I am facing a problem in updates optimizer while runing through db13 but it is runing successfully at os lavel.
    As which user have you executed the update statistics at OS level?
    Have you installed the oracle 10g instantclient as indicated on the SAP notes?
    what are your environment variables ofr the user <SID>adm?
    to kaushal:
    >The libclntsh.so.10.1 file is in the /export/home/oracle10g/lib32 directory which is specified in "Native Library Path Suffix"
    1) That would be on your system.
    2) That is the oracle client shared library, but SAP recommends to install the INSTANTCLIENT, and it will NOT be on the mentioned directory, even in YOUR system. BRCONNECT is looking for the instantclient not for the "normal" client.
    Please, check note 819829 Oracle Database 10g: Instant Client 10.x on Unix where it is explained
    to Eric:
    >if you are using Oracle 9i, then use the BR*tools made for Oracle 9.
    It is possible to use BRCONNECT 700 with Oracle 10g 9i, but I prefer to run BRCONNECT 640 with 9i as it can be complicated to set all variables.
    Edited by: Fidel Vales on Jan 18, 2008 3:04 PM

  • Check and Update  Optimizer Statistics Error

    Hello,
    I have scheduled 'Check and Update  Optimizer Statistics' from DB 13 but I always get this error.
      BR0280I BRCONNECT time stamp: 2009-01-05 01.00.46
      BR0301E SQL error -20000 at location stats_ind_collect-3, SQL statement:
      'BEGIN DBMS_STATS.GATHER_INDEX_STATS (OWNNAME => '"SAPSR3"', INDNAME => '"/BIC  /B0000412000KE"', ESTIMATE_PERCENT => 30, DEGREE => NULL, NO_INVALIDATE => FALSE); END;'
      ORA-20000: index "SAPSR3"."/BIC/B0000412000KE"  or partition of such index is in unusable state
      ORA-06512: at "SYS.DBMS_STATS", line 10610
      ORA-06512: at "SYS.DBMS_STATS", line 10645
      ORA-06512: at line 1
      BR0886E Checking/collecting statistics failed for index SAPSR3./BIC/B0000412000KE
    Tried checking the table /BIC/B0000412000KE and got this from the check:
      Enhancement category for table missing
      Enhancement category for include or subtype missing
      Table /BIC/B0000412000 was checked with warnings
    I am still checking what this means but appreciate you have any idea on how to solve it.
    Thank you.
    Best Regards,
    Julius
    Edited by: Julius Baron Manuel on Jan 7, 2009 7:39 AM

    Hi Julius,
    Have your tried scheduling the update stats via DB13 'Immediately'. ??? Does it still gives you the same error when its done 'immediately'?
    Try out DB02 and check your whole Database along with missing indexes. Refresh database and update histories.
    Regards,
    Pranay

  • Check and update optimizer statistics failed

    Hellow Friends,
    After running job Check and update optimizer statistics each and every time from db13 in my BI production server it got failed please
    view the logs
    BR0301E SQL error -20000 at location stats_tab_collect-20, SQL statement:                                                                    
    'BEGIN DBMS_STATS.GATHER_TABLE_STATS (OWNNAME => '"SAPSR3"', TABNAME => '"/BIC/B0000228000"', ESTIMATE_PERCENT => NULL, METHOD_OPT => 'FOR ALL
    ORA-20000: index "SAPSR3"."/BIC/B0000228000KE"  or partition of such index is in unusable state                                              
    ORA-06512: at "SYS.DBMS_STATS", line 13159                                                                               
    ORA-06512: at "SYS.DBMS_STATS", line 13179                                                                               
    ORA-06512: at line 1                                                                               
    BR0886E Checking/collecting statistics failed for table SAPSR3./BIC/B0000228000                                                              
    BR0280I BRCONNECT time stamp: 2009-05-19 18.17.19                                                                               
    BR0883I Table selected to collect statistics after check: SAPSR3./BIC/B0000229000 (161130/1480:0:0)                                          
    BR0280I BRCONNECT time stamp: 2009-05-19 18.17.19                                                                               
    BR0881I Collecting statistics for table SAPSR3./BIC/B0000229000 with method/sample E/P10 ...                                                 
    BR0280I BRCONNECT time stamp: 2009-05-19 18.17.21                                                                               
    BR0301E SQL error -20000 at location stats_tab_collect-20, SQL statement:                                                                    
    'BEGIN DBMS_STATS.GATHER_TABLE_STATS (OWNNAME => '"SAPSR3"', TABNAME => '"/BIC/B0000229000"', ESTIMATE_PERCENT => 10, METHOD_OPT => 'FOR ALL C
    ORA-20000: index "SAPSR3"."/BIC/B0000229000KE"  or partition of such index is in unusable state                                              
    ORA-06512: at "SYS.DBMS_STATS", line 13159                                                                               
    ORA-06512: at "SYS.DBMS_STATS", line 13179                                                                               
    ORA-06512: at line 1                                                                               
    BR0886E Checking/collecting statistics failed for table SAPSR3./BIC/B0000229000                                                              
    BR0280I BRCONNECT time stamp: 2009-05-19 18.17.21                                                                               
    BR0883I Table selected to collect statistics after check: SAPSR3./BIC/B0000230000 (0/13545:0:0)                                              
    BR0280I BRCONNECT time stamp: 2009-05-19 18.17.21                                                                               
    BR0881I Collecting statistics for table SAPSR3./BIC/B0000230000 with method/sample E/P30 ...                                                 
    BR0280I BRCONNECT time stamp: 2009-05-19 18.17.21                                                                               
    BR0301E SQL error -20000 at location stats_tab_collect-20, SQL statement:                                                                    
    'BEGIN DBMS_STATS.GATHER_TABLE_STATS (OWNNAME => '"SAPSR3"', TABNAME => '"/BIC/B0000230000"', ESTIMATE_PERCENT => 30, METHOD_OPT => 'FOR ALL C
    ORA-20000: index "SAPSR3"."/BIC/B0000230000KE"  or partition of such index is in unusable state                                              
    ORA-06512: at "SYS.DBMS_STATS", line 13159                                                                               
    ORA-06512: at "SYS.DBMS_STATS", line 13179                                                                               
    ORA-06512: at line 1                                                                               
    BR0886E Checking/collecting statistics failed for table SAPSR3./BIC/B0000230000                                                              
    Please help me to resolve the issue.

    some of your PSA tables are inconsistent - ex: /BIC/B0000228000 - check PSA partitioning in RSRV to correct the same or delete data from the same using SE14 and try running the same.

  • Questions on Xontrol--H​ow to update the state and data

    Hello, everyone. I am new to use the XControl. I don't understand how the program in the facade update the "state" and "Data" after we click the button. I cannot do that, please give me some help on the XControl.
    My vi is in the attachment.
    Message Edited by McArthur on 03-24-2010 02:19 AM
    Working...
    Attachments:
    Button.zip ‏51 KB

    McArthur wrote: Now I understand the reason why the state can not update, because I didn't do as TCPlomp mentioned. It seems working now....
     I mentioned this too, however without a pretty picture.
    quote: 
    When you modify data or state, you need to update the action cluster to indicate that fact.
    McArthur wrote: The example is just a dummy, not really make sense.
    The example is really quite good and shows these things too as well as many other important points. Please try to fully understand it. 
    I would strongly advise you to also look at my other suggestions. You still haven't explained the purpose of the xcontrol. I am still curious.  
    LabVIEW Champion . Do more with less code and in less time .

  • How to update session state from form field values without submitting page?

    Hi,
    I am new to Oracle APEX. I am using Oracle Apex 4.2 on Oracle 11g release 2. The problem is that when I am entering data on a form, when I enter a value in one field and move to the next field, how can I use the value of first field in the validation procedure of next field? I know that when we enter data in fields, the session state is not updated with these values until we submit the page... right... but I have seen that if there is a control of List box type, then Apex gives an option "Action When List changes" where we can choose option to update corresponding session state field with the value of list box item, without submitting the page.
    Now my questions is why this option is only available for List box items? why not for other item types like Text box, Check box,... ? can someone please help me with this?
    (the issue with update of session state depending on page submitting, is that we need a complete network round trip from client to server in order for it. However if we can update session state variables without submitting page, then we can avoid this network traffic).
    Any help will be greatly appreciated. Thanks in advance.

    Create a dynamic action on change and run a PL/SQL process there with the following code:
    BEGIN
       NULL;
    END;Page items to submit > your item.
    This will set the session state without submitting the form.
    Further examples here:
    http://apex.oracle.com/pls/apex/f?p=31517:229
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Creating a better update table statement

    Hello,
    I have the following update table statement that I would like to make more effecient. This thing is taking forever. A little background. The source table/views are not indexed and the larger of the two only has 150k records. Any ideas on making more effecient would be appreciate.
    Thanks.
    Ryan
    Script:
    DECLARE
    V_EID_CIV_ID SBI_EID_W_VALID_ANUM_V.SUBJECT_KEY%TYPE;
    V_EID_DOE     DATE;
    V_EID_POE     SBI_EID_W_VALID_ANUM_V.POINT_OF_ENTRY%TYPE;
    V_EID_APPR_DATE DATE;
    V_CASE_CIV_ID     SBI_DACS_CASE_RECORDS.CASE_EID_CIV_ID%TYPE;
    V_CASE_DOE     DATE;          
    V_CASE_POE SBI_DACS_CASE_RECORDS.CASE_CODE_ENTRY_PLACE%TYPE;
    V_CASE_APPR_DATE           DATE;
    V_CASE_DEPART_DATE           DATE;
    V_SBI_UPDATE_STEP SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP%TYPE;
    V_SBI_CIV_ID SBI_DACS_CASE_RECORDS.SBI_CIV_ID%TYPE;
    CURSOR VALID_CIV_ID_FROM_EID IS
         SELECT EID.SUBJECT_KEY,
              TO_DATE(EID.PROCESS_ENTRY_DATE),
              EID.POINT_OF_ENTRY,
              TO_DATE(EID.APPREHENSION_DATE),
              DACS.CASE_EID_CIV_ID,
              TO_DATE(DACS.CASE_DATE_OF_ENTRY,'YYYYMMDD'),
              DACS.CASE_CODE_ENTRY_PLACE,
              TO_DATE(DACS.CASE_DATE_APPR,'YYYYMMDD'),
              TO_DATE(DACS.CASE_DATE_DEPARTED,'YYYYMMDD'),
              DACS.SBI_UPDATE_STEP,
              DACS.SBI_CIV_ID
         FROM SBI_EID_W_VALID_ANUM_V EID,
    SBI_DACS_CASE_RECORDS DACS
    WHERE DACS.CASE_NBR_A = EID.ALIEN_FILE_NUMBER;
         BEGIN          
              OPEN VALID_CIV_ID_FROM_EID;
    SAVEPOINT A;
              LOOP
                   FETCH VALID_CIV_ID_FROM_EID INTO V_EID_CIV_ID, V_EID_DOE, V_EID_POE,V_EID_APPR_DATE,V_CASE_CIV_ID, V_CASE_DOE,V_CASE_POE,V_CASE_APPR_DATE,V_CASE_DEPART_DATE,V_SBI_UPDATE_STEP,V_SBI_CIV_ID;     
    DBMS_OUTPUT.PUT_LINE('BEFORE');
                   EXIT WHEN VALID_CIV_ID_FROM_EID%FOUND;
    DBMS_OUTPUT.PUT_LINE('AFTER');
              UPDATE SBI_DACS_CASE_RECORDS
    SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_CASE_CIV_ID,
                   SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 1
    WHERE V_CASE_CIV_ID IS NOT NULL
    AND V_CASE_CIV_ID <> 0;
    UPDATE SBI_DACS_CASE_RECORDS
              SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
                   SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 2
    WHERE V_SBI_CIV_ID IS NULL AND V_SBI_UPDATE_STEP = 0
                   AND V_EID_DOE = V_CASE_DOE
                   AND V_EID_POE = V_CASE_POE
                   AND V_EID_APPR_DATE = V_CASE_APPR_DATE
                   AND V_EID_APPR_DATE = V_CASE_DEPART_DATE;
                   UPDATE SBI_DACS_CASE_RECORDS
              SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
                   SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 3
    WHERE V_SBI_UPDATE_STEP = 0
                   AND V_EID_DOE = V_CASE_DOE
                   AND V_EID_POE = V_CASE_POE
                   AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
    UPDATE SBI_DACS_CASE_RECORDS
              SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
                   SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 4
    WHERE V_SBI_UPDATE_STEP = 0
                   AND V_EID_DOE = V_CASE_DOE
                   AND V_EID_POE = V_CASE_POE
                   AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) > -4
                   AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) < 4 ;
         UPDATE SBI_DACS_CASE_RECORDS
              SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
                   SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 5
    WHERE V_SBI_UPDATE_STEP = 0
                   AND V_EID_DOE = V_CASE_DOE
                   AND V_EID_POE <> V_CASE_POE
                   AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
    UPDATE SBI_DACS_CASE_RECORDS
              SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
                   SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 6
    WHERE V_SBI_UPDATE_STEP = 0
                   AND V_EID_POE = V_CASE_POE
                   AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
    UPDATE SBI_DACS_CASE_RECORDS
              SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
                   SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 7
    WHERE V_SBI_UPDATE_STEP = 0
         AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
              UPDATE SBI_DACS_CASE_RECORDS
              SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
                   SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 8
    WHERE V_SBI_UPDATE_STEP = 0
    AND V_EID_DOE = V_CASE_DOE
                   AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) > -4
                   AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) < 4;          
                   UPDATE SBI_DACS_CASE_RECORDS
              SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
                   SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 9
    WHERE V_SBI_UPDATE_STEP = 0
    AND V_EID_DOE = V_CASE_DOE
                   AND V_EID_POE = V_CASE_POE;
              UPDATE SBI_DACS_CASE_RECORDS
              SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
                   SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 10
    WHERE V_SBI_UPDATE_STEP = 0
    AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) > -4
                   AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) < 4;     
              END LOOP;
              CLOSE VALID_CIV_ID_FROM_EID;
         COMMIT;
         END;     
    -----Thats it. Thanks for your help.
    Ryan

    Please use [ code] or [ pre] tags to format code before posing:
    DECLARE
         V_EID_CIV_ID SBI_EID_W_VALID_ANUM_V.SUBJECT_KEY%TYPE;
         V_EID_DOE DATE;
         V_EID_POE SBI_EID_W_VALID_ANUM_V.POINT_OF_ENTRY%TYPE;
         V_EID_APPR_DATE DATE;
         V_CASE_CIV_ID SBI_DACS_CASE_RECORDS.CASE_EID_CIV_ID%TYPE;
         V_CASE_DOE DATE;
         V_CASE_POE SBI_DACS_CASE_RECORDS.CASE_CODE_ENTRY_PLACE%TYPE;
         V_CASE_APPR_DATE DATE;
         V_CASE_DEPART_DATE DATE;
         V_SBI_UPDATE_STEP SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP%TYPE;
         V_SBI_CIV_ID SBI_DACS_CASE_RECORDS.SBI_CIV_ID%TYPE;
         CURSOR VALID_CIV_ID_FROM_EID IS
              SELECT EID.SUBJECT_KEY,
               TO_DATE(EID.PROCESS_ENTRY_DATE),
               EID.POINT_OF_ENTRY,
               TO_DATE(EID.APPREHENSION_DATE),
               DACS.CASE_EID_CIV_ID,
               TO_DATE(DACS.CASE_DATE_OF_ENTRY,'YYYYMMDD'),
               DACS.CASE_CODE_ENTRY_PLACE,
               TO_DATE(DACS.CASE_DATE_APPR,'YYYYMMDD'),
               TO_DATE(DACS.CASE_DATE_DEPARTED,'YYYYMMDD'),
               DACS.SBI_UPDATE_STEP,
               DACS.SBI_CIV_ID
              FROM SBI_EID_W_VALID_ANUM_V EID,
               SBI_DACS_CASE_RECORDS DACS
              WHERE DACS.CASE_NBR_A = EID.ALIEN_FILE_NUMBER;
    BEGIN
         OPEN VALID_CIV_ID_FROM_EID;
         SAVEPOINT A;
    LOOP
         FETCH VALID_CIV_ID_FROM_EID INTO V_EID_CIV_ID, V_EID_DOE,
              V_EID_POE,V_EID_APPR_DATE,V_CASE_CIV_ID, V_CASE_DOE,
                   V_CASE_POE,V_CASE_APPR_DATE,V_CASE_DEPART_DATE,V_SBI_UPDATE_STEP,V_SBI_CIV_ID;
         DBMS_OUTPUT.PUT_LINE('BEFORE');
         EXIT WHEN VALID_CIV_ID_FROM_EID%FOUND;
         DBMS_OUTPUT.PUT_LINE('AFTER');
         UPDATE SBI_DACS_CASE_RECORDS
          SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_CASE_CIV_ID,
           SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 1
         WHERE V_CASE_CIV_ID IS NOT NULL
          AND V_CASE_CIV_ID <> 0;
         UPDATE SBI_DACS_CASE_RECORDS
          SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
           SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 2
         WHERE V_SBI_CIV_ID IS NULL AND V_SBI_UPDATE_STEP = 0
          AND V_EID_DOE = V_CASE_DOE
           AND V_EID_POE = V_CASE_POE
            AND V_EID_APPR_DATE = V_CASE_APPR_DATE
             AND V_EID_APPR_DATE = V_CASE_DEPART_DATE;
         UPDATE SBI_DACS_CASE_RECORDS
          SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
           SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 3
         WHERE V_SBI_UPDATE_STEP = 0
          AND V_EID_DOE = V_CASE_DOE
           AND V_EID_POE = V_CASE_POE
            AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
         UPDATE SBI_DACS_CASE_RECORDS
          SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
           SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 4
         WHERE V_SBI_UPDATE_STEP = 0
          AND V_EID_DOE = V_CASE_DOE
           AND V_EID_POE = V_CASE_POE
            AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) > -4
             AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) < 4 ;
         UPDATE SBI_DACS_CASE_RECORDS
          SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
           SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 5
         WHERE V_SBI_UPDATE_STEP = 0
          AND V_EID_DOE = V_CASE_DOE
           AND V_EID_POE <> V_CASE_POE
            AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
         UPDATE SBI_DACS_CASE_RECORDS
          SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
           SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 6
         WHERE V_SBI_UPDATE_STEP = 0
          AND V_EID_POE = V_CASE_POE
           AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
         UPDATE SBI_DACS_CASE_RECORDS
          SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
           SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 7
         WHERE V_SBI_UPDATE_STEP = 0
          AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
         UPDATE SBI_DACS_CASE_RECORDS
          SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
           SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 8
         WHERE V_SBI_UPDATE_STEP = 0
          AND V_EID_DOE = V_CASE_DOE
           AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) > -4
            AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) < 4;
         UPDATE SBI_DACS_CASE_RECORDS
          SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
           SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 9
         WHERE V_SBI_UPDATE_STEP = 0
          AND V_EID_DOE = V_CASE_DOE
           AND V_EID_POE = V_CASE_POE;
         UPDATE SBI_DACS_CASE_RECORDS
          SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
           SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 10
         WHERE V_SBI_UPDATE_STEP = 0
          AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) > -4
           AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) < 4;
    END LOOP;
    CLOSE VALID_CIV_ID_FROM_EID;
    COMMIT;
    END;Peter D.

  • Update sql statement in sender/receiver jdbc adapter

    Hi
    What is the update sql statement we give in the sender/ receiver adapter when
    1) SELECT statement was written in query sql statement
    2) EXECUTE statement was written for a stored procedure in query sql statement
    thanks
    Anitha

    > 1) SELECT statement was written in query sql statement
    your table should have some value "already_processed" which prevents a second processing of that table.
    the update statement sets that value.
    > 2) EXECUTE statement was written for a stored procedure in query sql statement
    the same as above.
    when your stored procedure already does the update, then write a second stored procedure which does nothing.

  • Xi JDBC Adapter - Query SQL Statement & Update SQL Statement

    Hi!
    I configure the JDBC adapter sender (XI) to take data from Oracle database.
    I set the Query and Update SQL Statement in the Processing parameters of the communication channel in this way:
    Query SQL Statement :
    SELECT * FROM XI_TABLE WHERE STATUS = 'WAIT' ORDER BY ROW_NUM
    Update SQL Statement :
    UPDATE XI_TABLE SET STATUS = 'DONE', DATE = SYSDATE WHERE STATUS = 'WAIT'
    My question is :
    If a new record with the field STATUS = 'WAIT' is added to the table (xi_table) during the time between the execution of the query statement and the start of the update statement, what will happen to that record during the update?
    There is a way to avoid the update of that record? or to pass to the update statement only the record selected in the query statement?
    Please, may you give me some example?
    Thanks,
    Francesco

    hi,
    did you check "Isolation Level for Transaction"
    for the sender jdbc adapter?
    http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
    Regards,
    michal

  • Sender JDBC adapter -- Update SQL statement NOT work for the last record

    I'm trying to use SAP XI to send records from Oracle database to As/400 using JDBC adapter.  I've defined the communication channel for sender
    (1)  The "Query SQL statement"  = select  a_bgn_dt,  a_end_dt from  PX_PXXD WHERE NOT CU_ACTION_CD='P' 
    (2)   The "Update SQL statement"  = update PX_PXXD set CU_ACTION_CD='P'  WHERE NOT CU_ACTION_CD='P' 
    Supposed that 3 records were retrieved from (1) and successfully updated to AS/400 but only the first 2 records in Oracle database are updated according to (2)
    Any advise.
    Pansy

    Hi Pansy,
    You select and update query is looking like wrong
    kindly check below query,If you are using oracle
    (1) The "Query SQL statement" = select a_bgn_dt, a_end_dt from PX_PXXD WHERE CU_ACTION_CD !='P'
    (2) The "Update SQL statement" = update PX_PXXD set CU_ACTION_CD='P' WHERE  CU_ACTION_CD !='P'
    Thank you
    Sateesh

  • Sender JDBC adapter : Update SQL Statement : stored procedure

    Hi,
    Can we use a stored procedure in the sender jdbc adapter in 'Update SQL Statement'.
    The problem i am facing is like, we are selecting data from two tables in 'SQL statement for query' and then in 'Update SQL Statement' , we need to delete that data from these two tables.
    Please let me know if it is possible.
    Thanks,
    Rohit

    you can use a Stored procedure in the
    Query SQL Statement
    You have the following options:
    ·        Specify a valid SQL SELECT statement to select the data to be sent from the specified database.
    ·        Specify an SQL EXECUTE statement to execute a stored procedure, which contains exactly one SELECT statement.
    The expression must correspond to the SQL variant supported by the relevant JDBC driver. It can also contain table JOINs.
    so have your whole select and update as part of this single Stored procedure

  • JDBC Sender update SQL Statement Question.

    I was wondering if there is a way to have the update SQL statement line in the JDBC sender update by time stamp, this would be very helpful.  Does anyone know a method of doing this?

    In the SAP documentation of the adapter it has this example for using the update SQL statement after the query statement:
    SQL statement for query: SELECT * FROM table WHERE processed = 0;
    SQL statement for update: UPDATE table SET processed = 1 WHERE processed = 0;
    What I want is to be able to put processed = (the current date) instead of processed =1 in the update statement, like this example:
    SQL statement for query: SELECT * FROM table WHERE processed = 0;
    SQL statement for update: UPDATE table SET processed = (the current date) WHERE processed = ' ';
    I seems like you can only use a fixed value for the update statements in the JDBC Sender though, I would like to know if you can use a time stamp or variable there.

Maybe you are looking for