CASE, SYSDATE + 1

Hello

About: Oracle 11 g 2 on Windows

..

CASE

WHEN Service = 'task 1' AND (P_TASK_DATE = (sysdate) + 1) THEN DO_TASK_2

END AS TASK_2

...

When the conditions are true null is returned in the column

Cannot quite understand why.

Thanks for your help!

Hello

user545194 wrote:

Hello

About: Oracle 11 g 2 on Windows

..

CASE

WHEN Service = 'task 1' AND (P_TASK_DATE = (sysdate) + 1) THEN DO_TASK_2

END AS TASK_2

...

When the conditions are true null is returned in the column

Cannot quite understand why.

Thanks for your help!

Are you sure that the conditions are right?  Remember, all DATEs in Oracle (including the DATE returned by SYSDATE) include the hours, minutes and seconds, even though they are not displayed.  (Always display hours, minutes and seconds when debugging a problem with DATE comparisons.)  Maybe you should do something like

AND p_task_date > = TRUNC (SYSDATE + 1).

AND p_task_date<  trunc="" (sysdate="" +="">

For example, if p_task_date is 00:00:00 10 may 2014, the condition

p_task_date = (SYSDATE) + 1

will be TRUE for 1 second, when SYSDATE is exactly 00:00:00 on May 9.  If SYSDATE is even a second later, then the condition you posted will be not true, but the condition I posted will be set to TRUE for 24 hours when SYSDATE is anywhere between 00:00:00 to 23:59:59 on 9 May.

The status of treatment in 2-piece I posted above will be faster (maybe faster) than

TRUNC (p_task_date) = TRUNC (SYSDATE) + 1

but otherwise equivalent.

There is also the possibility that do_task_2 returns NULL.

Tags: Database

Similar Questions

  • Statement of Pivot complex?

    Hi all

    I need to fix a bunch of code hack which consists of several union statements that I can count. All unions use the same table and where clauses.

    What we currently have, is something like:

    Select asset_id,

    cases where construction_date is null then 1 or 0 end as long as documents,.

    -case when construction_date is null then 'date invalid construction' as problem

    of asset_table

    UNION

    Select asset_id,

    When construction_date is null and that payment_date-case < sysdate-50 and 0 otherwise 1 end as long as documents,.

    When construction_date is null and that payment_date-case < sysdate-50 then 'paid but not built"as problem

    of asset_table

    So, as it looks that I went and did the following:

    Select asset_id,

    case when construction_date is null then 1 or 0 end as "date invalid construction."

    When construction_date is null and that payment_date-case < sysdate - 50 then 1 0 otherwise end as "paid but not built."

    of asset_table

    The issue I'm facing now, is that I have a few capital records that meet several conditions, i.e. they have no valid and paid construction dates but not built in a single resource row 1 (historically, there are 2 ranks - I need to have 2 rows to generate reports.)

    How can I go on making rotate this return all about give 2 + ranks when several conditions are met?

    Thank you so so so much!

    Several ways to address the issue, but the collections are a good approach.  With a collection you can add several controls you want, everything will be solved independently.

    CREATE or REPLACE type TY_NUMBERS as array of numbers

    /

    CREATE or REPLACE type TY_ARGUMENTS as table of varchar2 (32767)

    /

    with asset_table (asset_id, construction_date, payment_date) as)

    Select 1, null, sysdate-50 in all double union

    Select option 2, null, sysdate-52 Union double all the

    Select 3, null, sysdate-50 in all double union

    Select 4, null, sysdate-53 double

    ),

    qryValues as)

    Select asset_id,

    TY_NUMBERS (case when construction_date is null then 0 otherwise 1 end)

    where construction_date is null and payment_date< sysdate="" -50="" then="" 1="" else="" 0="" end)="" multiset="" except="" distinct="" ty_numbers(null)="" as="">

    TY_ARGUMENTS (case when construction_date is null then end 'date of the invalid construction',

    where construction_date is null and payment_date< sysdate="" -50="" then="" 'paid="" but="" not="" constructed'="" end)="" multiset="" except="" distinct="" ty_arguments(null)="" as="">

    of asset_table

    )

    Select asset_id, r.COLUMN_VALUE as a RECORD, p.COLUMN_VALUE as ISSUE

    of qryValues v

    Join table (v.records) r 1 = 1

    Join table (v.problems) p on 1 = 1

    ASSET_ID RECORD PROBLEM
    1 1 "invalid construction date.
    1 0 "invalid construction date.
    2 1 "invalid construction date.
    2 1 "paid but not built."
    3 1 "invalid construction date.
    3 0 "invalid construction date.
    4 1 "invalid construction date.
    4 1 "paid but not built."

    Note: Operators of type multiset in the query clear up collections after the resolution, you can change these as required. For example, multiset except TY_NUMBERS (null) separate = eliminates duplicates and nulls

  • The computer crashes: something to do with the minidump and sysdata.xml?

    My computer broke down twice now and restart an error message pops up saying "your computer has recovered from a serious error". It is said that two files in the error report will be sent to microsoft. the first complete mini103106 - 01.dmp and the second sysdata.xml

    I could find these files and delete them but have no idea if this would solve the problem and do not want to do the wrong thing...

    Hello

    Not easy to say why this is happening, but for me it s definitely something wrong with the software.
    Well, in this case we can only speculate. You know, it s Microsoft Windows and sometimes things happens without any reason :(

    I have heard from probably the system restore function could be corrupted and no have deleted the folder with the minidump and disabled the system restore feature in the control panel-> system.

    But in my opinion, the system restore function is important and necessary if you want to restore the operating system to the beginning.
    That's why I put t recommend disabling this feature.

  • C:\Windows\Minidump\Mini082813-01.dmp C:\Users\Angel\AppData\Local\Temp\WER-496863-0.sysdata.xml C:\Users\Angel\AppData\Local\Temp\WERA939.tmp.version.txt

    C:\Windows\Minidump\Mini082813-01.dmp
    C:\Users\Angel\AppData\Local\Temp\WER-496863-0.SysData.XML
    C:\Users\Angel\AppData\Local\Temp\WERA939.tmp.version.txt

    Jane doe00

    We need the DMP file because it contains the single record of the sequence of events that led to the accident, what drivers have been loaded, and what has been loaded.

    WE NEED AT LEAST TWO FILES DMP TO SPOT TRENDS AND TO CONFIRM THE DIAGNOSIS.
    You may be able to get the DMP files without crashing by booting in SafeMode (F8) with networking.
    If you are overclocking stop.  (chances are that if you are unsure if you are, you are not)
    To allow us to help you with symptoms BSOD on your computer, download the contents of your folder "\Windows\Minidump".
    The procedure:
    * Copy the contents of \Windows\Minidump to another location (temporary) somewhere on your machine.
    * Zip up the copy (compress)
    * Please download to a service like Skydrive or "Rapidshare" to share files and put a link to them in your answer.
    Link to find out how to download below.
    To ensure the minidumps are enabled:
    * Click Start, in the search box, type: sysdm.cpl, press ENTER.
    * On the Advanced tab, click Startup and recovery... Settings button.
    * Make sure that automatically restart is unchecked.
    * Under the writing debugging information header, select image partial memory (256 KB) in the list box drop-down (varies from 256kb).
    * Ensure to that small Dump Directory is listed as % systemroot%\Minidump.
    * OK your way out.
    * Reboot if changes have been made.
    Please also run MSinfo32 and download the output as well.
    To run MSinfo32 please go to start > run > MSinfo32
    Go to 'file', 'save' and download the PDF is saved with the DMP
    System specs are extremely useful then please include everything you know.

    Blue screen view and that crashed are often wrong and should only be used in case of emergency...

    You can learn more about BSOD here
    You will learn how to test your memory here 


    Team Zigzag3143.com  
  • Blue screen Crash 0x7a error - whenever I play a game fullscreen (in this case, Fallout New Vegas)

    original title: Blue Screen Crash - whenever I play a game fullscreen (in this case, Fallout New Vegas)

    For some reason that I was constantly blue screen crashes whenever I'm playing Fallout New Vegas on my computer. I'm positive my computer takes care of everything, I will list the specs below. He broke down twice today while I played for a good two and a half hours before the first, but then when I rebooted and went back into the game, he has frozen almost immediately so I ended the process. Then I tried once more, maybe got 10 minutes of play until a third crash...

    Here are my specs;

    Biostar H55 HD motherboard Intel

    Intel i3 to 2.93 GHz processor

    Mushkin 4 GB Ram DDR3 (1333 MHZ)

    500 GB Seagate HDD

    NVidia GeForce GTS 450 graphics card

    Orion HP650D 650W PSU

    I went into the Device Manager and ensured that all my drivers are up to date, that don't seem to not be.

    Here are the final details of the accident.

    1

    Signature of the problem:
    Problem event name: BlueScreen
    OS version: 6.1.7600.2.0.0.768.3
    Locale ID: 4105

    More information about the problem:
    BCCode: 7A
    BCP1: FFFFF6FC400070C8
    BCP2: FFFFFFFFC000000E
    BCP3: 00000000108BA860
    BCP4: FFFFF88000E19008
    OS version: 6_1_7600
    Service Pack: 0_0
    Product: 768_1

    Files helping to describe the problem:
    C:\Windows\Minidump\111010-25156-01.dmp
    C:\Users\Adam\AppData\Local\Temp\WER-51921-0.SysData.XML

    2

    Signature of the problem:
    Problem event name: BlueScreen
    OS version: 6.1.7600.2.0.0.768.3
    Locale ID: 4105

    More information about the problem:
    BCCode: f4
    BCP1: 0000000000000003
    BCP2: FFFFFA8005B20B30
    BCP3: FFFFFA8005B20E10
    BCP4: FFFFF800031855D0
    OS version: 6_1_7600
    Service Pack: 0_0
    Product: 768_1

    Files helping to describe the problem:
    C:\Windows\Minidump\111010-31187-01.dmp
    C:\Users\Adam\AppData\Local\Temp\WER-42468-0.SysData.XML

    If someone could give me a hand I would be very grateful, it became extremely frustrating :(

    Hi Adam,.

    This method works.

    the sfclog tells me that the files in this folder are damaged:

    C:\Program Files\Windows Sidebar\Gadgets\Weather.Gadget\images

    Replace them with the files of your DVDs:

    http://blog.NirSoft.NET/2009/09/17/how-to-extract-missing-system-files-from-the-DVD-of-Windows-7vista/

    BugCheck CRITICAL_OBJECT_TERMINATION (f4)
    A process or thread crucial to system operation has unexpectedly left or been
    terminated.

    1 crash is probably caused by: csrss.exe

    ExceptionCode: c0000005 (access violation)

    the second accident is caused by your HARD disk:
    MODULE_NAME: hardware_disk

    FAILURE_BUCKET_ID: X64_0xF4_IOERR _C000000E_IMAGE_hardware_disk

    Your disk has i/o errors causing Windows to fail. Back up all the data and check the HARD drive with a diagnostic tool.

    "A programmer is just a tool that converts the caffeine in code" Deputy CLIP - http://www.winvistaside.de/

  • How can you change the time of database (Sysdate) without changing the hour of the OS?

    I saw the archived post:

    "How can I change the date/time data (Sysdate) without changing the date of the OS? to https://community.oracle.com/message/3471626#3471626 "" "" "

    This post does not have a good answer unfortunately and as we have problems similar change of system clock where urgent need to do some future and passed the test of logic date/time, I thought it would be to try again. Anyone know how we could accomplish this change of date/time of database without changing the clock system of the OS?

    Thank you

    Charles

    Time Machine by Solution-Soft (Time Machine® |) Virtual clock for Time Shift and Application tests) provides a solution to this problem by using virtual clocks to specified users or PIDs and intercepts calls to the OS providing system clock is the case of a virtual clock.  So if a virtual clock set for 022823592016 for Oracle user, this OS user would see this date in every process owned and all connections to a DB owned instance would return a date and time just before the leap day of "systimestamp select from dual;"  There is a framework of Time Machine for Oracle on the market of the Oracle Cloud which is much more granular than this example and allows the travel time of the specific Oracle connections per user, host, or the name of the JDBC program.   Check here: https://cloud.oracle.com/marketplace/listing/4382882

  • How to force the object mixed case names in REST GET SQL service

    Hello

    Version of ADR: 3.0.1.177.18.02

    Apex version: 5.0.1.00.06

    DB version: 12.1.0.2

    GlassFish 4.1 Community Edition

    I am creating a web service using the method = GET and source type = query using names of objects with different cases.  The web service is forcing my lowercase object names.

    I know I can set the web service by changing the type of PL/SQL source to hand and create manually using htp.prn, mixed case works when I do this.

    But it is a huge SQL except for the forced lowercase, such works as required.

    Example of

    Create a simple web service test, type GET, type source query.

    select sysdate as "currentDate" from dual
    
    

    The result will be

    {"currentdate": "2015-11 - 23 T 12: 44:25Z '}

    and not the expected

    {"currentDate": "2015-11 - 23 T 12: 44:25Z '}

    Is there a way to tell the engine to keep the case and do not force lowercase?  apex_json is case-sensitive, which makes this weird behavior.

    declare
       json   varchar2 (32767) := '{"firstName":"Olafur Tryggvason"}';
    begin
       apex_json.parse (json);
       dbms_output.put_line ('Mixed case: ' || apex_json.GET_VARCHAR2 ('firstName'));
       dbms_output.put_line ('Lowercase: ' || apex_json.GET_VARCHAR2 ('firstname'));
    end;
    
    

    Will display:

    Executed PL/SQL block

    Mixed case: Olafur Tryggvason

    Tiny:

    Concerning

    Olafur,

    Post edited by: Olafur T Added version information

    Just got a response from an SR that I created.  camelCase is not supported.  Workaround is creating it in pl/sql.

  • Case instructions within a Where clause clause

    Hello group,

    I know this has been asked several times, but I do not enter simply to a tuition assistance box in a WHERE clause.  So I need help:

    My current WHERE the clause reads:

    A16. FULL_DATE between (SELECT (TRUNC (SysDate - 8)) From Dual) and (select (TRUNC (SysDate - 2)) double)

    However, I need to 'automate' a bit, based on the current time/day of the month.  I need my instruction box to say:

    (Case when to_char (sysdate-3, 'mm') <>to_char (sysdate, 'mm')

    then the a16. FULL_DATE (between SELECT (trunc (ADD_MONTHS ((LAST_DAY(SysDate-3)),-1)+1) and (SELECT (add_months (trunc(SysDate-2)-1)) of double)))

    Of another a16. FULL_DATE between (SELECT trunc (ADD_MONTHS ((LAST_DAY (SysDate)),-1)+1) From Dual) and (select (TRUNC (SysDate - 2)) From Dual)

    However, I have an error on "Else".  Can someone explain what is the problem and how to fix it?  I tried both 'then' and 'Else' syntax and both will run individually.  So I'm quite sure that he does not like my CASE statement in general.

    In advance, thank you for your help.

    Don

    I can't tell what your business logic, so here's a simple example of an instruction box in the where clause:

    SQL > select *.
    2 double
    3 where dummy = case when extracted (sysdate months) = 9 then 'W '.
    4 Once extracted (sysdate months) = 10 then 'X '.
    When 5 extract (month from sysdate) = 11 then 'Y '.
    6                      else 'Z'
    7                 end
    8;

    D
    -
    X

  • With the help of sysdate and systimestamp etc. in ViewCriteria

    Hello

    I have a VO based analytic query that performs some stacks based on time.

    This table based VO, for example 'all items sold 10 days ago 4 days ago' County, now open a search page. Which will be displayed exactly all items sold in this time.

    In a first part of the soln to achieve, I started and created Scvs for the different periods I have. For the field soldDate (timestamp), I created a condition using the clause "between (soldDate between to_timestamp(sysdate-10) and to_timestamp(sysdate-4)). But I realized that it does not work. I used the link variable and the option "expression" instead of "literal" for the value of bind variables and the VO test throws an exception. Of course, he does not expect these constructions.

    QTS is how I could accomplish this kind of condition to be applied to a VC.

    I know that I put as a sql string and add to the place where clause. A VC based soln is possible.

    I use version 11.1.x.x.x of Jdev and not 12 c .x

    Kind regards

    I'm not sure what exactly you have defined in the VC (VC Editor screenshot would probably help)

    In any case, you probably need something like this: http://adfspecialists.blogspot.ba/2012/12/adf-view-criteria-view-criteria-row.htm

    Dario

  • Compare sysdate with date column value

    Hello

    I need to compare the current_date (sysdate) with the value of column date in the sql below.

    Current_date is sysdate in the sql below.

    Can someone please let me know if the below sql is correct.

    SELECT ZZ. ZIP_CDE

    CC. CITY_NAM

    CC. ST_ABBR

    ZZ. ZIP_CDE_TYP_CDE

    ZZ. ZIP_CDE_STRT_DTE

    OF MDMGEO. T_CITY CC

    MDMGEO. ZC T_ZIP_CITY

    MDMGEO. ZZ T_ZIP_CODE

    MDMSTGGEO. T_USPS_DETAIL_RECORD_distinct T

    WHERE CC. CITY_GNRTD_ID = ZC. CITY_GNRTD_ID

    AND ZZ. ZIP_CDE = ZC. ZIP_CDE

    AND ZZ. ZIP_CDE_STRT_DTE = ZC. ZIP_CDE_STRT_DTE

    AND CURRENT_DATE BETWEEN ZZ. ZIP_CDE_STRT_DTE

    AND ZZ. ZIP_CDE_END_DTE

    AND CURRENT_DATE BETWEEN ZC. ZIP_CITY_STRT_DTE

    AND ZZ. ZIP_CDE = T.DTL_ZIP_CDE

    AND CC. CITY_NAM = PRFRD_LST_LINE_CITY_ST_KEY_NAM T.

    AND CC. ST_ABBR = T.ZIP_ST_ABBR_CDE

    Thank you!

    I want to sleep... maybe too ZZ

    In any case, apparently. What is the problem if necessary?

  • Case mix with Nested ifs statement

    Hello I need to mix a case statement with a few nested ifs, but I get an error I do not know how to start or complete the case statement. I've shortened the statement FOR readability

    Here is the code:

    < tt >

    BEGIN

    FOR events IN (SELECT EBA_CA_EVENTS. EVENT_NAME, EBA_CA_EVENTS. EVENT_ID,...)

    LOOP

    If the events. TYPE_ID <>(32230291965131516245569156552736940921) AND to_date (SYSDATE) = ((to_date (to_char (events. ((EVENT_DUE_DATE, "DD-MON-YYYY HH24:MI:SS"), "HH24:MI:SS MON-DD-YYYY"))-events. EVENT_NOT1)

    THEN

    Dbms_output.put_line ('adjustments of the SEND E-MAIL Alert 1 "criteria);

    on the other

    If the events. TYPE_ID = (32230291965131516245569156552736940921) and nvl(events.COMPLETED_MAIL_SENT,0) <>room ')

    THEN

    Dbms_output.put_line ('SEND EMAIL FILLED WITH TERRY');

    UPDATE EBA_CA_EVENTS set COMPLETED_MAIL_SENT = piece ') where ROW_KEY = events. ROW_KEY;

    on the other

    If the events. TYPE_ID <>(32230291965131516245569156552736940921) AND to_date (SYSDATE) = ((to_date (to_char (events. ((EVENT_DUE_DATE, "DD-MON-YYYY HH24:MI:SS"), "HH24:MI:SS MON-DD-YYYY"))-events. EVENT_NOT2)

    THEN

    Dbms_output.put_line (' fits the criteria 2nd SEND E-MAIL alert 2 "");

    on the other

    If the events. TYPE_ID <>(32230291965131516245569156552736940921) AND to_date (SYSDATE) = ((to_date (to_char (events. ((EVENT_DUE_DATE, "DD-MON-YYYY HH24:MI:SS"), "HH24:MI:SS MON-DD-YYYY"))-events. EVENT_NOT3)

    THEN

    Dbms_output.put_line ('fits the 3rd criteria SENDING E-MAIL Alert 3 ");

    end if; -4

    end if; -3

    end if; -2

    end if; -1

    CASE

    Events WHEN. EVENT_NOT2 is null

    THEN

    If to_date (SYSDATE) > ((to_date (to_char (events. ((EVENT_DUE_DATE, "DD-MON-YYYY HH24:MI:SS"), "HH24:MI:SS MON-DD-YYYY"))-events. EVENT_NOT1) AND nvl (events. ALERT1_SENT, 0) part <>')

    THEN

    Dbms_output.put_line ('send e-mail if day part 1');

    UPDATE EBA_CA_EVENTS set ALERT1_SENT = piece ') where ROW_KEY = events. ROW_KEY;

    end if;

    END

    other cases

    Events WHEN. EVENT_NOT2 is NOT NULL

    THEN

    If to_date (SYSDATE) > ((to_date (to_char (events. ((EVENT_DUE_DATE, "DD-MON-YYYY HH24:MI:SS"), "HH24:MI:SS MON-DD-YYYY"))-events. EVENT_NOT1) AND nvl (events. ALERT1_SENT, 0) part <>') AND to_date (SYSDATE) < ((to_date (to_char (events. ((EVENT_DUE_DATE, "DD-MON-YYYY HH24:MI:SS"), "HH24:MI:SS MON-DD-YYYY"))-events. EVENT_NOT2)

    THEN

    Dbms_output.put_line ('If day spent game 2 with the value');

    UPDATE EBA_CA_EVENTS set ALERT1_SENT = piece ') where ROW_KEY = events. ROW_KEY;

    end if;

    END

    END LOOP;

    END

    < /tt >

    The error occurs towards the end of the case statement-case.PNG

    I also tried this the 'else' deletion before the case and a few other variations, I can't just not perfect the code however, any help would be appreciated, thanks

    BTW, I can't use IF... Logical I already tried, then once a particular branch occurs then the else statements are ignored.

    You had an extra 'END' where he shouldn't have been and were not an 'END' where TI EXPECTED have been.

    This is your modified code (I had to fill out the... that my trainer Toad worked properly)

    BEGIN
    
       FOR EVENTS IN (
                      SELECT eba_ca_events.event_name, eba_ca_events.event_id
                        FROM 
                     ) LOOP
    
          IF(
             EVENTS.type_id <> (32230291965131516245569156552736940921)
             AND
             TO_DATE(SYSDATE) = ((TO_DATE(TO_CHAR(EVENTS.event_due_date, 'YYYY-MON-DD HH24:MI:SS'), 'YYYY-MON-DD HH24:MI:SS') - EVENTS.event_not1))
            ) THEN
    
             DBMS_OUTPUT.PUT_LINE('Criteria fits SEND EMAIL Alert 1');
    
          ELSE
    
             IF(
                EVENTS.type_id = (32230291965131516245569156552736940921)
                AND
                NVL(EVENTS.completed_mail_sent, 0) <> ('S')
               )
                 THEN
    
                DBMS_OUTPUT.PUT_LINE('SEND COMPLETED EMAIL TO TERRY');
    
                UPDATE eba_ca_events
                   SET completed_mail_sent = ('S')
                 WHERE row_key = EVENTS.row_key;
    
             ELSE
    
                IF(
                   EVENTS.type_id <> (32230291965131516245569156552736940921)
                    AND
                    TO_DATE(SYSDATE) = ((TO_DATE(TO_CHAR(EVENTS.event_due_date, 'YYYY-MON-DD HH24:MI:SS'), 'YYYY-MON-DD HH24:MI:SS')) - EVENTS.event_not2)
                  ) THEN
    
                   DBMS_OUTPUT.PUT_LINE('2nd Criteria fits SEND EMAIL Alert 2');
    
                ELSE
    
                   IF(
                      EVENTS.type_id <> (32230291965131516245569156552736940921)
                      AND
                      TO_DATE(SYSDATE) = ((TO_DATE(TO_CHAR(EVENTS.event_due_date, 'YYYY-MON-DD HH24:MI:SS'), 'YYYY-MON-DD HH24:MI:SS')) - EVENTS.event_not3)
                     ) THEN
    
                      DBMS_OUTPUT.PUT_LINE('3rd Criteria fits SEND EMAIL Alert 3');
    
                   END IF; -- 4
    
                END IF; -- 3
    
             END IF; -- 2
    
          END IF; -- 1
    
          CASE
    
             WHEN EVENTS.event_not2 IS NULL THEN
    
                IF(
                   TO_DATE(SYSDATE) > ((TO_DATE(TO_CHAR(EVENTS.event_due_date, 'YYYY-MON-DD HH24:MI:SS'), 'YYYY-MON-DD HH24:MI:SS')) - EVENTS.event_not1)
                   AND
                   NVL(EVENTS.alert1_sent, 0) <> ('S')
                  ) THEN
    
                   DBMS_OUTPUT.PUT_LINE(' send email if date past part 1');
    
                   UPDATE eba_ca_events
                      SET alert1_sent = ('S')
                    WHERE row_key = EVENTS.row_key;
    
                END IF;
    
             ELSE
    
                CASE
    
                   WHEN EVENTS.event_not2 IS NOT NULL THEN
    
                      IF(
                         TO_DATE(SYSDATE) > ((TO_DATE(TO_CHAR(EVENTS.event_due_date, 'YYYY-MON-DD HH24:MI:SS'), 'YYYY-MON-DD HH24:MI:SS')) - EVENTS.event_not1)
                         AND
                         NVL(EVENTS.alert1_sent, 0) <> ('S')
                         AND
                         TO_DATE(SYSDATE) < ((TO_DATE(TO_CHAR(EVENTS.event_due_date, 'YYYY-MON-DD HH24:MI:SS'), 'YYYY-MON-DD HH24:MI:SS')) - EVENTS.event_not2)
                        ) THEN
    
                         DBMS_OUTPUT.PUT_LINE('if date past part 2 with value');
    
                         UPDATE eba_ca_events
                            SET alert1_sent = ('S')
                          WHERE row_key = EVENTS.row_key;
    
                      END IF;
    
                END CASE;
    
          END CASE;
    
       END LOOP;
    
    END;
    

    I hope this helps.

  • How to disable Edit/Clone/case when transaction obtained ceratin in apex 4.2

    Hi all

    In our application, we have designed a screen using interactive report as shown below, in this report when they click on the checkbox and click the middle button we are what makes this transaction as being inactive and red color display. Requirement is now this line had to be disabled once the record was ceratin.

    1. below is screenshot of reference

    2 when they select the checkbox and click the ceratin that she will change in different as on the first row, now that the rank we now need to disable this, since this product has been produced de-activated.

    3 below used concept to achieve color, using dynamic action, we put in place this

    $('td[headers="Active_Flag"]').each(function() {  
      if ( $(this).text() === 'N' ) {  
        $(this).closest('tr').find('td').css({"background-color":"#EEA196"});
      } 
    });
    

    4. the logic of inactive code

    update t_test
                 set active_flag='N',
                      inactive_date=sysdate
                WHERE prod_map_id = to_number(apex_application.g_f01 (i));    
    

    Could you please let me know how to disable it.

    Kind regards

    Sruthitamiri

    Sruthi Tamiri wrote:

    I created an application in apex.oracle.com, please find necessary details, when you click on the checkbox and click Delete active, I call process of having ename like "N", then entire line should be disabled, because these have become now in use. Also, I gave the icon change, but total feature I didn't explain, that won't hurt i., e will redirect us to another page, where they changed the required fields, in this case I'm showing only a blank page. Once the entire line is turn off, it will not be able to click the icon change as well.

    Using CASE expressions in the report query to conditionally exclude links and lines disabled checkboxes and add a hidden (EMPNO) key column that can be referenced as a parameter in the conditional link:

    select
        case ename
          when 'N'
          then
            null
          else
            ''
        end "Edit"
      , ename
      , job
      , case ename
          when 'N'
          then
            null
          else
            apex_item.checkbox2(
                p_idx => 1
              , p_value => empno)
        end checkbox
      , empno
    from
       emp
    

    The column change Display Type value Standard report columnand the column Link Text link #Edit #.

  • For the CASE of the Oracle SQL statement problem

    Follwing query run without any problem in oracle 12 c.

    SELECT

       BOX to_number (sysdate ' on()

             WHEN 6 THEN to_char(sysdate,'ww')+1

             WHEN 2 THEN to_char(sysdate,'ww')+1 

             ELSE to_char(sysdate,'ww')+ 1 END 

             FROM dual

    But the request fails below. Only change is WHEN 6 THEN to_char (sysdate 'ww') + 2

    SELECT

       BOX to_number (sysdate ' on()

             WHEN 6 THEN to_char(sysdate,'ww')+2

             WHEN 2 THEN to_char(sysdate,'ww')+1 

             ELSE to_char(sysdate,'ww')+ 1 END 

             FROM dual


    Data fault is ORA-01722 invalid number

    Hello

    Try below.

    SELECT

    CASE to_number (to_char(sysdate,'D'))

    WHEN 6 THEN to_char (sysdate, "ww") + 2

    WHEN 2 THEN to_char (sysdate, "ww") + 1

    END of ANOTHER to_char (sysdate, "ww") + 1

    OF the double

  • Need to print the results of a query in a CASE statement

    I want to print the results of a query in a CASE statement:

    SELECT RUN_STATUS

    Of

    (select check BOX WHEN COUNT (ROW_WID) = 0 THEN 'NO JOBS RAN AFTER' |) (select sysdate - XXAFL_MINUTES MINUTE)

    END RUN_STATUS

    of W_ETL_RUN_SDTL

    where START_TS >

    (sélectionnez sysdate-MINUTES de XXAFL_MINUTES)) where RUN_STATUS is not null; e

    The query above subtracted 5 minutes from SYSDATE and he shoots XXAFL_MINUTES. I am doing this because we could change the number of minutes in the future. I want to print the number of minutes in the case statement.

    If I execute this statement, it throws an error stating:

    ORA-00937: not a single group group function

    00937 00000 - 'not a single-group function.

    * Cause:

    * Action:

    Error on line: 1 column: 96

    How can I include "select sysdate - MINUTES of XXAFL_MINUTES" in the CASE that it calculates the number of minutes and it prints with the results.

    Thanks in advance!

    Hey guys,.

    I found the solution:

    SELECT

    RUN_STATUS | TO_CHAR ((sélectionnez sysdate-MINUTES de XXAFL_MINUTES), 'HH24:MI:SS')

    Of

    (select check BOX WHEN COUNT (ROW_WID) = 0

    THEN "NO JOB RAN.

    END RUN_STATUS

    of W_ETL_RUN_SDTL

    where

    START_TS > (select sysdate - XXAFL_MINUTES MINUTE))

    where

    RUN_STATUS is not null;

    The output:

    NO JOBS RAN AFTER 09:07:54

    Thanks to you all!

  • Case statement

    Hi all

    I wrote the code that gives the same number below:

    Select

    Count (case when dm_recd_load_dt < add_months(sysdate,-12) then 1 else 0 end) as count_recd_ly,

    Count (case when dm_recd_load_dt < end (sysdate) then 1 else 0) as count_recd

    of cr_customer

    where nvl (primary_cust_flag, 'Y') = 'Y '.

    and the brand = 'The Commission'

    Hello

    Whenever you have a problem, please post a small example data (CREATE TABLE and only relevant columns, INSERT statements) of all the tables involved, so that people who want to help you can recreate the problem and test their ideas.

    Also post the exact results you want from this data, as well as an explanation of how you get these results from these data, with specific examples.

    Post earlier in this forum.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: Re: 2. How can I ask a question on the forums?

    2849981 wrote:

    Hi all

    I wrote the code that gives the same number below:

    Select

    Count (case when dm_recd_load_dt< add_months(sysdate,-12)="" then="" 1="" else="" 0="" end)="" as="">

    Count (case when dm_recd_load_dt< (sysdate)="" then="" 1="" else="" 0="" end)="" as="">

    of cr_customer

    where nvl (primary_cust_flag, 'Y') = 'Y '.

    and the brand = 'The Commission'

    Remember that ACCOUNT (exp) done: it returns the number of lines where the expression exp is not NULL.  Neither 1 nor 0 have the value NULL, then

    COUNT (CASE WHEN... THEN 0 OTHERWISE 1 END)

    is equivalent to

    COUNT (*)

    Perhaps you meant

    Count (case when dm_recd_load_dt)< add_months="" (sysdate,-12)="" then="" 1="" end) ="" as="">

    Count (case when dm_recd_load_dt)<            (sysdate)    ="" then="" 1="" end) ="" as="">

    She a CASE expression is not a clause ELSE, ELSE NULL by default.

    Moreover, these are CASES expressions.  A CASE statement is something else, found in PL/SQL, but not in SQL.

Maybe you are looking for

  • Screen of 4s

    Hi all, black 4S disappeared from the screen.  When I call him, Siri will sometimes answer but then not to react to the voice.   When I disconnect / connect the, I hear the chime, so there (some?) power of sounds.  Any thoughts?  Thank you.

  • Toolkit and remote sql server DB

    I have an application that creates a table and inserts the table entries (~ 15 fields of strings and numbers), it works properly when you speak to a local sql server express labview and the db toolkit.  I connect with a udl on windows7 64-bit file. 

  • Move contents from the old PC to new PC

    Which is simplest and cleanest way to migrate all the content from my old PC (XP) to my new PC with Windows 8.1. Microsoft says it's to make a download available from Laplink (PCMover Express). This downloaded software will do the job if I connect th

  • Windows 7 Professional running slowly and often shows "not responding".

    has ran chkdsk and did a restore.  What else can I try?

  • Add a press release

    How to add a new version of my application in the world of BB? I use stunts Thank you