Updated with the values in the same table, for other records corresponding to conditions

Hi Experts,

Sorry do not provide the structure of the table (it is a simple structure)

I have a requirement where I need to update the columns of a table based on the same table with some match empid and date values. If the date and empid match so I have these values to any other folder and update of one who is not having details of Office . I need the Update query

Before the update my array of values is as below

Sort_num Emp_id Bureau start_date

1 101 AUS 01/01/2013
2 101 01/01/2013
3 101 15/01/2013
4 103 USA 01/05/2013
5 103 01/01/2013
6 103 05/01/2013
7 104 FRA 01/10/2013
8 104 10/01/2013
9 104 01/01/2013

After update my table should be as below

Sort_num Emp_id Bureau start_date

1 101 AUS 01/01/2013
2 101 AUS 01/01/2013
3 101 15/01/2013
4 103 USA 01/05/2013
5 103 01/01/2013
6 103 USA 01/05/2013
7 104 FRA 01/10/2013
8 104 FRA 01/10/2013
9 104 01/01/2013

Thanks in advance

I don't have the time to create the table with the data, but basically, you should be able to code the following text

update one table

Office set = (select desktop in table b where b.emp_id = a.emp_id)

and b.start_date = a.start_date

and b.office is not null

)

where is ([as well as overall query])

and a.office is null

In my opinion, who will do the trick.

HTH - Mark D Powell.

Tags: Database

