Case where the Condition when Clause Condition use

Hello

How can I use case in the where condition and in when I need to use a condition, be clearly
I need to get the following
and (case WHEN :PROMT = 'Closed' then
 status_date >= trunc(sysdate))  end)
When I run the present, I'm missing keyword error.

How can I solve this?

I think you can do it just like this:

...
and ( :PROMPT != 'Closed' or status_date >= trunc(sysdate) )
...

Tags: Database

Similar Questions

  • case where the condition

    Hello
    I want to use the case (or decode etc.) in which a part of sql.
    I want to find the number of rows depending on where the conditions.
    For example, I have a table b, d, e, p and s are fields of this table.
    If the value of the field b is 1 then my condition clause that will be value fields d, e value fields
    If the value of the fields of b is 2 then my condition clause where the declaration will be p field value < s value fields.


    Select count (*) of A
    where
    (if b = 1 then) d, e
    (if b = 2 then) p < s

    How can I achieve this?
    where (b = 1 and d		   
  • Prevent the child class dependency when the conditional use disable to specify the class in the development environment

    Hello

    I develop an application that I want to run on the normal systems and in real time using LabVIEW Proffesional Development System 2012 SP1

    To control how the application interacts with the user, I created a class that defines the type of user interface behavior that should allow me to have nice dialog boxes when the system is running on a machine windows and no dialog box (or any other friendly code in non-real time) if they sail on a real-time target.

    The parent class is the code that suits the actual time and the class of the child is the one with dialog boxes.

    To control the class of which it is responsible, I have a structure conditional disable. It works fine when the application is built in an executable or executable file in real time, but the problem arises when I want to use the code during development on the target in real time.

    I think that with the application under a target in real time (RT PXI), the proper case of the conditional - disable is enabled for the parent class is used, but the child classes are also listed under dependencies - I pressume it's because they exist on the block diagram in the case of persons disabled conditional turn off the diagram.

    This means that I can't deploy the code on the target in real time as it is unhappy with the class of the child code - even if it will never run.

    To save the poster my real project, I created an example with a Parent and child class and a flag to disable conditional 'class' to illustrate the problem.

    If you run Test.vi, you will see that the child class always gets locked (i.e. is addictive) while running even if it is not called.

    So - basically my question is: is what I can do about it or will I enough to disable it with conditionals and simply put the constant to correct class on the block diagram in the tests?

    Thanks in advance

    John.

    I feel your pain.  I came across something similar some time back.

    Apparently official NOR position is that you have to put a conditional structure of Disable IN EVERY ONE OF YOUR CLASS live.  In the Windows screws, you simply have a case of empty disable conditional with the windows code in another case and vice versa on the RT.

    I also much prefer the method you describe...

  • Problem with the case where the clause

    Hello

    I want to use cases in which clause. I wrote a very simple query to test how it works. However, I always got an error message. Here's what I did.

    Select eid, firstname, lastname from employee where eid = 1 works fine

    Select eid, name, name of the employee

    where

    cases where 1 = 1 then eid = 1

    When 1! = 1 then eid = 2

    end

    I ORA-00905: lack of keyword.

    Did I miss something?

    Thank you

    Jennifer

    Hi, Jennifer.

    Why do you want to use BOX in a WHERE clause?  The wonderful thing about the CASE is that it allows you to do IF-THEN-ELSE logic.  In a SELECT clause, or an ORDER BY clause, this is really useful, but the WHERE clause already allows you to use the IF-THEN-ELSE logic.

    However, if you use the BOX in a WHERE clause, it is as it does nowhere else.  Always BARGAIN instead of a single expression in a SQL data types.  All the clauses THEN (and ELSE, if there is one) must return a single expression, such as the NUMBER.  (There is no BOOLEAN data type in SQL).  So, you can use a CASE statement like this:

    ...

    CASES WHERE

    WHEN 1 = 1 THEN 1

    WHEN 1! = 1 THEN 2

    END = eid

    Here, the CASE expression takes the place of a NUMBER.

    However, if I was not sure if 1 = 1 or not, I would write the condition in this way, without a CASE expression:

    WHERE (1 = 1 AND eid = 1)

    OR (1! = 1 AND eid = 2).

  • Where the conditional statement

    Hello

    I'm trying to reuse this page so that it can be used by different areas of my request. Currently, it displays all tables in a particular schema. I would like to reuse so that it could be used by another page that displays only the tables of a particular schema with a particular value set to 'Y' or 'n'. I have tried using if / case identified in SQL and PL/SQL, but none work. My PL/SQL statement gives the error:

    Query cannot be parsed, please check the syntax of your query. (ORA-06550: line 1, column 9: PLS-00103: encountered the symbol "" when expecting one of the following: begin function package pragma procedure subtype type use form current cursor symbol "" has been omitted.) Ora-06550: line 2, column 18: PLS-00103: encountered the symbol "" when expecting one of the following: begin function package pragma procedure subtype type use form current)
    -----
    The code is:
    declare 
    q varchar2(4000);
    
    begin 
    q:= 'select UNIQUE_ROWID, 
    OET_TBL_NM,
    OEP_ACTIVE_IN
    from #OWNER#.VIEW_EDIT_DB
    where oeu_id = :P21_DB and OET_TBL_OWN_NM = :P21_SCHEMA ';
    if :P21_Repl != null then
    q:=q|| ' and OEP_ACTIVE_IN = :P21_Repl ';
    end if;
    q:=q|| ' group by OET_TBL_NM, oeu_id, OET_TBL_OWN_NM, OEP_ACTIVE_IN, UNIQUE_ROWID
    order by OET_TBL_NM, OEP_ACTIVE_IN ';
    The key is the: P21_Repl comparison, which is where I try to reuse this page (: P21_Repl would take a 'Y' or the value "n" of a page or be null on the other). Is that what the problem/solution any idea? Thanks for any help.

    Mike

    Published by: Gerd June 22, 2009 00:34

    Hello

    What about

    SELECT "UNIQUE_ROWID"
         , "OET_TBL_NM"
         , "OEP_ACTIVE_IN"
    FROM "#OWNER#"."VIEW_EDIT_DB"
    WHERE     oeu_id = :p21_db
          AND oet_tbl_own_nm = :p21_schema
          AND NVL( :p21_repl, 'X' ) = DECODE( :p21_repl, NULL, 'X', oep_active_in )
    GROUP BY oet_tbl_nm
           , oeu_id
           , oet_tbl_own_nm
           , oep_active_in
           , unique_rowid
    ORDER BY oet_tbl_nm
           , oep_active_in
    

    See you soon

    Ben
    http://www.munkyben.WordPress.com
    Don't forget to mark the answers useful or correct ;)

  • Triggers the hide when clause

    I have a when clause contained in the header of an insert trigger that does not appear when you use SQL Developer to view the code.
    select
      text
    from
      user_source
    where
      name = 'FOO_INSERT_B_TRG'
    order by
      line;
    
    TEXT
    ----
    trigger bar.foo_insert_b_trg
      before insert
      on bar.foo
      for each row
      when (new.foo_id is null)
      declare
    begin
      :new.foo_id := key_pkg.create_key_f ('BAR', 'FOO');
    end foo_insert_b_trg;
    
    9 rows selected
    However, when I go back to the code by double-clicking the trigger I get this.
    create or replace 
    trigger bar.foo_insert_b_trg
      before insert
      on bar.foo
      for each row
      declare
    begin
      :new.foo_id := key_pkg.create_key_f ('BAR', 'FOO');
    end foo_insert_b_trg;
    Note that the 5 line, which has my when instruction, is missing. It is originally this line to actually be deleted when we open the object, modify it, and then save it.

    Published by: mimi on March 22, 2013 11:55

    Published by: mimi on March 22, 2013 12:01

    Published by: mimi on March 22, 2013 12:04

    Hi mimi,

    This problem has been reported before on this forum:
    Unable to see the WHEN clause for a trigger.

    The bug referenced in this thread is a regression in SQL Developer 3.1. and remains open. Any bug comments:

    With only minimal privileges, we query all_triggers to get only the package
    body (when-clause kept in a different column), whereas with
    SELECT_CATALOG_ROLE or DBA role we query dba_source that contains the full
    trigger source.
    

    Alternatives to work around this issue are:
    1. keep several versions of SQL Developer installed, using 3.1 when you need work with triggers.
    2. get additional privileges to avoid regression in 3.2

    Hope this helps,
    Gary
    SQL development team

  • Visible = "true" and partialtriggers of the problems when you are using "necessary".

    Hi, I think that I have not had my coffee today, but is it possible to have the following?

    Panelformlayout with a selectOneChoice and three inputText elements. "Visible" from each inputText attribute is based on the value selected in the selectOneChoice. The selectOneChoice a autosubmit = true and each inputText has the selectOneChoice as a partialTrigger. It all works fine, until I try to do the required selectItems = true. The hide-dynamic stops working, and the entries are marked as empty (but the selectOneChoice shows the new value).

    I tried to play with the addition of additional checks for the indicators 'immediate' and 'compulsory', for example, required = "#{pageFlowScope.testBean.requiredSet and pageFlowScope.testBean.showVal1}" but that seems to make no difference. " Someone at - it ideas?

    Example of project: (uncheck the box to display the form works well without defined the required indicator and check to enable the problems I see)

    http://www.mediafire.com/?immky4ynxqi

    In the event that the link above does not work, here is the source:

    JSP:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1" title="test thing">
          <af:form id="f1">
            <af:panelStretchLayout id="psl1">
              <f:facet name="center">
                <af:panelFormLayout id="pfl1">
                  <af:group id="grp1">
                  <af:selectOneChoice label="Select" id="selOne"
                                      value="#{pageFlowScope.testBean.selectValue}"
                                      autoSubmit="true" immediate="true">
                    <af:selectItem label="Show: Value 1" value="reqVal1" id="si1"/>
                    <af:selectItem label="Show: Value 1 + 2" value="reqVal1_2" id="si3"/>
                    <af:selectItem label="Show: Value 1 + 2 + 3" value="reqVal1_2_3" id="si2"/>
                  </af:selectOneChoice>
                  <af:inputText label="Value 1" id="it1"
                            visible="#{pageFlowScope.testBean.showVal1}"
                                partialTriggers="selOne"
                                required="#{pageFlowScope.testBean.requiredSet and pageFlowScope.testBean.showVal1}"/>
                  <af:inputText label="Value 2" id="it2"
                            visible="#{pageFlowScope.testBean.showVal2}"
                                partialTriggers="selOne"
                                required="#{pageFlowScope.testBean.requiredSet and pageFlowScope.testBean.showVal2}"/>
                  <af:inputText label="Value 3" id="it3"
                            visible="#{pageFlowScope.testBean.showVal3}"
                                partialTriggers="selOne"
                                required="#{pageFlowScope.testBean.requiredSet and pageFlowScope.testBean.showVal3}"/>
                  <af:inputText label="Value 4" id="it4"/>
                  </af:group>
                    <af:selectBooleanCheckbox
                                            label="Make Vals1-3 required" id="sbc1"
                                              value="#{pageFlowScope.testBean.requiredSet}"
                                              autoSubmit="true"/>
    
                </af:panelFormLayout>
              </f:facet>
              <f:facet name="bottom"><af:spacer width="10" height="10" id="s1"/></f:facet>
              <f:facet name="end"><af:spacer width="10" height="10" id="s2"/></f:facet>
              <f:facet name="start"><af:spacer width="10" height="10" id="s3"/></f:facet>
              <f:facet name="top"><af:spacer width="10" height="10" id="s4"/></f:facet>
            </af:panelStretchLayout>
          </af:form>
        </af:document>
      </f:view>
    </jsp:root>
    TestBean, as managed pageFlowScopeBean:
    package com.testapp.view;
    
    public class TestBean {
    
        private String selectValue = "reqVal1";
        private boolean requiredSet = false;
    
        public TestBean() {
            super();
        }
    
        public void setSelectValue(String selectValue) {
            this.selectValue = selectValue;
        }
    
        public String getSelectValue() {
            return selectValue;
        }
    
        public boolean getShowVal1(){
            return "reqVal1".equals(selectValue)
                || "reqVal1_2".equals(selectValue)
                || "reqVal1_2_3".equals(selectValue);
        }
    
        public boolean getShowVal2(){
          return "reqVal1_2".equals(selectValue)
              || "reqVal1_2_3".equals(selectValue);
        }
    
        public boolean getShowVal3(){
            return "reqVal1_2_3".equals(selectValue);
        }
    
        public void setRequiredSet(boolean requiredSet) {
            this.requiredSet = requiredSet;
        }
    
        public boolean isRequiredSet() {
            return requiredSet;
        }
    
    }
    Thank you
    Barry

    Nick Haralabidis wrote:
    Hello

    The behavior is as expected: you make a value of 1, the value 2 and 3 value required and you autoSubmit on the selectOneChoice. Thus, when you make a selection, value 1, 2 and 3 of the value value are tempted to submit because of the partialTrigger. But since they are required, the validation is triggered.

    No, the validation is thrown in a different phase. The selectOneChoice is immediate and his calls renderResponse ValueChangeListener then the validation phase is never executed. It would be the case if the 3 values were also immediate, but it is not so.

    Nick Haralabidis wrote:

    If you don't want the postings through the Select and always have value 1, 2 and 3 of the required value value, follow these steps:

    (1) remove all partialTriggers of the jsf page

    (2) linking the panelFormLayout to support bean as in:


    Binding = "#{pageFlowScope.testBean.panelMain}" > "

    (3) add a valueChangeListener to the selectOneChoice as in:


    value = "#{pageFlowScope.testBean.selectValue} '"
    autoSubmit = 'true' immediate = "true".
    valueChangeListener = "#{pageFlowScope.testBean.onSelectionChanged}" > "

    (4) in your valueChangeListener add a partialTarget in the Panel as in:

    {} public void onSelectionChanged (ValueChangeEvent valueChangeEvent)
    AdfFacesContext.getCurrentInstance () .addPartialTarget (this.panelMain);
    }

    I tested it and it works :)

    Yes, it's another way to do it.

    Kind regards

    ~ Simon

  • What cases does the HP Pavilion Elite m9040n use?

    I want to put new parts inside, because it is quite old. I want to know if all the pieces of my will enter into it. I looked around, the only thing I could find on it is that it is a medium-sized ATX. You are looking for an exact name please!

    Yareen, welcome to the forum.

    It takes a Micro-ATX motherboard (Micro-ATX-24, 4 cm (9.6 inches) x 24.4 cm (9.6 in).  The key is to ensure that the spacers for the motherboard in the case match the holes in the motherboard.  This may be a problem with new motherboards and old cases.

    Well, to tell you the truth, if you don't want to buy a new computer, I would buy a new case for less than $100 and a motherboard to match.  It would be much easier.  Of course, you can always buy a new HP desktop computer.

    Please click on the Thumbs up button '+' if I helped you and click on "Accept as Solution" If your problem is resolved.

  • Set a style different cases for the same placeholder (data fusion) used two times in the same text

    Hello.

    I have a document with some parties updated with the fusion of data (via placeholders). Is it possible to set a style of different cases for the same placeholder in the same text. See the example:

    Mike runs its < < vehicule_placeholder > > in the city. But its < < VEHICULE_PLACEHOLDER > > is meant to be shared.

    If the value of this placeholder in the file merger is 'bike', the sentence should be:

    Mike runs his bike in the city. But his BIKE is meant to be shared.

    Is this possible? How?

    Thank you.

    You can do it. A character style for this configuration placeholder text, set in all caps.

  • DBMS_XMLGEN. GETXML confusing WHERE the condition of clause?

    I can't quite wrap my head around that, but I found the following query

    Select * from user_views
    where dbms_xmlgen.getxml ("select text from user_views where view_name =" "|") view_name | ') like '% view_table_name % '.

    I am totally confuse everything, that's what makes the WHERE condition in the query?

    When I run the game "highlight text" it returns nothing

    If anyone knows why the WHERE clause is necessary?

    Thank you

    rodneyc8063 wrote:
    I don't understand why there are extra, extra quotes | and the "solomon_is_cool".

    Additional citations have nothing to do with dbms_xmlgen. In string literals Oracle must be in quotes by acronym. So what do you do if literal contains a quotation, for example O'Reily? The rule is, apostrophe inside the quoted string must be preceded by a second single quote. Thus, to produce the O string literal 'Reily, one must use 'O' Reily'. Now, back to dbms_xmlgen.get_xml. She waits for the SQL statement as a parameter. What SQL statement we want to produce? It would be:

    Select the text from user_views where view_name = "some-view-name."

    Right? Then, how the chain of the SQL statement above should look like? One way is to double single quotes:

    "Select the text from user_views where view_name =" some-view-name "'.

    But some-name-of-view is stored in the column of our query view_name. We have therefore concatenate the piecies which are:

    (1) text select lieral user_views where view_name = '
    (2) column view_name
    (3) literal '

    If we end up having:

    "Select the text from user_views where view_name ="' | view_name | ''''

    Now, you have replaced with solomon_is_cool view_name. This will not work because there is no solomon_is_cool column is user_views. What you probably wanted was:

    "Select the text from user_views where view_name ="solomon_is_cool"'.

    Then:

    dbms_xmlgen. GetXml ("select text from user_views where view_name ="solomon_is_cool"'") would look like to display user named solomon_is_cool text is tiny, which again could be a problem since the names, except between quotes, are stored in the data dictionary for uppercase. In any case, the counting of single quotes in string literals can be confusing. In the new versions of oracle introduced then Q-literals,

    dbms_xmlgen. GetXml ("select text from user_views where view_name =" "|") view_name | '''')

    could be replaced by more readable:

    dbms_xmlgen. GetXml (Q'[select text from user_views where view_name = ']' | view_name |) Q'[']')

    For example:

    SQL> select Q'[select text from user_views where view_name = ']' || view_name || Q'[']' from user_views where rownum < 3;
    
    Q'[SELECTTEXTFROMUSER_VIEWSWHEREVIEW_NAME=']'||VIEW_NAME||Q'[']'
    ------------------------------------------------------------------------------
    select text from user_views where view_name = 'EMP_VW'
    select text from user_views where view_name = 'REMOTE_DDL_VIEW_TEST'
    
    SQL> 
    

    SY.

  • How to use the NAME OF THE MONTH where the condition in the date column?

    Hi guys,.

    He comes to the table.
    SQL > desc ACMINUTESPDFTEST;
    Name Null? Type
    ----------------------------------------- -------- ----------------------------
    DATE OF ACDATE
    TYPE VARCHAR2 (10)
    Here, I tried 2 following queries, but I couldn't get the correct result

    Select the types, seqno, acdate of ACMINUTESPDFTEST, where acdate like to_date ('NOV', 'MY');
    or
    Select the types, seqno, acdate from ACMINUTESPDFTEST where acdate = to_date ('NOV', 'MY');

    (for both the query, the result is the same)
    TYPES ACDATE
    ---------- ------------
    ROSE NOVEMBER 1, 10

    but the table with the following data:
    TYPES ACDATE
    ---------- ------------
    ROSE NOVEMBER 14, 10
    WHITE NOVEMBER 15, 10
    ROSE NOVEMBER 1, 10


    Any suggestion why I could not get a good result.

    You can do this:

    where to_char(acdate,'MON') = 'NOV'
    
  • Select without where the condition

    Hello

    Is there is no why select lines of two albums without using a where condition.

    -
    Animesh

    Animesh Tripathi says:
    Hello

    Is there is no why select lines of two albums without using a where condition.

    -
    Animesh

    Without a doubt.

    There are only two lines in your table and then just a Select will do the job. (I'm kidding ;-))

    If you have a hierarchical data in your tables, it might be possible:

    with employee as
    (
      select 1 emp_id, 'ABC' ename, to_date('01-02-2013', 'DD-MM-YYYY') doj, null mgr_id from dual union all
      select 2 emp_id, 'ABC1' ename, to_date('02-02-2013', 'DD-MM-YYYY') doj, 1 mgr_id from dual union all
      select 3 emp_id, 'ABC2' ename, to_date('03-02-2013', 'DD-MM-YYYY') doj, 1 mgr_id from dual union all
      select 4 emp_id, 'ABC3' ename, to_date('04-02-2013', 'DD-MM-YYYY') doj, 2 mgr_id from dual union all
      select 5 emp_id, 'ABC4' ename, to_date('05-02-2013', 'DD-MM-YYYY') doj, 3 mgr_id from dual
    )
    select emp_id, ename, mgr_id manager_id, prior ename manager_name
      from employee
     start with mgr_id is null
    connect by prior emp_id = mgr_id
           and level <= 2;
    
    EMP_ID                 ENAME MANAGER_ID             MANAGER_NAME
    ---------------------- ----- ---------------------- ------------
    1                      ABC
    2                      ABC1  1                      ABC
    3                      ABC2  1                      ABC 
    
  • Where the conditional, or PL/SQL block as a source for an interactive report?

    I have this situation: my app's main screen displays a list of documents. For now, there must be a quick way to 'security' integrated, so that administrators can see all documents, but only other users can see what documents, they created (connection of the creator is stored in the table of documents). In the future we will use probably VPD to enforce certain rules, but for the moment we need a quick solution.

    So I stored administrators in a separate table. Now I want the interactive Act report on the homepage as follows:
    -If an admin is connected, it must have this query: select field 1, 2, 3 area in documents
    -For all other users: select the field 1, 2, area 3 documents where creator =: app_user

    Is this possible in a single interactive report? I could do two reports with different queries, and make conditional depending on who is connected, but this gives me two interactive reports to maintain. Is it possible to use a PL/SQL block as a source for the report? I tried, but I get a syntax error. Is it possible to do where proviso on somehow?

    Hello

    Install the demo application to your workspace:
    Home > create an Application and select Demo Application.

    Check page 1 interactive report. This should give idea how.

    BR, Jari

  • Go to dynamic WHERE the condition in the slider accordingly.

    Hi all

    I am facing a problem with the cursor with dynamic WHERE condition in a function.

    Here's the FUNCTION:
    CREATE OR REPLACE FUNCTION EXCEPTION_MERGE(TABLE_NAME IN VARCHAR2, TAB_NAME IN VARCHAR2)
    RETURN VARCHAr2
    IS
    stmt_tabcols VARCHAR2(32767);
    v_columnname VARCHAR2(32767);
    CURSOR C1 IS 
    SELECT 'A.'||A.COLUMN_NAME ||' = '|| 'B.'||B.COLUMN_NAME COLUMN_NAME 
    FROM 
    (
    SELECT COLUMN_ID, COLUMN_NAME 
    FROM USER_TAB_COLUMNS 
    WHERE TABLE_NAME  = TABLE_NAME 
    AND COLUMN_NAME NOT IN ('ERROR_TAB_ID','ERROR_LOAD_DATE')
    ) A, 
    (
    SELECT COLUMN_ID, COLUMN_NAME 
    FROM USER_TAB_COLUMNS 
    WHERE TABLE_NAME = TAB_NAME
    ) B 
    WHERE A.COLUMN_ID = B.COLUMN_ID;
    BEGIN
    
    
    FOR TABCOL IN C1
    LOOP
        stmt_tabcols := stmt_tabcols ||TABCOL.COLUMN_NAME||',';
        
    END LOOP;
        stmt_tabcols := RTRIM(stmt_tabcols, ',');
        RETURN stmt_tabcols;
    END;
    SELECT EXCEPTION_MERGE('WC_W_TEST_FS','WC_W_TEST_FS_GBL') FROM DUAL;
    She throws, below error:
    ORA-06502 : PL/SQL : Numeric or value error : character string buffer too small
    If I REPLACE TABLE_NAME table_name with hard coded values, it works fine. Can someone look at the code and let me know the question.

    Published by: ace_friends22 on Sep 9, 2012 13:08

    The first function TABLE_NAME parameter has the same name as the column of USER_TAB_COLUMNS...
    Change the names of the parameters to say nom_table_p...

    Concerning

    Etbin

  • CASES where the clasue issue

    Hi I have a select query that gives question saying key word missing in a case statement else part please suggest.


    / * Formatted on 2012/11/02 16:19 (trainer more v4.8.8) * /.
    SELECT a.kintana_number, a.crid, a.projectestimateid, a.reasonimpacts
    FROM (SELECT p.kintana_number AS kintana_number, cr.crid AS crid,
    PE.projectestimateid AS projectestimateid,
    l.LookupValue AS reasonimpacts,
    (SELECT COUNT (1))
    FROM (SELECT p.projectestimateid
    INNER JOIN projectestapplications p projectestimates PA
    ON pa.projectestimateid = p.projectestimateid
    AND pa.impacted = 1
    INNER JOIN applicationsupproviders ASP.
    ON asp.appid = pa.appid
    INNER JOIN optionssupportproviders OSP
    ON osp.providerid = asp.providerid
    AND LOWER (TRIM (osp.provider)) = 'ibm - adm.
    WHERE asp.providertypeid = 2
    OR p.admvendornercid IS NOT NULL
    UNION
    SELECT p.projectid
    PROJECT p INNER JOIN impactedgroups GI
    ON ig.projectid = p.projectid
    AND ig.impacted = 1
    INNER JOIN optionsgroups og
    ON ig.groupid = og.groupid
    WHERE og.ibmtowerid IS NOT NULL)
    WHERE projectestimateid = pe.projectestimateid) AS v_count
    OF LEFT OUTER JOIN projectestimates project EP p
    ON p.projectid = pe.projectid
    INNER JOIN attcr.cr_detail ON pe.crid = cr.crid cr
    LEFT OUTER JOIN attcr.cr_detail_reason r ON r.crid = cr.crid
    LEFT OUTER JOIN attcr.site_lookup l ON l.lookupid =
    r.crreasonid
    WHERE (CASE
    WHEN v_count = 0
    THEN pe.estimatestatusid <>3
    ELSE pe.projectestimateid (1, 2, 3)
    END
    )
    PE.CRID AND IS NOT NULL) a

    WHERE (CASE
    WHEN v_count = 0
    THEN pe.estimatestatusid <> 3
    ELSE pe.projectestimateid (1, 2, 3)
    END
    )

    You cannot use the CASE statement like this. Change your where clause like this.

    WHERE (
         (v_count = 0 and pe.estimatestatusid != 3) or
         (v_count != 0 and pe.projectestimateid IN (1, 2, 3)
          )
    

Maybe you are looking for

  • Get "pdftopdf quit unexpectedly" error when you try to print

    I'm trying to print on a printer Epson Stylus Photo R2400 connected to the Mac Mini. I tried to reinstall the printer driver. Did not work. I then redownloaded the sw Epson printer (has removed the printer from the printers installed and selected aga

  • Two equal consecutive integers

    In this vi if 2 consecutive numbers are equal the Boolean value remains true even if it must if turn off then. If there is a way without using local variables to do this?

  • Type of Windows Server

    Dear experts, I have a questions about Windows Server. I saw in Internet tutorial on Windows Server. I saw that there are just 4 types of Windows servers as: 1 - Windows Server 2012 standard Core 2-Windows Server 2012 3-Windows Server 2012 Datacenter

  • "update.exe has encountered a problem and needs to close. We are sorry for the inconvinience.

    Hello Uses a deployment tool to deploy the patches in the environment, and this time after doing so I am getting an error below "update.exe has encountered a problem and needs to close. We are sorry for the inconvinience. Please help its critics. Con

  • CD drive keeps opening and closing by itself

    My CD tray keeps opening and closing by itself. In addition, I can't open it in the button, I need to go from my and eject it. I checked the bios and everythings fine; even updated. I removed the front panel I scanned with MalwareBytes malware; A lar