CASE expression and no rows selected

Consider the statement:
INSERT INTO target_tab(plan_id)
SELECT
CASE
WHEN customer_type = 'S'
THEN SELECT plan_id FROM tab where customer_id = 12
ELSE 123456
END
FROM
customer_tab
the query
SELECT plan_id FROM tab where customer_id = 12
returs no rows
PROBLEM: if the column target_tab(plan_id) is not nullable
, I cannot insert any data when customer_id is 12.
I would like to insert 0 if the query returs no rows.
I am not able to use NVL on empty set.
How can I solve my problem?

Or how about
SELECT CASE c.customer_type
           WHEN 'S' THEN t.plan_id
           ELSE 123456
       END
FROM   customer_tab c
     , ( SELECT NVL(MIN(plan_id),0) AS plan_id
         FROM   tab
         WHERE  customer_id = 12 ) t;

Similar Messages

  • Case expression error with a select query in the condition

    Consider the two query below:
    1. The first one use a case expression :
    select case when 3 > (select 1 from dual)*2 then 1 else 0 end from dual
    2. The equivalent with a decode expression:
    select
    decode(sign(3-(select 1 from dual)*2),1,1,0) from dual
    The first query return an ORA-00905 error but not the second one. It seems that the arithmetic operation (select 1 from dual)*2 cause the error. The folowing query doesn't return this error:
    select case when 3 > (select 2 from dual) then 1 else 0 end from dual
    I run the test with Oracle 8.1.7.3 Enterprise Edition. Is it a known bug ?
    Thomas

    ora8174>select case when 3 > (select 1 from dual)*2 then 1 else 0 end from dual;
    select case when 3 > (select 1 from dual)*2 then 1 else 0 end from dual
    ERROR at line 1:
    ORA-00905: missing keyword
    ora8174>select case when 3 > cast((select 1 from dual)*2 as number) then 1 else 0 end from dual;
    CASEWHEN3>CAST((SELECT1FROMDUAL)*2ASNUMBER)THEN1ELSE0END
                                                           1
    1 row selected.
    ora8174>select case when 3 > to_number((select 1 from dual)*2) then 1 else 0 end from dual;
    CASEWHEN3>TO_NUMBER((SELECT1FROMDUAL)*2)THEN1ELSE0END
                                                        1
    1 row selected.
    ora8174>@connect
    Connected.
    ora9204>select case when 3 > (select 1 from dual)*2 then 1 else 0 end from dual;
    CASEWHEN3>(SELECT1FROMDUAL)*2THEN1ELSE0END
                                             1
    1 row selected.

  • AirPort Express and Front Row

    i am looking to buy this product and i am curious of one thing
    would i be able to wirelessly stream itunes music to my powered speakers using front row? or would it have to be from the iTunes menu?

    First of all you have to select which speakers to use in iTunes. Once you have set up the Airport Express you will get a pop-up menu in iTunes where you can select which speakers to stream to: computer or the airport express unit or multiple units depending on how many airport express stations you have. After that you control the music selection using Front Row. Personally, I was very impressed by Front Row at first but quickly grew tired of the static display of the CD cover art. There are other software out there that are more dynamic and give you the same level of control as Front Row. There are others where you have to use iTunes but the display is quite superior to Front Row. Enjoy the experience. What I would like to see is some kind of video streaming because most of us have our hi-fi's close to our TV's so it is only the next logical step to get video streaming to the hi-fi AND the TV. Of course, we can always plug in our iPods to the TV and get that effect but the Mac is supposed to be the media hub, not the iPod.
    Hope this helps.

  • Case expression and ORA-00932: inconsistent datatypes

    I m trying to use the following case condition
    select
    case
    when
    count(exception.exception_number) > 1
    then 0
    else
      ENTITY_TYPE_DEF.NAME
    end as NAME
    In table exception , exception_number has a varchar2 datatype. My requirement is such as if the count of exception number is more than 1 , it should show 0 (integer ) and if not then show name column (varchar2) from table entity_type_def .
    My query fails with following error
    ERROR at line 7:
    ORA-00932: inconsistent datatypes: expected NUMBER got CHAR
    Please could someone suggest a workaround for above issue.

    Whatever is the data type of the first case result, it expects all case results to be the same. The first part of your CASE returns 0 which is a number, it expects the second part to also return a number but it returns a string. Hence the error. You can fix it by returning a string in the first part of your case which you do by putting single quotes around your 0.
    CASE WHEN count(exception.exception_number) > THEN '0'
    ELSE entity_type_def.name END

  • Cube or Group By columns with Case Expressions with a total row (SQL Server 2008)

    I am trying to create a summary tabe of some data. I think that I can use Cube(my heart is not set on it though), but I cant figure a way to define new columns via a case expression and sum the new column.  Lastly, I need to create a total row at the
    bottom and I have no idea of how to do that except percent run the query and then run it again without the travel_city and union all the two tables
    group by travaled_city, [COL1] =sum(expense) when dept = 1, [COL2]=sum(expense) when dept = 2, [COL3] = sum(expense) when group = 3, =[COL4]=sum(expense) when group = 1 and  expense code = 0100,[COL5]= sum(expense) when group = 2 and  expense code
    = 0100, [COL6]sum(expense) when group = 3 and  expense code = 0100, [COL7]=sum(expense) when (exp_paid)<30, [COL8] = sum(expense) when dept in ('4','5','6')
    and have a grand total of each column
    any help is greatly appreciated

    Would this work?
    select travaled_city,
    sum(case dept when 1 then expense else 0 end) as [COL1],
    sum(case dept when 2 then expense else 0 end) as [COL2], ...

  • CASE STATEMENTS AND CASE EXPRESSIONS IN ORACLE9I PL/SQL

    제품 : PL/SQL
    작성날짜 : 2001-11-13
    CASE STATEMENTS AND CASE EXPRESSIONS IN ORACLE9I PL/SQL
    =======================================================
    PURPOSE
    아래의 자료는 Case 문에서 oracle 8.1.7과 Oracle 9i의 New Feature로 8.1.7에서는
    sqlplus 에서만 가능했고, 9i 부터는 pl/sql 까지 가능하다.
    Explanation
    1. Oracle 8.1.7 Feature
    Oracle 8.1.7 에서 Case 문은 Decode 문과 유사하지만, 기존의 decode 문을 쓰는 것보다
    더 많은 확장성과 Logical Power와 좋은 성능을 제공한다. 주로 나이와 같이 category 별로
    나눌때 주로 사용하고 Syntex는 아래와 같다.
    CASE WHEN <cond1> THEN <v1> WHEN <cond2> THEN <v2> ... [ELSE <vn+1> ] END
    각각의 WHEN...THEN 절의 argument 는 255 까지 가능하고 이 Limit를 해결하려면
    Oracle 8i Reference를 참조하면 된다.
    The maximum number of arguments in a CASE expression is 255, and each
    WHEN ... THEN pair counts as two arguments. To avoid exceeding the limit of 128 choices,
    you can nest CASE expressions. That is expr1 can itself be a CASE expression.
    Case Example : 한 회사의 모든 종업원의 평균 봉급을 계산하는데 봉급이 $2000보다 작은경우
    2000으로 계산을 하는 방법이 pl/sql을 대신하여 case function을 사용할 수 있다.
    SELECT AVG(CASE when e.sal > 2000 THEN e.sal ELSE 2000 end) FROM emp e;
    Case Example : 나이를 column으로 가지고 있는 customer table을 예로 들어보자.
    SQL> SELECT
    2 SUM(CASE WHEN age BETWEEN 70 AND 79 THEN 1 ELSE 0 END) as "70-79",
    3 SUM(CASE WHEN age BETWEEN 80 AND 89 THEN 1 ELSE 0 END) as "80-89",
    4 SUM(CASE WHEN age BETWEEN 90 AND 99 THEN 1 ELSE 0 END) as "90-99",
    5 SUM(CASE WHEN age > 99 THEN 1 ELSE 0 END) as "100+"
    6 FROM customer;
    70-79 80-89 90-99 100+
    4 2 3 1
    1 SELECT
    2 (CASE WHEN age BETWEEN 70 AND 79 THEN '70-79'
    3 WHEN age BETWEEN 80 and 89 THEN '80-89'
    4 WHEN age BETWEEN 90 and 99 THEN '90-99'
    5 WHEN age > 99 THEN '100+' END) as age_group,
    6 COUNT(*) as age_count
    7 FROM customer
    8 GROUP BY
    9 (CASE WHEN age BETWEEN 70 AND 79 THEN '70-79'
    10 WHEN age BETWEEN 80 and 89 THEN '80-89'
    11 WHEN age BETWEEN 90 and 99 THEN '90-99'
    12* WHEN age > 99 THEN '100+' END)
    SQL> /
    AGE_G AGE_COUNT
    100+ 1
    70-79 4
    80-89 2
    90-99 3
    Example
    2. Oracle 9i Feature
    Oracle 9i부터는 pl/sql에서도 case문을 사용할 수 있으면 이것은
    복잡한 if-else 구문을 없애고, C언어의 switch문과 같은 기능을 한다.
    아래의 9i pl/sql Sample 및 제약 사항을 보면 아래와 같다.
    Sample 1:
    A simple example demonstrating the proper syntax for a case
    statement
    using a character variable as the selector. See the section entitled
    'Restrictions' at the end of this article for details on which PLSQL
    datatypes may appear as a selector in a case statement or
    expression.
    - - - - - - - - - - - - - - - - Code begins here - - - - - - - - - - - -
    set serveroutput on
    declare
    achar char(1) := '&achar';
    begin
    case achar
    when 'A' then dbms_output.put_line('The description was Excellent');
    when 'B' then dbms_output.put_line('The description was Very Good');
    when 'C' then dbms_output.put_line('The description was Good');
    when 'D' then dbms_output.put_line('The description was Fair');
    when 'F' then dbms_output.put_line('The description was Poor');
    else dbms_output.put_line('The description was No such Grade');
    end case;
    end;
    - - - - - - - - - - - - - - - - Code ends here - - - - - - - - - - - -
    Sample 2:
    A simple example demonstrating the proper syntax for a case
    expression
    using a character variable as the selector. See the section entitled
    'Restrictions' at the end of this article for details on which PLSQL
    datatypes may appear as a selector in a case statement or
    expression.
    - - - - - - - - - - - - - - - - Code begins here - - - - - - - - - - - -
    set serveroutput on
    declare
    achar char(1) := '&achar';
    description varchar2(20);
    begin
    description :=
    case achar
    when 'A' then 'Excellent'
    when 'B' then 'Very Good'
    when 'C' then 'Good'
    when 'D' then 'Fair'
    when 'F' then 'Poor'
    else 'No such grade'
    end;
    dbms_output.put_line('The description was ' || description);
    end;
    - - - - - - - - - - - - - - - - Code ends here - - - - - - - - - - - -
    NOTE: The above simple samples demonstrate two subtle differences in the
    syntax
    required for case statements and expressions.
    1) A case STATEMENT is terminated using the 'end case' keywords; a
    case
    EXPRESSION is terminated using only the 'end' keyword.
    2) Each item in a case STATEMENT consists of one or more
    statements, each
    terminated by a semicolon. Each item in a case expression
    consists of
    exactly one expression, not terminated by a semicolon.
    Sample 3:
    Sample 1 demonstrates a simple case statement in which the selector
    is
    compared for equality with each item in the case statement body.
    PL/SQL
    also provides a 'searched' case statement as an alternative; rather
    than
    providing a selector and a list of values, each item in the body of
    the
    case statement provides its own predicate. This predicate can be any
    valid boolean expression, but only one case will be selected.
    - - - - - - - - - - - - - - - - Code begins here - - - - - - - - - - - -
    set serveroutput on
    declare
    achar char(1) := '&achar';
    begin
    case
    when achar = 'A' then dbms_output.put_line('The description was
    Excellent');
    when achar = 'B' then dbms_output.put_line('The description was Very
    Good');
    when achar = 'C' then dbms_output.put_line('The description was
    Good');
    when achar = 'D' then dbms_output.put_line('The description was
    Fair');
    when achar = 'F' then dbms_output.put_line('The description was
    Poor');
    else dbms_output.put_line('The description was No such Grade');
    end case;
    end;
    - - - - - - - - - - - - - - - - Code ends here - - - - - - - - - - - -
    Sample 4:
    This sample demonstrates the proper syntax for a case expression of
    the
    type discussed in Sample 3 above.
    - - - - - - - - - - - - - - - - Code begins here - - - - - - - - - - - -
    set serveroutput on
    declare
    achar char(1) := '&achar';
    description varchar2(20);
    begin
    description :=
    case
    when achar = 'A' then 'Excellent'
    when achar = 'B' then 'Very Good'
    when achar = 'C' then 'Good'
    when achar = 'D' then 'Fair'
    when achar = 'F' then 'Poor'
    else 'No such grade'
    end;
    dbms_output.put_line('The description was ' || description);
    end;
    - - - - - - - - - - - - - - - - Code ends here - - - - - - - - - - - -
    Sample 5:
    This sample demonstrates the use of nested case statements. It is
    also
    permissable to nest case expressions within a case statement (though
    it
    is not demonstrated here), but nesting of case statements within a
    case
    expression is not possible since statements do not return any value.
    - - - - - - - - - - - - - - - - Code begins here - - - - - - - - - - - -
    set serveroutput on
    declare
    anum1 number := &anum1;
    anum2 number := &anum2;
    answer number;
    begin
    case anum1
    when 1 then case anum2
    when 1 then answer := 10;
    when 2 then answer := 20;
    when 3 then answer := 30;
    else answer := 999;
    end case;
    when 2 then case anum2
    when 1 then answer := 15;
    when 2 then answer := 25;
    when 3 then answer := 35;
    else answer := 777;
    end case;
    else answer := 555;
    end case;
    dbms_output.put_line('The answer is ' || answer);
    end;
    - - - - - - - - - - - - - - - - Code ends here - - - - - - - - - - - -
    Sample 6:
    This sample demonstrates nesting of case expressions within another
    case
    expression. Note again the absence of semicolons to terminate both
    the
    nested case expression and the individual cases of those
    expressions.
    - - - - - - - - - - - - - - - - Code begins here - - - - - - - - - - - -
    set serveroutput on
    declare
    anum1 number := &anum1;
    anum2 number := &anum2;
    answer number;
    begin
    answer :=
    case anum1
    when 1 then case anum2
    when 1 then 10
    when 2 then 20
    when 3 then 30
    else 999
    end
    when 2 then case anum2
    when 1 then 15
    when 2 then 25
    when 3 then 35
    else 777
    end
    else 555
    end;
    dbms_output.put_line('The answer is ' || answer);
    end;
    - - - - - - - - - - - - - - - - Code ends here - - - - - - - - - - - -
    Although PL/SQL anonymous blocks have been used in all of the examples
    so far,
    case statements and expressions can also be used in procedures,
    functions, and
    packages with no changes to the syntax.
    The following samples are included for completeness and demonstrate the
    use of
    case statements and/or expressions in each of these scenarios.
    Sample 7:
    This sample demonstrates use of a case statement in a stored
    procedure.
    Note that this sample also demonstrates that it is possible for each
    of
    the items in the case body to consist of more than one statement.
    - - - - - - - - - - - - - - - - Code begins here - - - - - - - - - - - -
    set serveroutput on
    create or replace procedure testcasestmt ( anum IN number ) is
    begin
    case
    when anum = 1 then dbms_output.put_line('The number was One');
    dbms_output.put_line('In case 1');
    when anum = 2 then dbms_output.put_line('The number was Two');
    dbms_output.put_line('In case 2');
    when anum = 3 then dbms_output.put_line('The number was Three');
    dbms_output.put_line('In case 3');
    when anum = 4 then dbms_output.put_line('The number was Four');
    dbms_output.put_line('In case 4');
    when anum = 5 then dbms_output.put_line('The number was Five');
    dbms_output.put_line('In case 5');
    else dbms_output.put_line('The description was Invalid input');
    dbms_output.put_line('In the else case');
    end case;
    end;
    exec testcasestmt(&anum);
    - - - - - - - - - - - - - - - - Code ends here - - - - - - - - - - - -
    Sample 8:
    This sample demonstrates the use of a case statement in a stored
    package.
    - - - - - - - - - - - - - - - - Code begins here - - - - - - - - - - - -
    set serveroutput on
    create or replace package testpkg2 is
    procedure testcasestmt ( anum IN number );
    function testcasestmt_f ( anum IN number ) return number;
    end testpkg2;
    create or replace package body testpkg2 is
    procedure testcasestmt ( anum IN number ) is
    begin
    case
    when anum = 1 then dbms_output.put_line('The number was One');
    dbms_output.put_line('In case 1');
    when anum = 2 then dbms_output.put_line('The number was Two');
    dbms_output.put_line('In case 2');
    when anum = 3 then dbms_output.put_line('The number was Three');
    dbms_output.put_line('In case 3');
    when anum = 4 then dbms_output.put_line('The number was Four');
    dbms_output.put_line('In case 4');
    when anum = 5 then dbms_output.put_line('The number was Five');
    dbms_output.put_line('In case 5');
    else dbms_output.put_line('The description was Invalid input');
    dbms_output.put_line('In the else case');
    end case;
    end;
    function testcasestmt_f ( anum IN number ) return number is
    begin
    case
    when anum = 1 then dbms_output.put_line('The number was One');
    dbms_output.put_line('In case 1');
    when anum = 2 then dbms_output.put_line('The number was Two');
    dbms_output.put_line('In case 2');
    when anum = 3 then dbms_output.put_line('The number was Three');
    dbms_output.put_line('In case 3');
    when anum = 4 then dbms_output.put_line('The number was Four');
    dbms_output.put_line('In case 4');
    when anum = 5 then dbms_output.put_line('The number was Five');
    dbms_output.put_line('In case 5');
    else dbms_output.put_line('The description was Invalid input');
    dbms_output.put_line('In the else case');
    end case;
    return anum;
    end;
    end testpkg2;
    exec testpkg2.testcasestmt(&anum);
    variable numout number
    exec :numout := testpkg2.testcasestmt_f(&anum);
    print numout
    - - - - - - - - - - - - - - - - Code ends here - - - - - - - - - - - -
    Sample 9:
    This sample demonstrates the use of a case expression in a stored
    package.
    - - - - - - - - - - - - - - - - Code begins here - - - - - - - - - - - -
    set serveroutput on
    create or replace package testpkg is
    procedure testcase ( anum IN number );
    function testcase_f ( anum IN number ) return number;
    end testpkg;
    create or replace package body testpkg is
    procedure testcase ( anum IN number ) is
    anumber number := anum;
    anothernum number;
    begin
    anothernum :=
    case
    when anumber = 1 then anumber + 1
    when anumber = 2 then anumber + 2
    when anumber = 3 then anumber + 3
    when anumber = 4 then anumber + 4
    when anumber = 5 then anumber + 5
    else 999
    end;
    dbms_output.put_line('The number was ' || anothernum);
    end;
    function testcase_f ( anum IN number ) return number is
    anumber number := anum;
    anothernum number;
    begin
    anothernum :=
    case
    when anumber = 1 then anumber + 1
    when anumber = 2 then anumber + 2
    when anumber = 3 then anumber + 3
    when anumber = 4 then anumber + 4
    when anumber = 5 then anumber + 5
    else 999
    end;
    dbms_output.put_line('The number was ' || anothernum);
    return anothernum;
    end;
    end testpkg;
    variable numout number
    exec testpkg.testcase(&anum);
    exec :numout := testpkg.testcase_f(&anum);
    print numout
    - - - - - - - - - - - - - - - - Code ends here - - - - - - - - - - - -
    제약 사항
    다음의 databasetype은 case 문에서 지원되지 않는다.
    BLOB
    BFILE
    VARRAY
    Nested Table
    PL/SQL Record
    PL/SQL Version 2 tables (index by tables)
    Object type (user-defined type)
    All of these types except for object types face a similar restriction
    even for if statements (i.e. they cannot be compared for equality directly) so this is unlikely to change for these types. Lack of support for object types is simply an implementation restriction which may be relaxed in future releases.
    Reference Ducumment
    Oracle 8.1.7 Manual
    NOTE:131557.1

    I have done the following code but doesn't
    like the statement of - "case(butNext)". What do you mean "doesn't like" -- did you get an error message?
    I'm guessing it won't compile because you're trying to switch on a Button.
    I tried something
    like "g.fillOval(100,50,70,90, BorderLayout.NORTH)"...no that doesn't make sense. You only use BorderLayout.NORTH when you're adding components to a BorderLayout layout manager. An oval is not a component and fillOval isn't adding a component and Graphics is not a Panel or layout manager.
    Would appreciate it if someone could tell me how to position
    shapes using the graohic method. I think the problem is that you're confusing shapes with components.

  • What happens when the row selection of a table is set as 'none'?

    I have a page, with a Search box, Departments and Employees tables. The user will enter a departmentId and click on Search button. Departments will be displayed. The departmentId column in Departments table is surrounded with a link. So when the user will click on the link, the desired employees will be displayed in the Employees table, if there is a view link between the VOs.
    Now suppose I have removed the view link. And the row selection of the Departments table is set as 'none'. So is it possible to get the desired employees of the chosen departmentId in this scenario, as because row selection has been disabled in the Departments table?
    I also dont want to use the Set Property Listener in this use case.

    Hi,
    If you have disabled rowselection and also are not implementing the selection listener? How will you find which row did the user select?
    Ramandeep

  • Case Expression syntax

    Hi,
    I am writing the below program.
    when case_not_found exception raises
    can any one help me....
    declare
      i integer := 10;
      l_result NUMBER;
      begin
       l_result:= CASE i
                     WHEN 1 THEN 2
                       WHEN 2 THEN 3
                         END CASE;
    EXCEPTION                 
      WHEN CASE_NOT_FOUND THEN
        dbms_output.put_line(nvl(l_result,200));
    end;Regards,
    Rajesh

    A case statement, when does not find an Appropriate match, raises a CASE_NOT_FOUND Exception.
    On the contrary, the Case Expression, returns a NULL Value.
    Since, you used a Case Statement, use the ELSE clause to return some value, say NULL, and the select statement will nto fail.
    Modify it this way:
    declare
      i integer := 10;
      l_result NUMBER;
      begin
       l_result:= CASE i
                     WHEN 1 THEN 2
                       WHEN 2 THEN 3
                     else NULL
                         END;
    EXCEPTION                 
      WHEN CASE_NOT_FOUND THEN
        dbms_output.put_line(nvl(l_result,200));
    end;Extract for Oracle Documentation
    +"If the ELSE clause is omitted, the system substitutes a default action. For a CASE statement, the default when none of the conditions matches is to raise a CASE_NOT_FOUND exception. For a CASE expression, the default is to return NULL."+
    Read For more info on Case Expression and Case Statement
    Edited by: Purvesh K on Dec 13, 2012 12:26 PM

  • IPCC Express Skills Based Routing "Select Skill" feature request.

    Let me start by saying that I hope I'm just doing something wrong and that what I'm trying to accomplish is already possible within the existing feature set of IPCC Express. (I'm running 4.5.2) If not, I'd like to start a campaign to get it added as a feature in the next release.
    Short version:
    A call comes in, and in order to assign skills to the call you must assign the call to a csq that contains the skills required to complete that call. -- Problem arises when number of skills gets large, so must the number of CSQ's. Maintaining all of the agent to CSQ mapping gets very cumbersome.
    I'm proposing a new "select skill" step in the CRS developer, which will allow you to assign a skill required to handle a call, rather then have skills required be based on what CSQ the call was put into.
    (Long version in an e-mail from me to cisco)
    Basically what I'm seeing with the Skills Based Routing feature in IPCC Express is that it still relies heavily on CSQ's to determine the group of agents selected to take a certain call. I can't assign a skill to a calling contact during the call flow in the script editor, instead I have to assign a contact to a CSQ which has certain skills assigned to it.
    Let me give you an example as it pertains to my company.
    We have 15 Healthcare locations with an average of 7 doctors per location. Each doctor has his or her own specialist that takes appointments and other calls not destined to be terminated by the doctor. Each Specialist is also a Primary backup for 2 other doctors and a secondary backup for the rest.
    Currently, if I want to use skills based routing to route a call to one of the Doctors, I have to create a CSQ for each doctor, and add that doctors skill to that CSQ, and then add all of those CSQs to the locations "team".
    Furthermore, if I want to add a "bilingual" skill so that each caller has the option to speak to a bilingual rep, it changes the order for the rep selection. Now I have to double the amount of CSQs in the system to have 1 queue for one language and another queue for another language for each doctor.
    At 15 locations and averaging 7 docs per location with 2 languages, this requires 210 different CSQs that I have to update on a regular basis because turnover for these specialists is fairly high. Not to mention the fact that Cisco has imposed a "soft limit" of 75 CSQs per server on the 7835.
    What I would propose to alleviate this mess would be to add a new step in the CRS editor under "IPCC Express" and call it "Select Skill", where I could assign a skill required to handle a call. This would allow me to create 1 CSQ and have agent selection done based on skill, or a combination of skills. It would also allow me to look across the enterprise for an agent with a particular skill without having to create 105 CSQs with 105 agents per CSQ.
    To do this for now I have created a work around, but it's not a very good one because it requires a lot of overhead. I've created a database with all of my agents in it and all of the skills they are qualified for. Then where I would use the 'Select Skill' step I talked about earlier I now use a database dip and select a resource with the skills I require, then do a 'Get Reporting Statistic' to determine if that resource is logged in and available. Then using CRS 4.5.2 I route on resource instead of CSQ. Now the problem with this method, is if the resource is available, but away, or doesn?t answer the phone (because they also have to deal with walk up customers) it sets them not ready and then just sits there waiting for then to go available again. It wont requeue to the next skilled agent unless I dequeue then from the current app and start the process all over again, which in that cause they would loose their place in line.
    So that's it in a nutshell, I'm sure it's not the easiest thing to follow.
    Let me know if you have any questions.
    Jeremy
    (end e-mail)

    I just want to join you in this request.
    Steven Ferland, Bell Canada
    P.S.: Please add your name if you agree with Jeremy.

  • Selecting structure fields from search box in expressions and rules.

    Hi,
      I've a case where there are more than one structure object (structures bound to DDIC structure) with same field (lets say MATNR for example). Now assume that I've 5 structures with the field MATNR (struct_1, struct_2,... struct_5). I've to use the field struct_3-MATNR in one of the expressions are result object. So I click on the context menu button of the result link and click on Select... menu option. In the pop up search screen I type MATNR and it shows me 5 result records. Now the problem is how do I know which MATNR belongs to struct_3. The search results doesn't show to which structure &/OR table a field belongs to.
    I've been randomly selecting each one till I get the right one which wastes a lot of time.

    I'll try to put my case with a more detailed explanation.
    Hierarchy:
    Function_01->Ruleset_01->Ruleset_exp_01(DB_LOOKUP)
    In the above DB_LOOKUP I try to fetch records from database based on VBELN.
    I've a structure Struct_01 in the Function_01 context with the element VBELN in it(Struct_01).
    My select query goes like this.
    Select Col1 Col2 Col3 from XYZ_TABLE WHERE VBELN = Struct_01-VBELN.
    I've to select Struct_01-VBELN for the above case, but I don't find Struct_01 though it is in the function context.
    Note: I've around 5 structures with VBELN

  • Row Selection for second and subsequent level nodes in tree table

    Hi All,
    We have a .jsff page with tree bindings to display a three-level hierarchy tree table.Suppose the hierarchy is
    -> Department
    ->-> Employees
    ->->-> Employee details.
    I have a use case where-in when we add the employee node within a department,the department node must expand and the newly added employee node must be selected.
    In both the cases(for new department or employee), we are following the approach mentioned below:
    1. Get the treeTable Iterator.
    2.Adding the new object to the java ArrayList which is bound to the corresponding level in the tree.
    3.Refreshing the treeTable iterator.
    4.Execute treeTable.setSelectedRowKeys()
    5.Add a partial target to the treetable.
    The issue is that the new employee gets added but the upper-level department node collapses and no selection is performed on the new employee node.
    But when we add a new department node, it gets selected on creation.
    Is there any additional steps to be performed for second-level row selection?

    Hi,
    Thanks for the reply.
    I looked at the code given in sample 61.
    In the sample, a new node is not added dynamically (for ex.either new location or its child nodes.)
    As mentioned in the above post, after adding a new node at a level in our use case, when we perform the refresh of the tree-table's iterator,the selection state of the rows is not shown on the table.
    If the tree-table's iterator is not refreshed and the treeTable.setSelectedRowKeys() is executed, the rows get selected but the subsequent node additions do not show up in the table as the table's iterator is not refreshed.
    Any sample code is available where in both the addition of new node and its selection is performed at the same time?
    Thanks.

  • EL expression to set row at particular index as selected row

    Hi,
    What should be the EL expression to set row at index 'i' as selected row in a tree binding.
    I tried *#{bindings.treeBinding.collectionModel.selectedRow[i]}* . But it doesn't work.
    I also want to make the selected row as current. Will *#{bindings.treeBinding.collectionModel.makeCurrent}* work?
    Thanks
    KK

    Hi,
    create a managed bean that returns the selected RowKeys for the tree. See this example:
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/61search-in-rendered-trees-177577.pdf
    It searches for a specific label in a tree and marks it as selected
    Frank

  • Selecting and skipping rows in a table

    Hi ALL, i have two tables with the following data
    WITH table1 AS
      SELECT 517 id,  'TA33' cid, To_Date('1/1/2010','mm/dd/yyyy') dt,  90 src, 'MEDREC-C' name, 'FIN' lvl_1, 'FCS' lvl_2, ' BAN' lvl_3 FROM dual UNION ALL
      SELECT 517 id,  'TA33' cid, To_Date('1/1/2010','mm/dd/yyyy') dt,  88 src, 'MEDREC-L' name, 'FINA' lvl_1, 'FIC' lvl_2, ' BAN' lvl_3 FROM dual UNION all
      SELECT 517 id,  'TA33' cid, To_Date('1/1/2010','mm/dd/yyyy') dt,  91 src, 'MEDREC-H' name, 'BA' lvl_1, 'BAING' lvl_2, ' BAN' lvl_3 FROM dual UNION ALL
      SELECT 517 id,  'TA33' cid, To_Date('1/1/2010','mm/dd/yyyy') dt,  59 src, 'MEDREC-R' name, 'FIN2' lvl_1, 'FCY' lvl_2, ' BANW' lvl_3 FROM dual UNION ALL
      SELECT 517 id,  'TA33' cid, To_Date('1/5/2010','mm/dd/yyyy') dt,  90 src, 'MEDREC-C' name, 'FIN22' lvl_1, 'FCS22' lvl_2, ' BAN22' lvl_3 FROM dual UNION ALL
      SELECT 517 id,  'TA33' cid, To_Date('1/5/2010','mm/dd/yyyy') dt,  88 src, 'MEDREC-L' name, 'FINA' lvl_1, 'FIC' lvl_2, ' BAN' lvl_3 FROM dual UNION all
      SELECT 517 id,  'TA33' cid, To_Date('1/5/2010','mm/dd/yyyy') dt,  91 src, 'MEDREC-H' name, 'BA' lvl_1, 'BAING' lvl_2, ' BAN' lvl_3 FROM dual UNION ALL
      SELECT 517 id,  'TA33' cid, To_Date('1/5/2010','mm/dd/yyyy') dt,  59 src, 'MEDREC-R' name, 'FIN2' lvl_1, 'FCY' lvl_2, ' BANW' lvl_3 FROM dual UNION ALL
      SELECT 518 id,  'TA35' cid, To_Date('1/2/2010','mm/dd/yyyy') dt,  90 src, 'MEDREC-C' name, 'IND' lvl_1, 'IMAN' lvl_2, ' CO' lvl_3 FROM dual UNION all
      SELECT 518 id,  'TA35' cid, To_Date('1/2/2010','mm/dd/yyyy') dt,  88 src, 'MEDREC-L' name, 'IND' lvl_1, 'CAP' lvl_2, ' CO' lvl_3 FROM dual UNION all
      SELECT 518 id,  'TA35' cid, To_Date('1/2/2010','mm/dd/yyyy') dt,  91 src, 'MEDREC-H' name, 'EMAC' lvl_1, 'COG' lvl_2, ' CO' lvl_3 FROM dual UNION ALL
      SELECT 519 id,  'TA23' cid, To_Date('1/3/2010','mm/dd/yyyy') dt,  59 src, 'MEDREC-R' name, 'UYS' lvl_1, 'TYU' lvl_2, ' CO' lvl_3 FROM dual UNION all
      SELECT 519 id,  'TA33' cid, To_Date('1/3/2010','mm/dd/yyyy') dt,  88 src, 'MEDREC-L' name, 'UYS2' lvl_1, 'TYU2' lvl_2, ' CO2' lvl_3 FROM dual UNION ALL
      SELECT 519 id,  'TA23' cid, To_Date('1/7/2010','mm/dd/yyyy') dt,  59 src, 'MEDREC-R' name, 'UYS66' lvl_1, 'TYU66' lvl_2, ' CO1' lvl_3 FROM dual UNION all
      SELECT 519 id,  'TA33' cid, To_Date('1/7/2010','mm/dd/yyyy') dt,  88 src, 'MEDREC-L' name, 'UYS2' lvl_1, 'TYU2' lvl_2, ' CO2' lvl_3 FROM dual UNION ALL
      SELECT 520 id,  'TA2' cid, To_Date('1/4/2010','mm/dd/yyyy') dt,  88 src, 'MEDREC-L' name, 'UYS6' lvl_1, 'TYU' lvl_2, ' CO' lvl_3 FROM dual
      -- there is  more data with different id nuimbers
    table2 AS
      SELECT 90 src, 'YB' name FROM dual UNION ALL
      SELECT 59 src, 'YC' name FROM dual UNION all
    SELECT 91 src, 'BB' name FROM dual UNION ALL
      SELECT 88 src, 'YI' name FROM dual
    )i want to write a query that gives the me output below
    ID     CID        DT                  SRC     NAME         LVL_1     LVL_2       LVL_3
    517     TA33     1/1/2010     90     MEDREC-C     FIN       FCS         BAN
    517     TA33     1/5/2010     90     MEDREC-C     FIN22     FCS22       BAN22
    518     TA35     1/2/2010     90     MEDREC-C     IND       IMAN       CO
    519     TA23     1/3/2010     59     MEDREC-R     UYS       TYU         CO
    519     TA23     1/7/2010     59     MEDREC-R     UYS66     TYU66       CO1this is the logic for the output above.
    i am interested in rows with src value of 90 or 59
    the logic should be as follow
    1. if there is a row with src value of 90 and another with src value of 59 then display the row withh src=90
    2. if there is a row with src value of 90 but there is no row with value 59 then display the row with src=90
    3. if there is a row with src value of 59 but there is no row with value 90 then display the row with src=59
    4. if there is no row with src value 59 and/or 90, then dont display anything
    so for a particular id, example 517, there is a row with src=90 and 59, so i want to display the one with src=90
    in id 518, there is one row with src=90 but no row with src=59. display row with src=90
    in 519, there is no row with src=90, but there is one with 59, display row with src=59
    id 520 dont have rows with src 90 or 59, dont display anything
    i want to join table1 and table2 together. in table2 i need to get the src value so that i can join with table1.
    can somebody help write a query that gives me the output above? thanks

    I think this works for your 'new' logic.
    WITH table1 AS
      SELECT 517 the_id,  'TA33' cid, To_Date('1/1/2010','mm/dd/yyyy') dt,  90 src, 'MEDREC-C' the_name, 'FIN' lvl_1, 'FCS' lvl_2, ' BAN' lvl_3 FROM dual UNION ALL
      SELECT 517 the_id,  'TA33' cid, To_Date('1/1/2010','mm/dd/yyyy') dt,  88 src, 'MEDREC-L' the_name, 'FINA' lvl_1, 'FIC' lvl_2, ' BAN' lvl_3 FROM dual UNION all
      SELECT 517 the_id,  'TA33' cid, To_Date('1/1/2010','mm/dd/yyyy') dt,  91 src, 'MEDREC-H' the_name, 'BA' lvl_1, 'BAING' lvl_2, ' BAN' lvl_3 FROM dual UNION ALL
      SELECT 517 the_id,  'TA33' cid, To_Date('1/1/2010','mm/dd/yyyy') dt,  59 src, 'MEDREC-R' the_name, 'FIN2' lvl_1, 'FCY' lvl_2, ' BANW' lvl_3 FROM dual UNION ALL
      SELECT 517 the_id,  'TA33' cid, To_Date('1/5/2010','mm/dd/yyyy') dt,  90 src, 'MEDREC-C' the_name, 'FIN22' lvl_1, 'FCS22' lvl_2, ' BAN22' lvl_3 FROM dual UNION ALL
      SELECT 517 the_id,  'TA33' cid, To_Date('1/5/2010','mm/dd/yyyy') dt,  88 src, 'MEDREC-L' the_name, 'FINA' lvl_1, 'FIC' lvl_2, ' BAN' lvl_3 FROM dual UNION all
      SELECT 517 the_id,  'TA33' cid, To_Date('1/5/2010','mm/dd/yyyy') dt,  91 src, 'MEDREC-H' the_name, 'BA' lvl_1, 'BAING' lvl_2, ' BAN' lvl_3 FROM dual UNION ALL
      SELECT 517 the_id,  'TA33' cid, To_Date('1/5/2010','mm/dd/yyyy') dt,  59 src, 'MEDREC-R' the_name, 'FIN2' lvl_1, 'FCY' lvl_2, ' BANW' lvl_3 FROM dual UNION ALL
      SELECT 518 the_id,  'TA35' cid, To_Date('1/2/2010','mm/dd/yyyy') dt,  90 src, 'MEDREC-C' the_name, 'IND' lvl_1, 'IMAN' lvl_2, ' CO' lvl_3 FROM dual UNION all
      SELECT 518 the_id,  'TA35' cid, To_Date('1/2/2010','mm/dd/yyyy') dt,  88 src, 'MEDREC-L' the_name, 'IND' lvl_1, 'CAP' lvl_2, ' CO' lvl_3 FROM dual UNION all
      SELECT 518 the_id,  'TA35' cid, To_Date('1/2/2010','mm/dd/yyyy') dt,  91 src, 'MEDREC-H' the_name, 'EMAC' lvl_1, 'COG' lvl_2, ' CO' lvl_3 FROM dual UNION ALL
      SELECT 519 the_id,  'TA23' cid, To_Date('1/3/2010','mm/dd/yyyy') dt,  59 src, 'MEDREC-R' the_name, 'UYS' lvl_1, 'TYU' lvl_2, ' CO' lvl_3 FROM dual UNION all
      SELECT 519 the_id,  'TA33' cid, To_Date('1/3/2010','mm/dd/yyyy') dt,  88 src, 'MEDREC-L' the_name, 'UYS2' lvl_1, 'TYU2' lvl_2, ' CO2' lvl_3 FROM dual UNION ALL
      SELECT 519 the_id,  'TA23' cid, To_Date('1/7/2010','mm/dd/yyyy') dt,  59 src, 'MEDREC-R' the_name, 'UYS66' lvl_1, 'TYU66' lvl_2, ' CO1' lvl_3 FROM dual UNION all
      SELECT 519 the_id,  'TA33' cid, To_Date('1/7/2010','mm/dd/yyyy') dt,  88 src, 'MEDREC-L' the_name, 'UYS2' lvl_1, 'TYU2' lvl_2, ' CO2' lvl_3 FROM dual UNION ALL
      SELECT 520 the_id,  'TA2'  cid, To_Date('1/4/2010','mm/dd/yyyy') dt,  88 src, 'MEDREC-L' the_name, 'UYS6' lvl_1, 'TYU' lvl_2, ' CO' lvl_3 FROM dual
       table2 AS
      SELECT 90 src, 'YB' the_name FROM dual UNION ALL
      SELECT 59 src, 'YC' the_name FROM dual UNION all
      SELECT 91 src, 'BB' the_name FROM dual UNION ALL
      SELECT 88 src, 'YI' the_name FROM dual
    SELECT
       results.the_id              ,
       results.cid                 ,
       results.dt                  ,
       results.src                 ,
       results.the_name            ,
       results.lvl_1               ,
       results.lvl_2               ,
       results.lvl_3               ,
       t2.the_name AS tab2_the_name
    FROM
          SELECT
             the_id  ,
             cid     ,
             dt      ,
             src     ,
             the_name,
             lvl_1   ,
             lvl_2   ,
             lvl_3   ,
             CASE
                WHEN src IN (59, 90)
                THEN rank() over (partition BY the_id order by
                   CASE
                      WHEN src IN (59,90)
                      THEN src
                      ELSE -100
                   END DESC )
                ELSE NULL
             END AS rn
          FROM
             table1
       results,
       table2 t2
    WHERE
       results.src = t2.src
    AND
          rn  = 1
       OR rn IS NULL
                THE_ID CID  DT                                  SRC THE_NAME LVL_1 LVL_2 LVL_3  TA
                   517 TA33 01-JAN-2010 12 00:00                 90 MEDREC-C FIN   FCS    BAN   YB
                   517 TA33 05-JAN-2010 12 00:00                 90 MEDREC-C FIN22 FCS22  BAN22 YB
                   517 TA33 05-JAN-2010 12 00:00                 91 MEDREC-H BA    BAING  BAN   BB
                   517 TA33 05-JAN-2010 12 00:00                 88 MEDREC-L FINA  FIC    BAN   YI
                   517 TA33 01-JAN-2010 12 00:00                 91 MEDREC-H BA    BAING  BAN   BB
                   517 TA33 01-JAN-2010 12 00:00                 88 MEDREC-L FINA  FIC    BAN   YI
                   518 TA35 02-JAN-2010 12 00:00                 90 MEDREC-C IND   IMAN   CO    YB
                   518 TA35 02-JAN-2010 12 00:00                 88 MEDREC-L IND   CAP    CO    YI
                   518 TA35 02-JAN-2010 12 00:00                 91 MEDREC-H EMAC  COG    CO    BB
                   519 TA23 03-JAN-2010 12 00:00                 59 MEDREC-R UYS   TYU    CO    YC
                   519 TA23 07-JAN-2010 12 00:00                 59 MEDREC-R UYS66 TYU66  CO1   YC
                   519 TA33 03-JAN-2010 12 00:00                 88 MEDREC-L UYS2  TYU2   CO2   YI
                   519 TA33 07-JAN-2010 12 00:00                 88 MEDREC-L UYS2  TYU2   CO2   YI
                   520 TA2  04-JAN-2010 12 00:00                 88 MEDREC-L UYS6  TYU    CO    YI
    14 rows selected.
    Elapsed: 00:00:00.25
    ME_XE?

  • I can't print wirelessly using Airport Express.  I have my HP printer connected to a USB hub, and the hub to the Airport Express, but when I select the HP from the printer list, my MacBook says the printer is "off-line" - even when it is not.

    I can't print wirelessly using Airport Express.  I have my HP printer connected to a USB hub, and the hub to the Airport Express, but when I select the HP from the printer list, my MacBook says the printer is "off-line" - even when it is not.  I've tried several USB connectors, and several different ports on my USB hub; same result.  I need to have the HP connected to the hub 'cause from there it's connected to our desktop Mac.

    Hi,
    I am currently replying to this as it shows in the iChat Community.
    I have asked the Hosts to move it to Snow Leopard  (you should not lose contact with it through any email links you get)
    I also don't do Wirelss printing so I can't actaully help either.
    10:01 PM      Friday; July 29, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb( 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • How to list selected parent and child rows with values from ADF TreeTable

    I created one tree table having three levels using DepartmentsVO, EmployeesVO and
    JobHistoryVO where these tables contains parent and child relationship on database.
    Then i added one more column to the tree table which displays selectBooleanCheckBox. This
    check box is available for parent and child rows in that column.
    My first concern is i
    want to list out all the parentids and its child ids from three levels where the check
    box is selected.
    second concern is
    if i select the check box for a parent row, then the remaining check boxes for child rows also select automatically which are comes under the parent row.
    Thanks in advance.
    jk

    hi Frank,
    Thanks for the quick reply...
    As I mentioned before I am able to get the children using JUCtrlHierNodeBinding. but wanted to change the value of child row which have specific data.
    Is it possible through JUCtrlHierNodeBinding to update data of child and parent?? If so then can you please post the code snippet for the same???
    Viral

Maybe you are looking for

  • Dr8-a via usb2 external box

    I recently bought the msi dr8-a writer and have problems burning dvd's. I burnt the dvd that came with it without any problems, but when i tried to burn other media (ritek and bulkpaq) it keeps coming up with a "focus or tracking" error. I have conne

  • 2 differents results with sys.all_objects

    select object_name,object_type from sys.all_objects where owner = 'GROUPE' and trunc(created) = to_date('12/08/2002','DD/MM/YYYY'); This select statement return 8 rows when running under SQL*Plus but inside a procedure it return 0 row when the proced

  • JDBC to non-oracle DB's

    Trying to locate a copy of note 73244.1 that discusses accessing non-oracle DB's from a java stored procedure using JDBC. Unable to find or access that note. It is referenced numerous times on metalink, but none of the links actually get there. Anyon

  • What does "other" mean at the bottom of the sync page? It is taking up a large amount of space on my phone.

    What does "other" mean at the bottom of the sync page? It is taking up a large amount of space on my phone.

  • The same waveform shows on two independent VIs which are running simultaneously?

    Hi, I am a newbie of LV. My computer has two monitors. I am going to run two VIs simultaneously on this computer. One VI window will show on monitor 1 and the other VI shows on monitor 2. The two VIs have totally different looking, but they will show