Similar Questions

  • OWB, I need to update the target table with the same field for game/update

    OWb, I try to update the target table with the game and the update on the same ground is this possible. I'm a match merge error indicating that you cannot update and match on the same ground. But in SQl is my selection

    Update table
    define RFID = 0
    where RFID = 1
    and ID_processus = 'TEST '.

    Can HWO I do this in OWB.

    I have check but in the case later (last one) that he warns no error if you can go with it.
    and I tested it it works

    You can check the first case (from where we start) if it has been warned and then try to run.

  • UPDATE on the same table in the sub query

    DB version: 11.2

    We have a table called SHP_GC_TRACK, which has about 8 million records with partitions. In the below UPDATE, it updates a column based on the SELECT on the same table in a subquery.
    UPDATE shp_gc_track a
       SET f_tran_proc  = 'Y'
     WHERE last_update_date <
              (SELECT MAX (last_update_date)
                 FROM shp_gc_track b
                WHERE a.shp_trx_rowid = b.shp_trx_rowid
                  AND a.c_shp_inst = b.c_shp_inst
                  AND a.f_tran_proc  = b.f_tran_proc 
                  AND b.f_ltr_received = 'D'
                  AND f_rec_code IN ('G', 'W')
                  AND b.f_rec_status = 'B'
                  AND b.c_shp_inst = :b1
                  )
       AND a.c_shp_inst = :b1
       AND a.f_ltr_received = 'D'             -----------------> part of composite index
       AND a.f_tran_proc  = 'N'              -----------------> part of composite index
       AND a.f_rec_code IN ('G', 'W')      --------------> part of composite index  
       AND a.f_rec_status = 'B';              -----------------> part of composite index  
    This UPDATE takes a long time to run and sometimes get hung up.

    We have a composite index on four columns f_ltr_received, f_rec_code, f_rec_status and f_tran_proc. Explain the plan shows that this composite index is used.



    Any way to rewrite this query or suggestion?

    Steve_74 wrote:
    DB version: 11.2

    We have a table called SHP_GC_TRACK, which has about 8 million records with partitions. In the below UPDATE, it updates a column based on the SELECT on the same table in a subquery.

    UPDATE shp_gc_track a
    SET f_tran_proc  = 'Y'
    WHERE last_update_date <
    (SELECT MAX (last_update_date)
    FROM shp_gc_track b
    WHERE a.shp_trx_rowid = b.shp_trx_rowid
    AND a.c_shp_inst = b.c_shp_inst
    AND a.f_tran_proc  = b.f_tran_proc
    AND b.f_ltr_received = 'D'
    AND f_rec_code IN ('G', 'W')
    AND b.f_rec_status = 'B'
    AND b.c_shp_inst = :b1
    )
    AND a.c_shp_inst = :b1
    AND a.f_ltr_received = 'D'             -----------------> part of composite index
    AND a.f_tran_proc  = 'N'              -----------------> part of composite index
    AND a.f_rec_code IN ('G', 'W')      --------------> part of composite index
    AND a.f_rec_status = 'B';              -----------------> part of composite index  
    

    This UPDATE takes a long time to run and sometimes get hung up.

    We have a composite index on four columns f_ltr_received, f_rec_code, f_rec_status and f_tran_proc. Explain the plan shows that this composite index is used.

    Any way to rewrite this query or suggestion?

    Setting updates with subqueries may be difficult: (.) Unfortunately my suggestions below are of the try-it-and-see-what-happens variety - nothing of certain

    First of all, check the index. Is it bitmap or tree? If the tree to see if the more restrictive columns are listed first - this can help with effectiveness of b-tree indexes. Also if the tree a composite bitmap for columns with lots of repeat values instead could help

    Its a correlated subquery so that you cannot run just the subquery first put the result in a scalar varaiable and using the variable in the SQL instead. You can try putting the keys w/join subuqery results in a TWG first to use TWG in SQL to see if I/O is reduced together during these two operations.

    You have the license for the parallel query option? Using parallel DML (this must be activated manually) can help. Check the documentation of the ALTER SESSION command to do so. In addition, the PARALLEL_INDEX() indicator could help

    Display the SQL execution plan

  • FRM - 40202:Field must be entered on two blocks with the same table

    I have two blocks, blockA and blockB, both from the same table that is tableX.

    When I ask of blockA and it worked, then I go to blockB and modify data, and save, there is no problem. But when I do not run the query of blockA or if the query did not return any results, I go to blockB and change some data then save, I got this error. The cursor then go to first blockA point. So now, I have to delete this empty line before the Save.


    Any suggestion?

    you set a few initial values programmatically for a block?
    in this case, the status changes to INSERT and you will get this message.
    You can check the staus with GET_RECORD_PROPERTY (1, "A BLOCK", STATUS), e.g. with the trigger KEY-COMMIT.

  • Why do an update with the same name every day to security update for Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package (KB2467175)

    I installed this point at least 6 times. is there a change in one update to another with the same name?

    Hi RogerMawdsley,
     
    Follow the steps listed in the article given below to resolve this issue:
  • Several updates on the same Table

    Hello

    I need to update the same Table (T1) but to filter for different conditions as below.
    and I have a set of filter conditions 50 and update the same table.

    Is it possible to get in the single update statement?

    BEGIN
    UPDATE T1
    SET PTA_CLM_CNT = v_PTA_CLM_CNT__77,
    PTB_CLM_CNT = v_PTB_CLM_CNT__77
    WHERE run_dt = v_in_parm_dt
    AND state_code = '77';
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    null;
    WHILE OTHERS THEN
    v_error_cd: = SQLCODE;
    v_error_msg: = SUBSTR (SQLERRM, 1, 200);
    v_curr_record: = 'sum_bene_state_updt_77 ' | v_in_parm_dt;
    create_error_log ('_sum_cnts', v_error_cd, v_error_msg, v_curr_record);
    END;

    BEGIN
    UPDATE T1
    SET PTA_CLM_CNT_ = v_PTA_CLM_CNT__78,
    PTB_CLM_CNT_ = v_PTB_CLM_CNT__78
    WHERE run_dt = v_in_parm_dt
    AND state_code = '78';
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    null;
    WHILE OTHERS THEN
    v_error_cd: = SQLCODE;
    v_error_msg: = SUBSTR (SQLERRM, 1, 200);
    v_curr_record: = 'sum_bene_state_updt_78 ' | v_in_parm_dt;
    create_error_log ('sum_cnts', v_error_cd, v_error_msg, v_curr_record);
    END;

    Thanks in advance

    May be trying to use DECODE

    UPDATE T1
       SET PTA_CLM_CNT = DECODE(state_code,77,v_PTA_CLM_CNT_77,78,v_PTA_CLM_CNT_78)
           PTB_CLM_CNT = DECODE(state_code,77,v_PTB_CLM_CNT_77,78,v_PTB_CLM_CNT_78)
     WHERE run_dt = v_in_parm_dt;
    
  • Windows Update is constantly updated with the same updates successfully, why?

    When I run updates on my computer, and then install one should it be installed they still install successfully.  But today I watched my story because it was as if I had already installed the same updates previously, and I reason I installed it successfully, the same updates several times.  Wear it the same number () after the name of the update.  Why is it that happens, is it supposed to do that? And if not how to fix it?

    See the article after some troubleshooting for your question:

    Windows Update or Microsoft Update repeatedly offers the same update

    http://support.Microsoft.com/kb/910339/en-us >

    Please let us know if it did or did not help to solve your problem.

    UTC/GMT is 19:02 Sunday, July 22, 2012

  • Connect many clips with the same information for a particular column

    I have 1000's of clips to open a session before I begin to change it, to share many common info such as day clips # or the name of the sponsor, location, etc.

    What would be the procedure and is there an easy way to select many clips and choose or enter information such as the date or location, etc. and have all selected clips connect this info. FCP had a very simple way to do this and would actually keep or mount the database that you enter and makes it really easy to connect many clips at once.

    Your help is greatly appreciated.

    You can select multiple clips in the tray at the same time.  When you go in the metadata Panel, the fields that can be entered massively will be available.

  • Report of the Summit with the details below for a record

    Hello

    I'm looking for an answer to my problem:

    We have a report that contains many ~ 60.

    And is not very user-friendly because it is so wide table.

    It is possible to see some less important columns as information additional report below.

    for a single record in the report. For example, the user selects the radio button of the first column and details are updated for this record.

    (if it is possible to group information in tabs)

    Thank you very much for your answers.

    Hello

    Here is an example

    https://Apex.Oracle.com/pls/Apex/Apex/f?p=39006:41

    Create a hidden item which is not protected. In my case the name of the element is P41_DEPTNO

    First report query

    select
    APEX_ITEM.RADIOGROUP(1,DEPTNO,:P41_DEPTNO) AS rg,
    EMPNO,
    ENAME,
    JOB,
    MGR,
    HIREDATE,
    SAL,
    COMM,
    DEPTNO
    FROM EMP
    

    Second report query

    select LOC,
      DNAME,
      DEPTNO
    from DEPT
    WHERE DEPTNO = :P41_DEPTNO
    

    In the second region report defined the elements of the Page to submit your name for the hidden item.

    Create dynamic action

    -event: change

    -Selection Type: jQuery Selector

    -jQuery selector: input [name = f01]

    -Action: Value set

    -Set type: Expression JavaScript

    -Expression JavaScript: this.triggeringElement.value;

    -Selection Type: Item (s)

    -Article (s):

    Then add an another true dynamic action event

    -Action: update

    -Selection Type: region

    -Region:

  • Using the same links for other pages

    Hello everyone. If a Web site has been created in photoshop CS6 and sliced and now in Dreamweaver, is it possible to copy the links from the homepage to the rest of the site. Example: Welcome, words, products, contact us. Who are the main links on the home page, the rest of the site have the same words, so once the links have been created on the home page, is it possible to copy/past these links in other pages of the site, without having to redo all the links for each page.

    Thank you

    Why, Atl

    CS6

    Hello everyone. If a Web site has been created in photoshop CS6 and sliced and now in Dreamweaver

    The worst way possible to create a website - it is guaranteed to break unexpectedly.

    Study the use of the library for your main menu items. One item, a change-> each page...

  • When I try to update 9.3 I get an error indicating that the update cannot be verified because I'm no longer connected to Internet when I am in fact. Tried to restart and run the update with the same problem. Any suggestions?

    9.3 update installation error

    Apple withdrew temporarily updating iOS 9.3 for devices more old to deal with some issues, what he was creating. Better to wait a few days for them to correct problems.

  • Catalog updated with the new location for photos

    Due to a failure of car, I had to restore my library to/Volumes/Data/Users/fred/Pictures/to/Volumes/USB1/photos /.

    I 30 000 pictures in my catalog.  How do I update the catalog so that it uses the new path to pictures?

    I'm on Max OSX 10.10.3 and Lightroom 5.5.

    Lightroom think my photos are missing - how to fix? Lightroom Queen

  • Help with career within the same table and find the relevant rank.

    HI all the gurus

    Pls help me out here... I need to implement some which is dependent on SUPERIOR record following found regarding one earlier. Some examples of data.

    create table SOR_OFF (OFF_ID, OFFS_ID number, REPORT number, CON_DATE number date, STATE varchar2 (20));

    REM INSERTING into  SOR_OFF
    SET DEFINE OFF;
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (987,349,30658,to_date('12-SEP-04','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (988,349,30658,to_date('29-DEC-98','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (990,349,30658,to_date('29-JUL-96','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (991,350,30658,to_date('27-NOV-90','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (992,352,30658,to_date('04-OCT-91','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (993,353,30658,to_date('12-JUN-95','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (994,353,30658,to_date('21-NOV-83','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (995,355,30658,to_date('21-APR-94','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (996,356,27250,to_date('23-SEP-94','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (997,357,30658,to_date('15-MAY-95','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (998,358,30658,to_date('13-JAN-93','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (999,358,30658,to_date('13-MAR-93','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1000,359,30658,to_date('17-DEC-96','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1003,360,30658,to_date('22-JUN-92','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1004,361,30658,to_date('15-FEB-94','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1006,362,30658,to_date('26-JUL-94','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1007,364,30658,to_date('01-JUL-92','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1009,365,30658,to_date('20-MAY-99','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1010,365,30658,to_date('01-JUL-99','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1011,366,30658,to_date('18-JUN-84','DD-MON-RR'),'Deleted');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1012,366,30658,to_date('15-JUL-94','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1013,366,30658,to_date('15-JUL-94','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1014,367,30658,to_date('07-NOV-94','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1015,368,30658,to_date('29-MAY-90','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1016,369,30658,to_date('10-SEP-92','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1020,370,30658,to_date('07-JUL-92','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1026,372,30658,to_date('23-JUL-93','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1027,373,30658,to_date('30-OCT-96','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1030,375,30658,to_date('03-OCT-91','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1034,376,30658,to_date('20-APR-95','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1037,378,30658,to_date('07-APR-92','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1039,379,30658,to_date('26-JAN-94','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1040,380,30658,to_date('12-MAY-93','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1041,381,30658,to_date('08-JAN-93','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1042,382,13428,to_date('27-JAN-92','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1043,383,30658,to_date('19-APR-91','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1044,384,30658,to_date('17-DEC-54','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1045,385,27884,to_date('03-APR-90','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1046,386,28480,to_date('01-DEC-92','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1048,388,30658,to_date('18-AUG-92','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1050,389,3894,to_date('26-AUG-88','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1051,389,30658,to_date('09-APR-96','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1053,391,30658,to_date('30-NOV-90','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1054,392,30658,to_date('27-MAY-93','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1055,393,3894,to_date('05-JUN-91','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1056,394,30658,to_date('29-MAY-96','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1057,395,3894,to_date('15-JUL-94','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1058,396,30658,to_date('22-FEB-91','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1061,398,30658,to_date('14-MAR-90','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,CON_DATE,STATUS) values (1062,398,30658,to_date('14-MAR-90','DD-MON-RR'),'Active');
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (52810,37334,27250,'ACTIVE',to_date('25-JUL-01','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (52811,37334,27250,'ACTIVE',to_date('23-NOV-08','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (21648,17315,27250,'Deleted',to_date('02-JAN-05','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (24740,17315,27250,'ACTIVE',to_date('05-JAN-05','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (8622,6410,27250,'Active',to_date('26-JUN-98','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (44079,6410,27250,'ACTIVE',to_date('27-OCT-08','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (54828,38266,13428,'ACTIVE',to_date('31-JUL-96','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (55278,38266,13428,'ACTIVE',to_date('10-SEP-98','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (55279,38266,13428,'ACTIVE',to_date('13-NOV-01','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (48172,34748,17442,'ACTIVE',to_date('03-SEP-02','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (48173,34748,17442,'ACTIVE',to_date('01-APR-05','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (45319,33194,9950,'ACTIVE',to_date('03-APR-98','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (45320,33194,9950,'ACTIVE',to_date('21-FEB-06','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (46803,34029,30862,'ACTIVE',to_date('05-MAY-06','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (46804,34029,30862,'ACTIVE',to_date('26-OCT-06','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (53886,34029,30658,'ACTIVE',to_date('18-NOV-09','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (13479,11608,14966,'Active',to_date('16-NOV-99','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (13480,11608,14966,'Active',to_date('01-JAN-01','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (60251,40687,27250,'ACTIVE',to_date('23-JAN-09','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (60252,40687,27250,'ACTIVE',to_date('14-JUL-09','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (17454,14278,604,'Active',to_date('10-AUG-99','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (17455,14278,1232,'Active',to_date('27-OCT-03','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (52438,37084,27250,'ACTIVE',to_date('23-JUL-03','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (52648,37084,27250,'ACTIVE',to_date('17-FEB-04','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (20653,16456,27250,'Deleted',to_date('02-JUN-04','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (31000,16456,0,'Deleted',null);
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (38241,16456,27250,'ACTIVE',to_date('28-APR-05','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (54130,37980,1232,'ACTIVE',to_date('08-MAR-00','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (56129,37980,1232,'ACTIVE',to_date('07-AUG-08','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (55025,38388,30622,'ACTIVE',to_date('06-DEC-98','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (55032,38388,30622,'ACTIVE',to_date('01-DEC-10','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (55517,38657,27884,'ACTIVE',to_date('04-FEB-10','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (55518,38657,27884,'ACTIVE',to_date('17-AUG-09','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (55519,38657,27884,'ACTIVE',to_date('21-JUL-09','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (44764,32871,12408,'ACTIVE',to_date('18-JUN-04','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (44765,32871,12408,'ACTIVE',to_date('16-JUN-04','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (44766,32871,12408,'ACTIVE',to_date('16-JUN-04','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (19076,15174,27250,'ACTIVE',to_date('02-NOV-02','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (50173,15174,1232,'ACTIVE',to_date('16-SEP-08','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (45046,33005,27250,'ACTIVE',to_date('03-SEP-92','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (45160,33005,27250,'ACTIVE',to_date('08-FEB-01','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (45161,33005,27250,'ACTIVE',to_date('06-NOV-06','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (44118,32387,27250,'ACTIVE',to_date('22-MAR-96','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (44119,32387,9950,'ACTIVE',to_date('30-DEC-04','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (44120,32387,9950,'ACTIVE',to_date('28-SEP-05','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (48418,34888,19586,'ACTIVE',to_date('02-MAR-90','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (48419,34888,28480,'ACTIVE',to_date('18-DEC-07','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (48420,34888,28480,'ACTIVE',to_date('24-AUG-04','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (43307,31893,29598,'ACTIVE',to_date('26-APR-04','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (43437,31893,9950,'ACTIVE',to_date('20-SEP-07','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (53612,37738,13428,'ACTIVE',to_date('28-JUN-04','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (53613,37738,15208,'ACTIVE',to_date('15-DEC-08','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (21555,17241,13428,'ACTIVE',to_date('11-JUN-99','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (21556,17241,13428,'ACTIVE',to_date('02-JAN-02','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (41336,30685,14966,'ACTIVE',to_date('07-OCT-03','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (42363,30685,9950,'ACTIVE',to_date('20-NOV-06','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (50926,36355,30862,'ACTIVE',to_date('13-DEC-07','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (50928,36355,30862,'ACTIVE',to_date('13-SEP-07','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (25520,20471,27250,'ACTIVE',to_date('06-JUN-98','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (25521,20471,0,'ACTIVE',to_date('31-AUG-04','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (2035,1069,30658,'Active',to_date('29-JAN-92','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (36762,1069,9950,'ACTIVE',to_date('16-MAY-05','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (36763,1069,9950,'ACTIVE',to_date('17-AUG-05','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (29807,23548,18458,'ACTIVE',to_date('18-AUG-00','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (29826,23548,17868,'ACTIVE',to_date('13-AUG-02','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (12818,10852,1232,'Active',to_date('01-JUN-98','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (12988,10852,1232,'Active',to_date('01-JUL-00','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (44287,32502,27884,'ACTIVE',to_date('10-JAN-08','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (44917,32502,9950,'ACTIVE',to_date('09-JUL-08','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (14430,12464,15070,'Active',to_date('03-APR-02','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (14431,12464,30658,'Active',to_date('08-NOV-89','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (42691,12464,30622,'ACTIVE',to_date('18-JAN-06','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (21608,17278,14966,'ACTIVE',to_date('03-AUG-00','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (25145,17278,14966,'ACTIVE',to_date('01-NOV-00','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (54918,38323,17868,'ACTIVE',to_date('21-MAR-02','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (55607,38323,17868,'ACTIVE',to_date('22-APR-10','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (28304,22497,1232,'ACTIVE',to_date('29-NOV-01','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (40755,22497,1232,'ACTIVE',to_date('13-DEC-06','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (13239,11318,19002,'Deleted',to_date('01-APR-99','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (13240,11318,19002,'Active',to_date('01-JAN-00','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (54317,38064,14966,'ACTIVE',to_date('01-DEC-99','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (54318,38064,30862,'ACTIVE',to_date('14-OCT-05','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (60404,38064,30658,'ACTIVE',to_date('31-AUG-11','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (60405,38064,30658,'ACTIVE',to_date('31-AUG-11','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (52800,37327,27250,'ACTIVE',to_date('27-JUN-02','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (52801,37327,27250,'ACTIVE',to_date('27-JUN-02','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (52802,37327,27250,'ACTIVE',to_date('19-DEC-99','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (41154,30599,27250,'ACTIVE',to_date('02-APR-02','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (46115,30599,27250,'ACTIVE',to_date('15-SEP-04','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (48532,34983,1232,'ACTIVE',to_date('16-SEP-05','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (48533,34983,1232,'ACTIVE',to_date('16-SEP-06','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (26868,21438,1232,'ACTIVE',to_date('13-JAN-05','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (26909,21438,1232,'ACTIVE',to_date('13-DEC-05','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (54646,38177,28480,'ACTIVE',to_date('02-DEC-99','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (54647,38177,28480,'Deleted',null);
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (54648,38177,28480,'ACTIVE',to_date('01-NOV-04','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (26924,21471,10672,'ACTIVE',to_date('16-JAN-97','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (27385,21471,10672,'ACTIVE',to_date('12-NOV-97','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (27404,21471,3894,'ACTIVE',to_date('02-MAR-01','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (40329,30063,28480,'ACTIVE',to_date('07-OCT-02','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (40407,30063,28480,'ACTIVE',to_date('27-OCT-05','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (27949,22235,27250,'ACTIVE',to_date('07-JUL-98','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (27950,22235,27250,'ACTIVE',to_date('07-JUL-03','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (32387,25414,19032,'ACTIVE',to_date('18-APR-00','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (46214,25414,19032,'ACTIVE',to_date('18-APR-06','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (32226,25340,30658,'ACTIVE',to_date('25-MAY-05','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (33363,25340,27884,'ACTIVE',to_date('11-SEP-99','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (33364,25340,27884,'ACTIVE',to_date('08-FEB-01','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (55789,38840,1830,'ACTIVE',to_date('22-MAR-98','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (55790,38840,1830,'ACTIVE',to_date('22-MAR-98','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (55792,38840,1830,'ACTIVE',to_date('20-MAR-06','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (1976,1026,30658,'Active',to_date('21-JUN-94','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (47881,1026,1232,'ACTIVE',to_date('25-SEP-09','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (47882,1026,1232,'ACTIVE',to_date('21-JUN-04','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (13820,11900,27250,'Active',to_date('15-MAY-98','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (35519,11900,27250,'ACTIVE',to_date('18-JAN-99','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (35520,11900,27250,'ACTIVE',to_date('14-AUG-00','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (35521,11900,30658,'ACTIVE',to_date('03-DEC-02','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (35524,11900,30658,'ACTIVE',to_date('21-MAR-06','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (35525,11900,27250,'ACTIVE',to_date('29-AUG-01','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (26168,20977,27250,'ACTIVE',to_date('24-OCT-05','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (27644,20977,27250,'Deleted',to_date('29-OCT-05','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (27764,20977,27250,'Deleted',to_date('28-OCT-05','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (50681,20977,27250,'ACTIVE',to_date('28-OCT-05','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (49856,35737,27250,'ACTIVE',to_date('03-DEC-97','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (49858,35737,27250,'ACTIVE',to_date('19-JUL-07','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (41260,30649,27250,'ACTIVE',to_date('01-JUL-98','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (41261,30649,27250,'ACTIVE',to_date('01-JUN-98','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (8290,6012,14966,'Active',to_date('16-OCT-98','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (8291,6012,14966,'Active',to_date('24-FEB-99','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (49978,35835,9950,'ACTIVE',to_date('10-SEP-01','DD-MON-RR'));
    Insert into  SOR_OFF (OFF_ID,OFFS_ID,STATE,STATUS,CON_DATE) values (49979,35835,9950,'ACTIVE',to_date('31-MAY-06','DD-MON-RR'));
    

    What I want is less than

    -Search for a line more low which is CON_DATE > = to_date ('01-NOV-1998', ' MON-DD-YYYY "") AND STATE = 30658 and get the second row whose state = 30658 but having separate con_date

                               or CON_DATE = > = to_date (November 1, 1997 ',' MON-DD-YYYY "") AND STATE <>30658 & get the second row including State = 30658 but having separate con_date

    and lower (status) = 'active '.


    and get another line that extends beyond the found line, but having separate con_date (no operation of the same day.)

    I tried to do it with and then attach it again with the same table, but I don't get different results...

    Please advise.

    Hello

    n_shah18 wrote:

    NO Frank

    Thanks for trying.

    First find a line that corresponds

    ((CON_DATE > = to_date (1er novembre 1998 ', ' MON-DD-YYYY ") AND STATE = 30658))

    or (CON_DATE > = to_date (November 1, 1997 ',' MON-DD-YYYY "") AND STATE <> 30658))


    8 second get/check the following line immediately for offs_id even that has different con_date, that is superior to prev con_date but State should be 3065


    If offs_id found then return else throw line...


       


    Thus, in addition to the conditions that I listed previously, there must be a line with the same offs_id, which has a con_date later and the State concerned; is this fair?

    You can use a self-join to see if there is such an extra line:

    WITH params AS

    (

    SELECT TO_DATE (November 1, 1998 ', 'DD-Mon-YYYY') AS later_threshold_date

    AS target_state 30658

    11900 AS target_offs_id

    OF the double

    )

    SELECT s.offs_id

    OF s sor_off

    JOIN params p ON s.offs_id = p.target_offs_id

    AND ((s.con_date > = p.later_threshold_date))

    AND s.state = p.target_state

    )

    OR (s.con_date > = ADD_MONTHS (p.later_threshold_date, 12))

    AND s.state <> p.target_state

    )

    )

    JOIN sor_off ON s2.offs_id = s.offs_id s2

    AND s2.con_date > s.con_date

    AND s2.state = p.target_state

    GROUP BY s.offs_id

    ;

    The only difference between this and the previous solution is the last join, in other words, the 3 lines of code just before the GROUP BY clause.

  • PREVENT CONNECTION WITH THE SAME CREDENTIALS

    I developed an application. I gave 5 business users access, but more users are using it in connection with the same user name and password. I use custom authetication based on apex.

    Is it possible to prevent two simultaneous connection with the same credentials.

    Thank you

    Umesh

    A suggestion, it is NOT perfect...

    You must use custom authentication... In this configuration, you add a column to the table with user names, call it online and use a car1. When the user connects and you check their authentication, if it passes, you update the table with a 'Y' in the line with their ID card.

    When they log out, you're going to run a process to update at the same table, replacing the 'Y' by "n" or null...

    So when a user connects, you will also verify their line use an if the column is set to 'Y', then your custom authentication MUST return the error that this connection is already recorded...

    Thank you

    Tony Miller
    Webster, TX

    Follow your passion; the rest will take care of itself.

    JMS

    If you answer this question, please mark the thread as closed and give points where won...

  • I have two folders in the same subdirectory with the same name. How to remove the extra folder?

    I have 2 directories "documents" located in the same directory. They are as well located in C:\Documents and Settings\ [user_name]------directory. Duplicate folder is automatically updated with the same file names when I add files in the original folder. It looks like a pointer to the original folder, when I try to delete the duplicate directory. I get the following error message.

    Can't delete My Documents: it is used by another person or program.
    Close all programs that might be using the file and try again.

    I deleted all files in the directory, rebooted the computer and attempted to delete the now empty folder and I get the same error message. Can you help me remove this duplicate folder.

    Note:
    ------

    I am not able to rename the duplicate folder... If I try to rename, the original folder is renamed... But not the duplicate. Also the duplicate folder becomes empty (since it runs a pointer to the original folder, when the double original of renowned gets is empty)

    Mager

    In Windows XP, all user folders were located under the C:\Documents and Settings folder.

    In Vista , all user folders are located under the folder C:\Users .

    Vista Documents and Settings folder is not a real file it's a junction folder that points to the Folder C:\Users.

    A junction is as a shortcut that points to another file, that is why these records have a shortcut (arrow) overlay icon. In Vista, the only reason why the Documents and Settings junction is for the old installers who are looking for a Documents and Settings folder. When they try to access the folder Documents and Settings, the junction in silence re - runs Setup to the C:\Users folder.

    The default permissions for the Documents and Settings junction is access denied, even for the administrators of .

    The only way that a user can access this file actually is if the access permissions have been changed.

    For a more detailed description of this topic and a list of all the junctions see the following Web site.

    Windows Vista Junction Points:
    http://www.Svrops.com/Svrops/articles/jpoints.htm

    I recommend that you move all your files and immediately stop using the Documents and Settings folder to avoid more problems.

    If this just started recently, I recommend that you use the system restore back to a point before the documents and settings folder was first access.

    Ronnie Vernon MVP

Maybe you are looking for