Update field to a specific time

Hello,
Is is possible to update a column from a table, when sysdate is equal to a select which returns a date?
for example: i have a YEARS table, with 2 columns, start_date and end_date. periodically in this table are inserting years. when sysdate=start_date, i wanna be automatically updated a field into another table. i don't know how to do this, maybe you'll help me.
Regards,
Edited by: Roger22 on 20.04.2009 13:58

We've written a wrapper package around dbms_job package for job scheduling but unfortunately, i'll not be able to post the code here because they are the property of my company. I'd suggest you to look into the documentation for dbms_job package. Their are various procedures like dbms_job.submit, dbms_job.run etc available in this package.
I'd suggest you to create a script for the below query and store the script name in a new table (which will have details about the jobs to run, their frequency, type etc). dbms_job will use the script name and run it at the defined interval.
Hope it helps.
Please mark answer as helpful / correct, if it helps you
Navnit

Similar Messages

  • Can I set my macbook to install updates at a specific time? My internet is limited through the day but between 2am and 7am it is unlimited?

    My internet is limited through the day and I want to know if I can set a specific time for updates to be carried out to make sure my macbook is working efficiently.

    Yes. When you get a notification that an update is available, select "Try Tonight". That will constrain the update to occur between 2:00 and 5:00 AM.

  • Scheduling specific time of day for automatic software updates

    How can one schedule a specific time of day (i.e. between 11:01 pm to 5.59 am when I have unlimited download availability) for an iMac to search for automatic software updates? System preferences only offer frequency, but no time option. If it is possible to schedule a specific time, will invoking the feature override the sleep function, wake up the machine and perform the software update and then let the machine go back to "sleep?" Thank you for all your help.

    to clarify barney's suggestion, the following terminal command will download all available updates and put them in your Downloads folder.
    softwareupdate -d --all
    so what you need to do is this.
    1. turn off automatic software update in software update system preferences.
    2. make a cron or a launch daemon to run the above terminal command periodically at the time of your choosing. to make a launch daemon I recommend using lingon http://tuppis.com/lingon/
    The daemon will only run if the computer is not asleep at the scheduled time so you might want to set to to wake/start shortly before that. this is done in system preferences->energy saver->schedule.
    to install the updates once they are downloaded double-click on the pkg files and follow the instructions.

  • Is it possible to schedule updates for a specific time of day like 12am?

    Is it possible to schedule updates for a specific time of day like 12am?

    No. If you use Automatic Updates, the apps update when the updates are available. Read this for a little more information.
    http://9to5mac.com/2013/09/20/ios-7-how-to-set-up-automatic-app-updates/

  • Can you schedule the downloading of app updates to a specific time?

    Can you schedule the downloading of app updates to a specific time?

    I honestly wouldn't do that.  You have no idea if the software update server will be properly functioning then.  Also you should always backup your data prior installing updates. 
    Note when you install updates, you also have the option to install later, but just download first.
    Always make sure the updates work with each other by finding out the requirements from the developer before installing.  A clone backup will let you recover yourself to the point before the install, if you do it right.

  • Query the date field for specific time

    I need to be able to run a query on a date field that retrieves specified times.
    Any ideas???

    You could do something like
    SELECT *
      FROM someTable
    WHERE to_char(date_column, 'HH24:MI:SS') = '17:01:04';Justin

  • How to update fields in multiple tables ?

    Dear all,
    What is the fastest way to update fields in multiple tables... from a single change table...as below is my code to update the fields but it is taking long time to update as i need to keep log file if any one update fails....
    CREATE OR REPLACE
    package body DO_DC_NAME_UPDATE_OTHER_TAB
    as
    type rowidArray is table of rowid index by binary_integer;
    type custRec is record
    n_cust_ref_no dbms_sql.number_table,
    v_name dbms_sql.varchar2_table,
    v_name_chg dbms_sql.varchar2_table,
    rowid rowidArray,
    changed dbms_sql.varchar2_table
    procedure VALIDATE_CUST_NAME( p_n_cust_ref_no in number,p_v_name_chg in out NOCOPY varchar2, p_changed in out NOCOPY varchar2 )
    is
    begin
    FOR cr_cust IN (SELECT --a.n_cust_ref_no,a.v_name,UPD_V_NAME, a.n_weight,a.V_LASTUPD_INFTIM
    from GNMT_CUSTOMER_MASTER_CHG where n_cust_ref_no=p_n_cust_ref_no)
         loop
    -- v_name
    if nvl(trim(cr_cust.v_name),0) != nvl(p_v_name_chg,0)
    then
              p_v_name_chg := p_v_name_chg;
              --p_v_name := p_v_name;
              p_changed := 'Y';
    end if;
         end loop;
    end;
    procedure DO_NAME_UPDATE_OTHER_TAB
    is
    l_record custRec;
    l_array_size number default 20000;
    l_done boolean;
    l_cnt number default 1;
    cursor c is select a.n_cust_ref_no, a.v_name,a.v_name_chg, a.rowid, 'N'
                        from GNMT_CUSTOMER_MASTER_CHG a--,GNMT_CUSTOMER_MASTER b
                        where a.v_name <> trim(a.v_name_chg); --and  a.n_cust_ref_no in (1434775,1561181,1601870);
    begin
    open c;
    loop
    dbms_application_info.set_client_info
    ( 'processing ' || l_cnt || ' thru ' || (l_cnt+l_array_size-1) );
    fetch c bulk collect into l_record.n_cust_ref_no, l_record.v_name,l_record.v_name_chg,l_record.rowid, l_record.changed
    LIMIT l_array_size;
    l_done := c%notfound;
    --dbms_output.put_line ('message10');
    for i in 1 .. l_record.n_cust_ref_no.count
    loop
    VALIDATE_CUST_NAME(l_record.n_cust_ref_no(i),l_record.v_name_chg(i),l_record.changed(i) );
    end loop;
    --dbms_output.put_line (l_record.n_cust_ref_no(i)||','||l_record.V_OCCUP_CODE(i)||','||l_record.CHANGED(i));
    /*forall i in 1 .. l_record.n_cust_ref_no.count
    update GNMT_CUSTOMER_MASTER q
    set q.v_name = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.v_name) = l_record.v_name(i)
    and l_record.changed(i) = 'Y';*/
    -- update v_name in all the related tables
    forall i in 1 .. l_record.n_cust_ref_no.count
    update ADE_CUSTOMER_MASTER q
    set q.v_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.v_name) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update GNMT_POLICY_DETAIL q
    set q.v_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.v_name) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update GNMT_QUOTATION_DETAIL q
    set q.v_NAME =l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.v_name) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update NBDT_BENEFICIARY q
    set q.V_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.V_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update PSDT_NOMINATION_TRANSACTION q
    set q.V_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.V_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update PSMT_POLICY_BENEFICIARY q
    set q.V_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.V_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    commit;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update PSMT_POLICY_TRUSTEE q
    set q.V_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.V_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update PSMT_QUOTATION_BENEFICIARY q
    set q.V_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.V_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update PSMT_QUOTATION_TRUSTEE q
    set q.V_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.V_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    commit;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update GNDT_BLACKLIST_DETAIL q
    set q.v_FNAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.v_FNAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_FNAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update INDT_LIAM_DETAIL q
    set q.v_FNAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.v_FNAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_FNAME is not null;
    commit;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update GNMT_POLICY q
    set q.V_PAYER_NAME = l_record.v_name_chg(i)
    where q.N_PAYER_REF_NO = l_record.n_cust_ref_no(i)
    and trim(q.V_PAYER_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.V_PAYER_NAME is not null;
    commit;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update GNMT_QUOTATION q
    set q.V_PAYER_NAME = l_record.v_name_chg(i)
    where q.N_PAYER_REF_NO = l_record.n_cust_ref_no(i)
    and trim(q.V_PAYER_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.V_PAYER_NAME is not null;
    commit;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update GNMT_QUOTATION q
    set q.V_PROPOSER_NAME = l_record.v_name_chg(i)
    where q.N_PROPOSER_REF_NO = l_record.n_cust_ref_no(i)
    and trim(q.V_PROPOSER_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.V_PROPOSER_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update GNMT_POLICY q
    set q.V_PROPOSER_NAME = l_record.v_name_chg(i)
    where q.N_PROPOSER_REF_NO = l_record.n_cust_ref_no(i)
    and trim(q.V_PROPOSER_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.V_PROPOSER_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update CLMT_CLAIM_MASTER q
    set q.V_CLIENT_NAME = l_record.v_name_chg(i)
    where q.N_CLIENT_REF_NO = l_record.n_cust_ref_no(i)
    and trim(q.V_CLIENT_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.V_CLIENT_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update CLMT_CLAIM_MASTER q
    set q.V_INTIMATOR_NAME = l_record.v_name_chg(i)
    where q.N_CLIENT_REF_NO = l_record.n_cust_ref_no(i)
    and trim(q.V_INTIMATOR_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.V_INTIMATOR_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update PYMT_VOU_MASTER q
    set q.V_PAYEE_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.V_PAYEE_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.V_PAYEE_NAME is not null;
    /*forall i in 1 .. l_record.n_cust_ref_no.count
         INSERT INTO GNMT_CUSTOMER_MASTER_LOG
              (N_CUST_REF_NO, V_TITLE_CODE, V_NAME, D_BIRTH_DATE, V_SEX, V_RELIGION_CODE, V_NATION_CODE, V_OCCUP_CODE, V_ALIVE, V_SMOKER,
              N_NO_STICKS, D_DEATH_DATE, V_BUMI_NON_BUMI, V_AGE_ADMITTED, V_SHORT_NAME, V_FIRST_NAME, V_LAST_NAME, V_EMAIL, V_DESIGNATION,
              N_HEIGHT,N_WEIGHT,V_TITLE_CODE_CHG, V_NAME_CHG, D_BIRTH_DATE_CHG, V_SEX_CHG,V_RELIGION_CODE_CHG,V_NATION_CODE_CHG, V_OCCUP_CODE_CHG, V_ALIVE_CHG,
              V_SMOKER_CHG, N_NO_STICKS_CHG, D_DEATH_DATE_CHG,V_BUMI_NON_BUMI_CHG, V_AGE_ADMITTED_CHG, V_SHORT_NAME_Chg, V_FIRST_NAME_Chg,
              V_LAST_NAME_Chg, V_EMAIL_Chg, V_DESIGNATION_Chg,N_HEIGHT_Chg,N_WEIGHT_Chg, V_UPD_STATUS_DC,-- V_LASTUPD_PROG, V_LASTUPD_INFTIM,
              V_LASTUPD_USER_DC, V_LASTUPD_PROG_DC,V_LASTUPD_INFTIM_DC
              SELECT N_CUST_REF_NO, V_TITLE_CODE, V_NAME, D_BIRTH_DATE, V_SEX, V_RELIGION_CODE, V_NATION_CODE, V_OCCUP_CODE, V_ALIVE, V_SMOKER,
              N_NO_STICKS, D_DEATH_DATE, V_BUMI_NON_BUMI, V_AGE_ADMITTED, V_SHORT_NAME, V_FIRST_NAME, V_LAST_NAME, V_EMAIL, V_DESIGNATION,
              N_HEIGHT,N_WEIGHT,V_TITLE_CODE_CHG, V_NAME_CHG, d_birth_date_chg, V_SEX_CHG, V_RELIGION_CODE_CHG,V_NATION_CODE_CHG, V_OCCUP_CODE_CHG, V_ALIVE_CHG,
              V_SMOKER_CHG, N_NO_STICKS_CHG, D_DEATH_DATE_CHG, V_BUMI_NON_BUMI_CHG, V_AGE_ADMITTED_CHG, V_SHORT_NAME_Chg, V_FIRST_NAME_Chg,
              V_LAST_NAME_Chg, V_EMAIL_Chg, V_DESIGNATION_Chg,N_HEIGHT_Chg,N_WEIGHT_Chg--, V_LASTUPD_USER, V_LASTUPD_PROG, V_LASTUPD_INFTIM
              ,'PROCESSED'
              ,user,--P_USER,
              'DC_PAKAGE',
              sysdate--P_DATE
              FROM GNMT_CUSTOMER_MASTER_CHG where n_cust_ref_no =l_record.n_cust_ref_no(i)
              --and n_cust_ref_no not in (select n_cust_ref_no from GNMT_CUSTOMER_MASTER_LOG);*/
    exit when (l_done);
    l_cnt := l_cnt + l_array_size;
    end loop;
    commit;
    end;
    end;
    thank You

    Dear SeánMacGC thanks for reply,
    But "a.changed" is not a field in GNMT_CUSTOMER_MASTER_CHG. what i am doing in this procedure is i am collecting bulck data and validating field by field from GNMT_CUSTOMER_MASTER_CHG with GNMT_CUSTOMER_MASTER table as their structure is same.. if v_name is not same as v_name_chg then i am setting changed flag to "Y" changed is "changed dbms_sql.varchar2_table" and updating GNMT_CUSTOMER_MASTER in bluck where changed flag ='Y'...
    type custRec is record
    n_cust_ref_no dbms_sql.number_table,
    v_name dbms_sql.varchar2_table,
    v_name_chg dbms_sql.varchar2_table,
    rowid rowidArray,
    *changed dbms_sql.varchar2_table*
    i cannot use simple SQL as i need to validate field for each records with GNMT_CUSTOMER_MASTER_CHG and insert into log file as well.....
    to run this procedure:
    execute DO_DC_NAME_UPDATE_OTHER_TAB.DO_NAME_UPDATE_OTHER_TAB;
    Thanks...

  • Updated field in IC Agent Inbox

    Hi Forum,
    What is the "Updated" field in agent inbox? Am not able to see any values in that when I search for service requests. Please help me on how to show the updated date in that.
    Regards,
    Shridhar

    Hi Shridhar,
    I am afraid the "Updated" field is not managed at all.
    If you look at workbench component ICCMP_INBOX, view InboxItems, context > context nodes > tree structure > tree node proxy > double-clic on class CL_ICCMP_IN_INBOXITEMS_CN02, double-clic on method GET_LASTUPDATE. Statement "clear value." indicates no value is returned.
    Now you could enhance view ICCMP_INBOX,/InboxItems with custom code, and set your own content into method CL_ICCMP_IN_INBOXITEMS_CN02->GET_LASTUPDATE.
    Do not count on reporting framework to provide the value for that field. Although structure CRMT_REPORT_LOCATORLIST foresees it, it is not filled with value by search query: see method CL_CRM_QUERYAUI_RUN_BTIL->GET_RESULT_LIST to get exact list of fields returned. CREATED_AT_DATE field is part of it, but not  CHANGED_AT_DATE.
    But you may perform the re-read of last change date even in CL_ICCMP_IN_INBOXITEMS_CN02->GET_LASTUPDATE method, because SAP already takes advantage of user-buffering in function CRM_ORDER_READ.
    So adding following code to CL_ICCMP_IN_INBOXITEMS_CN02->GET_LASTUPDATE should show you correct last update
    data:
      lv_header_guid type crmt_object_guid,
      lt_guids       type crmt_object_guid_tab,
      ls_req_obj     type crmt_object_name,
      lt_req_obj     type crmt_object_name_tab,
      lt_orderadm_h  type crmt_orderadm_h_wrkt,
      lv_date        type sydatum,
      lv_time        type syuzeit.
    lv_header_guid ?= me->bo->get_property( 'GUID' ). 
    check lv_header_guid is not initial.
    insert lv_header_guid into table lt_guids.
    ls_req_obj = 'ORDERADM_H'.
    insert ls_req_obj into table lt_req_obj.
    call function 'CRM_ORDER_READ'
      exporting
        it_header_guid       = lt_guids
        it_requested_objects = lt_req_obj
      importing
        et_orderadm_h        = lt_orderadm_h
      exceptions
        others               = 4.
    if sy-subrc is initial.
      read table lt_orderadm_h into crmt_orderadm_h_wrk index 1.
      if sy-subrc is initial.
        CONVERT TIME STAMP crmt_orderadm_h_wrk-changed_at TIME ZONE sy-zonlo
            INTO DATE lv_date TIME lv_time.
      may need to convert first to strings
        concatenate lv_date lv_time into value separated by space.
      endif.
    endif.
    Hope you can use these ideas
    Kind regards
    Walter

  • Render at a Specific Time Every Day

    Is there a way to have a specific Final Cut Pro project to render automatically at a specific time every day?
    I work at a CG house, and shots are updated at random intervals, but are always in a fixed, specific location. So by rendering out the project everyday we would always have an up to date complete edit. And by automating it it could be rendered off hours and be ready first thing in the morning for review.

    Or page 548 of Volume III, if you're on Final Cut Pro 5 (FCStudio 1).
    'Main Menu/Final Cut Pro/User Preferences/General tab'
    FCS2 may allow specific time of day, but FCS1 simply lets you set a period of time (while the program is open, but idle). So set it for 2 hours, leave FCP open when your last editor leaves the office.
    This also offers several choices on which sequences you actually want to 'auto-render'.
    K

  • How to change the ownership of a doc after a specific time in workflow ?

    Hi
    My objective is to create a workflow in ESO , that will change the ownership of a contract document from the current person to his supervisor ( supervisor's id will be in user id management page) after a specific time .
    Please help me how to do it ?
    I am using TWE editor for workflow design
    Regards
    Swastik

    To prepare a computer for sale or donation, in addition to the steps mentioned in this support article, take these steps:
    If you set a firmware password, remove it by running Firmware Password Utility in Recovery mode.
    If you activated FileVault in OS X 10.7 or later, turn it off.
    If you use Boot Camp, the partition must be deleted
    If you created any other data partitions on the internal drive, remove them in Disk Utility.
    Erase the data partition(s) with the option to zero out data. An SSD doesn't need to be zeroed.
    You can't legally or practically transfer any software downloaded from the Mac App Store to the new owner of the machine, even if it was free. That includes OS X, so if you paid for an upgrade OS X 10.7 or later, you must reinstall  the original OS, either from the installation media, if applicable, or by booting into Internet Recovery (option-command-R at the startup chime.)
    The new owner will have to repurchase the software, if need be, under his or her Apple ID. If you ever updated the bundled iLife applications (Garage Band, iMovie, and iPhoto) through the App Store, you can't transfer them either.
    Remove the machine from your list of registered products. If it's still covered by an AppleCare Protection Plan, transfer the coverage to the new owner by following the instructions in the AppleCare Terms and Conditions (under the heading "Transfer of Plan.")

  • Field for GR Processing time in CLM

    Hi Experts,
    Is there any suitable field available in standard CLM system to maintain "GR processing time" in master agreement line item, to publish it into ECC?
    I also request to advice business relevance of below fields of master agreement line item (in CLM). If we maintain values in those fields of a master agreement and publish data to ERP, which of the fields in outline agreement must update?
    Field
    Description
    Program Lead Time (Days)
    Enter the lead time required to set up the program, if any.
    Order Lead Time (Days)
    Enter the lead time the supplier requires to place orders for items.
    Delivery Lead Time (Days)
    Enter the number of days to allow between order and delivery of the line item.
    Minimum Order Quantity
    Enter the minimum quantity of the line item you are contracted to order from the supplier.
    Please advice.
    With regards,
    Prabhakar

    Hi
    If GR processing time in Material Master say 5 days Then..
    During MRP run or when Scheduling or forcasting is done then this Lead time will be addd...
    Now inhouse production time eg 5 in days ......means it  determine the planned dates for planned orders in materials planning.
    This will add little valu in your understanding..
    Sujit

  • How to call hr_location_api.create_location for different address style with only those fields that belongs specific to  that address style.

    How to call hr_location_api.create_location for different address style with only those fields that belongs specific to  that address style. It should decide at run time means at run time it will come to know the type of address style and based on that only the fields which belong to address details mapped to calling hr_location_api.create_location.
    Thanks in advance.

    You can create a wrapper package on top of the API (hr_location_api.create_location)
    In the wrapper package you set all the values dynamically based on your requirements(say the style and add_line columns are populated on your conditions) and then you call the API.
    Does that not work ?

  • Splitting rows at specific times (not intervals)

    Greetings.
    I have a data set with fields that hold start and end times for specific events. These events have unique ID's and cross multiple time intervals. I'm looking for a way to split a single row in the dataset into multiple rows with new start and end times for each relevant time interval.
    The examples I've found online describe ways (using the MODEL method) to split rows based on time intervals of a fixed length (24 hours, for example) but I'm looking for a way to split the records at a specific time (at 6am and 6pm.)
    So this record set:
    <tt>SELECT ID, START_DATE, END_DATE FROM EVENTTABLE
    _ ID __________ Start_date __________ End Date _____
    1228322 __ 21-NOV-11 17:51:29 __ 21-NOV-11 19:32:27
    1228327 __ 21-NOV-11 14:53:24 __ 22-NOV-11 03:46:06
    1228334 __ 21-NOV-11 03:32:53 __ 21-NOV-11 05:13:13
    1183267 __ 25-SEP-11 16:09:13 __ 27-SEP-11 04:38:11</tt>
    Would become:
    <tt>SELECT ID, START_DATE, END_DATE FROM EVENTTABLE MODEL...
    _ ID __________ Start_date __________ End Date _____
    1228322 __ 21-NOV-11 17:51:29 __ 21-NOV-11 18:00:00
    1228322 __ 21-NOV-11 18:00:00 __ 21-NOV-11 19:32:27
    1228327 __ 21-NOV-11 14:53:24 __ 21-NOV-11 18:00:00
    1228327 __ 21-NOV-11 18:00:00 __ 22-NOV-11 03:46:06
    1228334 __ 21-NOV-11 03:32:53 __ 21-NOV-11 05:13:13
    1183267 __ 25-SEP-11 16:09:13 __ 25-SEP-11 18:00:00
    1183267 __ 25-SEP-11 18:00:00 __ 26-SEP-11 06:00:00
    1183267 __ 26-SEP-11 06:00:00 __ 26-SEP-11 18:00:00
    1183267 __ 26-SEP-11 18:00:00 __ 27-SEP-11 04:38:11</tt>
    Notice that record 1183267 starts in one interval, crosses two whole intervals and ends in a fourth. This splitting of one event into many is required to create a record set that will guarantee a record for each of the relevant intervals.
    Thanks in advance for your consideration!

    SonyDADCuser wrote:
    Greetings.
    I have a data set with fields that hold start and end times for specific events. These events have unique ID's and cross multiple time intervals. I'm looking for a way to split a single row in the dataset into multiple rows with new start and end times for each relevant time interval.
    The examples I've found online describe ways (using the MODEL method) to split rows based on time intervals of a fixed length (24 hours, for example) but I'm looking for a way to split the records at a specific time (at 6am and 6pm.)
    So this record set:
    <tt>SELECT ID, START_DATE, END_DATE FROM EVENTTABLE
    _ ID __________ Start_date __________ End Date _____
    1228322 __ 21-NOV-11 17:51:29 __ 21-NOV-11 19:32:27
    1228327 __ 21-NOV-11 14:53:24 __ 22-NOV-11 03:46:06
    1228334 __ 21-NOV-11 03:32:53 __ 21-NOV-11 05:13:13
    1183267 __ 25-SEP-11 16:09:13 __ 27-SEP-11 04:38:11</tt>
    Would become:
    <tt>SELECT ID, START_DATE, END_DATE FROM EVENTTABLE MODEL...
    _ ID __________ Start_date __________ End Date _____
    1228322 __ 21-NOV-11 17:51:29 __ 21-NOV-11 18:00:00
    1228322 __ 21-NOV-11 18:00:00 __ 21-NOV-11 19:32:27
    1228327 __ 21-NOV-11 14:53:24 __ 21-NOV-11 18:00:00
    1228327 __ 21-NOV-11 18:00:00 __ 22-NOV-11 03:46:06
    1228334 __ 21-NOV-11 03:32:53 __ 21-NOV-11 05:13:13
    1183267 __ 25-SEP-11 16:09:13 __ 25-SEP-11 18:00:00
    1183267 __ 25-SEP-11 18:00:00 __ 26-SEP-11 06:00:00
    1183267 __ 26-SEP-11 06:00:00 __ 26-SEP-11 18:00:00
    1183267 __ 26-SEP-11 18:00:00 __ 27-SEP-11 04:38:11</tt>
    Notice that record 1183267 starts in one interval, crosses two whole intervals and ends in a fourth. This splitting of one event into many is required to create a record set that will guarantee a record for each of the relevant intervals.
    Thanks in advance for your consideration!Neat problem.
    This assumes you have a reasonably recent version of Oracle, and i only tested it for your "complex" case spanning multiple days because i didn't want to type out a bunch of sample data. Should work on all your data sets though (i always say this when i do incomplete testing :).
    with
      time_data as
      select
          1                                                         as col1
        , to_date('25-sep-2011 16:09:13', 'dd-mon-yyyy hh24:mi:ss') as start_date
        , to_date('27-sep-2011 4:38:11', 'dd-mon-yyyy hh24:mi:ss')  as end_date
      from dual
    select *
    from
      select
          col1
        , greatest
              trunc(t.start_date, 'dd') - interval '6' hour + (interval '12' hour * m.column_value)
            , t.start_date
          ) as start_date
        , least
              trunc(t.start_date, 'dd')  + interval '6' hour + (interval '12' hour * m.column_value)
            , t.end_date
          ) as end_date
      from time_data t,
        table(cast(multiset(select level from dual connect by level <= ceil(end_date - start_date) * 2) as sys.odcinumberlist)) m
    where start_date < end_date;

  • Counting records in a specific time block per day

    I have a scenario where I need to find the number of records in a table called 'DEALS', for a specific time frame (in this case 8am until 9am where the date field stores dates in the following format '06/01/2005 08:23:35'). I need to run this query to include each business day between two dates (ie., june 1, 2005 until current_date).
    In addition, this query has to take into account only Users that are ACTIVE in a second table called 'DEALUSERS'
    I have worked out the following to get the overall record set, but it is not narrowed down to just the specified time frame, nor does it produce the count for each day's 8:00-9:00 time frame.
    SELECT fdls.DEALDATE, user.USERROLE
    FROM DEALS dls, DEALUSER user
    WHERE dls.CLIENTUSERID = user.USERID
    AND user.STATUS = 'ACTIVE'
    AND dls.PROXYTRADEFLAG = 'YES'
    AND dls.MODENAFLAG = 'YES'
    AND TRUNC(dls.DEALDATE)
    BETWEEN TO_DATE('06/01/2004 08:00:00', 'MM-DD-YYYY HH:MI:SS')
    AND current_date
    I tried using the following at the end of the above query, but it doesn't work - any ideas? :confused:
    AND TO_CHAR(EXTRACT('HOUR' FROM DEALTS)) = '8'
    Can someone help, pls :o

    Not quite sure what you ultimately want here, but something like:
    SELECT TRUNC(dls.dealdate, 'hh'), user.userrole, count(*)
    FROM deals dls, dealuser user
    WHERE dls.clientuserid = user.userid AND
          user.status = 'ACTIVE' AND
          dls.proxytradeflag = 'YES' AND
          dls.modenaflag = 'YES' AND
          dls.dealdate BETWEEN TO_DATE('06/01/2004 08:00:00', 'MM-DD-YYYY HH:MI:SS') AND current_date and
          TO_CHAR(dls.dealdate, 'hh24') = '08'
    GROUP BY TRUNC(dls.dealdate, 'hh'), user.userroleshould give you some ideas.
    HTH
    John

  • How to update field in table FAGLFLEXA/FAGLFLEXT

    Hi Gurus,
         we are stay in ECC 5.00. The new g/l have activated but we have not assigned the relevant scenario to the ledger (Refer note no 990612)
         now we have assinged following field:
         FIN_CCA: RCNTR (Cost center), SCNTR (Sender cost center)
         FIN_CONS: RASSC (Trading partner), RMVCT (Transaction Type)
         FIN_GSBER: RBUSA (Business area), SBUSA (Trading partner's business area)
         FIN_PCA: PRCTR (Profit Center), PPRCTR (Partner Profit Ctr)
         FIN_SEGM: SEGMENT (Segment), PSEGMENT (Partner segment)
         FIN_UKV: RFAREA (Functional Area), SFAREA (Partner Functional Area)
         our problem is the data was posted before that does not update fields in table FAGLFLEXA/FAGLFLEXT,How to update field in table FAGLFLEXA/FAGLFLEXT?
    Thanks,

    Hello Jenjira,
    Since this was a question asked few years back, I think you can share your experience with activation of a Scenario subsequent to Go-Live of new GL functionality (We are contemplating activation of one more scenario for Functional Area updation in new GL. 4 update scenarios were activated at time of New GL Implementation 4 years ago).
    Please share following:
    1. Impact of this subsequent activation on Open documents in the live system.
    2. How you addressed the issues arising on Point 1.
    3. Any support that you got from SAP Support Team on issues thereof.
    Any inputs will be of great help.

Maybe you are looking for

  • Adobe Media Encoder Question

    Hey everyone! So I just switched from using AE CS5.5 to AE CC, which now has me use the Media Encoder to render all my files, which frankly is AWESOME. However, I sometimes like to render out a piece of a long video I'm editing so I can get a glimpse

  • ClassNotFoundException trying to replication session state...

              Help! This has been bugging me for almost a week now and noone's been able to shed           any light on it. My evaluation of the product is about to end and, as things currently           stand, I've concluded that "it doesn't work"! Sure

  • Blank Workflow from PCR

    Hello, We have implemented PCR for Change Position using custom Workflow. The problem is random where in we can see the workf item raised but when you click on the work item log it is blank. This causes the portal to error when the user clicks on the

  • Sales order created in past went in to credit blocked

    Hi, I created a sales order last month it went in to credit blocked . And realeased also. After that many orders have been created and many time payment also have been revieved Can I check the credit position of that day when I created the order to k

  • Cannot take a picture with Camileo X100?

    After connecting my Camileo X100 with the RCA connector to my LG LCD TV, browsing through my pictures and eventually unplugging the camera, something wierd happened. After I turned the camera on and tried to take a picture, nothing happened. I can't