Case statement for dashboard text title based on NQ_SESSION.ROLES

Hello,
I figured out on my dashboard I can add a textbox
with the code '@{biserver.variables['NQ_SESSION.ROLES']}'  and it shows the user groups. That works great. Now
I need to have a case statement or so that shows a text, that changes
with each user role i.e. each user role gets its own "report title" Is that possible?
Thanks.

Hello,
Thanks for the column formula example.
Unfortunately in both cases it resolves to the ELSE clause even when the other two are true:
case  when Locate('BIConsumer_Two', VALUEOF(NQ_SESSION.ROLES))>0 then @{VAR_REPORTTITLE}{'test'} when Locate('BIConsumer_One', VALUEOF(NQ_SESSION.ROLES))>0 then @{VAR_REPORTTITLE}{'test2'}   else @{VAR_REPORTTITLE}{'test3'}   end  
case when Position('userrole1' in VALUEOF(NQ_SESSION.ROLES))>0 then 'w00t' else 'ang' end
The one below works (at least I can read test1 on the results page of my answers report:
case when Position('mytestrole' in 'mytestrole')>0 then @{VAR_REPORTTITLE}{'test1'} else @{VAR_REPORTTITLE}{'test'} end
The NQ_SESSION.ROLES comes like this:
'BIConsumer_One;BIAdministrator;AuthenticatedUser;BIConsumer;BIConsumer_Two;BIAuthor'
I realized why I could not resolve it. I did not define it as a session but presentation variable. So here it is a session variable:
case when Position('mytestrole' in 'mytestrole')>0 then VALUEOF(NQ_SESSION.VAR_REPORTTITLE) ='test1' else VALUEOF(NQ_SESSION.VAR_REPORTTITLE)='test2' end
but now there is an error: [nQSError: 26012]

Similar Messages

  • How to write a case statement for the totals column of two different years (2013 and 2014) of the same month so that I can get a +/- column

    Please Help!!!
    How to write a case statement for the totals column of two different years (2013 and 2014) of the same month so that I can get a +/- column.
                                      January 2014         January
    2013                            +/-
                    Region   Entry   Exit  Total    Entry   Exit   Total   (Total of Jan2014-Total of Jan2013)
                    A               2         3      
    40        5       7        30                    40-30= 10

    What is a table structure? Sorry cannot test it right now..
    SELECT <columns>,(SELECT Total FROM tbl WHERE Y=2014)-(SELECT Total FROM tbl WHERE Y=2013)
    FROM tbl
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Case statement for States

    Hi All,
    I am trying to populate a text field based on what the user chooses in a drop down that contains the 50 United States of America.
    So...let's say for now that I want the text field to say "Birmingham" if the user chooses "Alabama".
    The only thing I have so far is totally wrong:
    function setText()
    var statechoice = State.value;
    switch (statechoice) {
    case 1:
    Text1.rawValue = "Filing is required in Alabama";
    break
    case 2:
    Text1.rawValue = "Very cold and Filing is required in Alaska";
    break
    default:
    Text1.rawValue = "Choose a state please";
    break
    Does it always have to be case 1, 2, 3 and so on? Can't it ever be "case (something is true and something equals 7):"?  I mean, do I always have to use integers to distinguish the cases?
    later on, I want to populate that drop down based on several choices that the user makes. I want to have a list of conditionals where each conditional expresses a unique combination of choices that the user has made.
    Do you like cold food? Yes
    Lactose intolerant? No
    Text Field says "Have an ice cream cone for dessert".
    How do I get integer values from a drop down? dropdown.value? dropdown.index? dropdown.selectedIndex?
    How do I combine these choices in the case statements? case (dd1 = 1 and dd2 = 4 and dd3 = 2):   ???
    Sorry for this discursive question,
    I just need a good code example to follow.
    Many Thanks,
    Joe

    Few things to mention.
    1) You can get the selected value from the dropdown by using rawValue property.. But in your code you have used "State.value"..It should be "State.rawValue"..
    2) In the Case statement:
           case 1/2/3 etc.. are values of the selected value from the State dropdown. If you assign "AL" for Alabama, then you need to use "case "AL":"
    function setText()
    var statechoice = State.rawValue;
    switch (statechoice) {
    case "AL":
    Text1.rawValue = "Filing is required in Alabama";
    break;
    case "AK":
    Text1.rawValue = "Very cold and Filing is required in Alaska";
    break;
    default:
    Text1.rawValue = "Choose a state please";
    break;
    Find my changes to your script above..
    Thanks
    Srini

  • Is it possible to use a case statement when joining different tables based on input parameters?

    Hi,
    I have a scenario where my stored procedure takes 5 parameters and the users can pass NULL or some value to these parameters and based on the parameters, I need to pull data from various tables.
    Is it possible to use a case statement in the join, similar the one in the below example. I'm getting error when I use the below type of statement.
    select a.*
    from a
    case
    when parameter1=1 then
    inner join a on a.id = b.id
    when parameter1=2 then
    inner join a on a.id = c.id
    end;
    Please let me know, if this type of statement works, and if it works will it create any performance issues?. If the above doesn't work, could you please give me some alternate solutions?
    Thanks.

    Here's a technique for joining A to B or C depending on the input parameters. In theory, you are joining to both tables but the execution plan includes filters to skip whichever join is not appropriate. The drawback is that you have to do outer joins, not inner ones.
    CREATE TABLE A AS SELECT LEVEL ak FROM dual CONNECT BY LEVEL <= 100;
    CREATE TABLE b AS SELECT ak, bk
    FROM A, (SELECT LEVEL bk FROM dual CONNECT BY LEVEL <= 10);
    CREATE TABLE c(ak, ck) AS SELECT ak, bk*10 FROM b;
    variable p1 NUMBER;
    variable p2 NUMBER;
    exec :p1 := 1;
    exec :p2 := 20;
    SELECT /*+ gather_plan_statistics */ A.ak, nvl(b.bk, c.ck) otherk FROM A
    LEFT JOIN b ON A.ak = b.ak AND :p1 IS NOT NULL AND b.bk = :p1
    LEFT JOIN c ON A.ak = c.ak AND :p1 is null and :p2 IS NOT NULL and c.ck = :p2
    WHERE A.ak <= 9;
    SELECT * FROM TABLE(dbms_xplan.display_cursor(NULL,NULL,'IOSTATS LAST'));
    | Id  | Operation             | Name            | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
    |   0 | SELECT STATEMENT      |                 |      1 |        |      9 |00:00:00.01 |       7 |
    |*  1 |  HASH JOIN OUTER      |                 |      1 |      9 |      9 |00:00:00.01 |       7 |
    |*  2 |   HASH JOIN OUTER     |                 |      1 |      9 |      9 |00:00:00.01 |       7 |
    |*  3 |    TABLE ACCESS FULL  | A               |      1 |      9 |      9 |00:00:00.01 |       3 |
    |   4 |    VIEW               | VW_DCL_5532A50F |      1 |      9 |      9 |00:00:00.01 |       4 |
    |*  5 |     FILTER            |                 |      1 |        |      9 |00:00:00.01 |       4 |
    |*  6 |      TABLE ACCESS FULL| B               |      1 |      9 |      9 |00:00:00.01 |       4 |
    |   7 |   VIEW                | VW_DCL_5532A50F |      1 |      9 |      0 |00:00:00.01 |       0 |
    |*  8 |    FILTER             |                 |      1 |        |      0 |00:00:00.01 |       0 |
    |*  9 |     TABLE ACCESS FULL | C               |      0 |      9 |      0 |00:00:00.01 |       0 |
    Predicate Information (identified by operation id):
       1 - access("A"."AK"="ITEM_0")
       2 - access("A"."AK"="ITEM_1")
       3 - filter("A"."AK"<=9)
      5 - filter(:P1 IS NOT NULL)
       6 - filter(("B"."AK"<=9 AND "B"."BK"=:P1))
       8 - filter((:P2 IS NOT NULL AND :P1 IS NULL))
       9 - filter(("C"."AK"<=9 AND "C"."CK"=:P2))
    You can see that table C was not really accessed: the buffer count is 0.
    exec :p1 := NULL;
    SELECT /*+ gather_plan_statistics */ A.ak, nvl(b.bk, c.ck) otherk FROM A
    LEFT JOIN b ON A.ak = b.ak AND :p1 IS NOT NULL AND b.bk = :p1
    LEFT JOIN c ON A.ak = c.ak AND :p1 is null and :p2 IS NOT NULL and c.ck = :p2
    WHERE A.ak <= 9;
    SELECT * FROM TABLE(dbms_xplan.display_cursor(NULL,NULL,'IOSTATS LAST'));
    Now table B is not accessed.
    | Id  | Operation             | Name            | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
    |   0 | SELECT STATEMENT      |                 |      1 |        |      9 |00:00:00.02 |       7 |      2 |
    |*  1 |  HASH JOIN OUTER      |                 |      1 |      9 |      9 |00:00:00.02 |       7 |      2 |
    |*  2 |   HASH JOIN OUTER     |                 |      1 |      9 |      9 |00:00:00.01 |       3 |      0 |
    |*  3 |    TABLE ACCESS FULL  | A               |      1 |      9 |      9 |00:00:00.01 |       3 |      0 |
    |   4 |    VIEW               | VW_DCL_5532A50F |      1 |      9 |      0 |00:00:00.01 |       0 |      0 |
    |*  5 |     FILTER            |                 |      1 |        |      0 |00:00:00.01 |       0 |      0 |
    |*  6 |      TABLE ACCESS FULL| B               |      0 |      9 |      0 |00:00:00.01 |       0 |      0 |
    |   7 |   VIEW                | VW_DCL_5532A50F |      1 |      9 |      9 |00:00:00.01 |       4 |      2 |
    |*  8 |    FILTER             |                 |      1 |        |      9 |00:00:00.01 |       4 |      2 |
    |*  9 |     TABLE ACCESS FULL | C               |      1 |      9 |      9 |00:00:00.01 |       4 |      2 |

  • Case statement for interactive report error

    The case computation does not work for me :
    statement
    CASE WHEN G = 7 THEN G ELSE C END
    Error message ' Invalid computation expression. THEN'
    It does not seem to matter what the case statement is IE :
    CASE WHEN I = 'DEMO' THEN 'LOW' ELSE 'HIGH' END
    I have tried this on the Sample Application that is installed on my oracle workspace account
    Column G : order number ( number)
    Column C:order total (Number)
    Column I:sales Rep ( String)
    Can someone please tell me what I am doing wrong ?
    Thanks

    Your statement works for me exactly as you typed it:
    SQL> select * from t;
                       G                    C
                       1                  101
                       2                  102
                       3                  103
                       4                  104
                       5                  105
                       6                  106
                       7                  107
    7 rows selected.
    SQL> select CASE WHEN G = 7 THEN G ELSE C END
      2  from   t;
    CASEWHENG=7THENGELSECEND
                         101
                         102
                         103
                         104
                         105
                         106
                           7
    7 rows selected.

  • CASE Statement for Multiple Criteria

    Hello,
    I need to write a query that will give me a count of customers that fall in three different categories:
    < 1 year
    1 to 3 years
    3 yearsI have written the code to bring me back the 1st set of criteria (< 1 yr). I am using the date connected to a customer's account(s) to return the oldest date attached to an account to put that customer in the appropriate bucket. Below is the code I have for the first piece:
    SELECT COUNT(*) AS One_Year_Or_Less
    FROM
    (SELECT c.lname||', '||c.fname AS Name, MIN(a.contractdate) AS ContractDate
    FROM account a, customer c
    WHERE a.custnbr = c.custnbr
    GROUP BY c.lname, c.fname) yr
    WHERE yr.contractdate BETWEEN TO_DATE('03/02/2005', 'MM/DD/YYYY')
    AND SYSDATE
    The above query runs and returns what I beleive to be an accurate count of customers who fall in the 1 year or less range. My question is; how can I add the criteria of 1 to 3 years and > 3 years to this query. I need to have 3 seperate columns (or 3 seperate rows) that contain the heading of the specific criteria and then the count for that criteria. I was thinking of trying to use a CASE statement but I am unsure of exactly how to do that. Perhaps I could somehow create 3 seperate sub-queries to acheive my goal. Any help with this issue will be greatly appreciated. Thank you.
    Dave Y

    Here's another way. It will only count those that meet the criteria, otherwise it will sum a 0. If you just want 1 row returned with the counts, there's no need for a GROUP BY
    SELECT SUM(CASE
                   WHEN contractdate >  add_months(sysdate,-12) THEN 1
                   ELSE 0
               END) less_than_1_year
          ,SUM(CASE
                   WHEN contractdate >= add_months(sysdate,-36)
                   AND  contractdate <= add_months(sysdate,-12) THEN 1
                   ELSE 0
               END) from_1_to_3_years
          ,SUM(CASE
                   WHEN contractdate <  add_months(sysdate,-36) THEN 1
                   ELSE 0
               END) over_3_years
    FROM ...

  • If else conditional statements for dynamic text fields (as 2.0)

    This is about a self assesment quiz.There will be four options and each one has a scale from1-5 ie "option a" has 1mark, "option b" has 2marks,"option c" has 3 marks, "option d" has 4marks and "option e" has 5 marks and we count the answerd and we display the scor for example if there are 20 question in it if they answered "option e" 5 times the score will be
    25 and option d 5 times the score will be 20,anf if "option c" for 5 times the score will be 15,and "option b" for 3 times  the score will be 6 and "option a" two times the score will be 2, and we add up all the score and display in a dynamic text field called "scor" and the total score is 68.And i have another dynamic text field called "tsc" where i have to display the tags like excellent , good, better ......ect.
    Till now every thing is fine but i am unable to compare them it is displaying excellent even if i get 10 marks, i am unable to configure where i am going wrong.
    If the score is greater than 55 "tsc" should display Excellent, if the score is greater than 41 or less than 55 "tsc" should display Best, if the score is greater than 26 or less than 40 "tsc" should display Better,if the score is none of the above "tsc" should display Poor.
    This is my code on the submit button:
    on (release) {
        gotoAndStop("sQ");
        if (scor>=55) {
            tsc = "Excellent";
        } else if (scor == 41 && scor<=55) {
            tsc = "Best";
        } else if (scor == 26 && scor<=40) {
            tsc = "Better";
        } else if (scor == 10 && scor<=25) {
            tsc = "Good";
        } else {
            tsc = "Poor";
    where:
    "sQ" is the frame name where i am displaying the score details
    "scor" is the var name for the dynamic text field for displaying total score
    "tsc" is the var name for the dynamic text field for displaying the tags llike good, Excellent, better, poor.....etc
    Plese help.......

    Use trace commands to make sure that what you think you are processing is what is actually hapenning.
    Your middle conditionals are not written as you described them... any "==" should be ">="
    It is recommended you get away from using the textfield var option... it can be troublesome to work with.  Just assign an instance name to the textfield and assign the values to its text property... for instance, say you name it tscField, then you would use tscField.text = "Excellent";
    Also, realize that the gotoAndStop command will not happen until after all the code executes in case that matters
    on (release) {
        gotoAndStop("sQ");
        trace(scor);
        if (scor>=55) {
            tsc = "Excellent";
        } else if (scor >= 41 && scor<=55) {
            tsc = "Best";
        } else if (scor >= 26 && scor<=40) {
            tsc = "Better";
        } else if (scor >= 10 && scor<=25) {
            tsc = "Good";
        } else {
            tsc = "Poor";

  • How to save session state for a text item

    hi @averyone,
    i designed in interactive report with one apex_item.text field, let's name it "count"
    normally the report has more then one pages.
    the report should work like a kind of a shopcart.
    the user enters some data into "count" and moves on to the next page(s) enters some more date and so on.
    at the end he/she will press an button to save the data into his shopcart.
    now the problem:
    whenever the page is changed, all data in "count" is lost because the column has no sesseion state.
    any suggestions how to solve this issue without saviing the date in the database everytime the page ist changed?
    thanks in advance
    peter

    Simon,
    i solved the issue using an existing table, which should act quite similar to collections:
    at user request i store all entries in this table & a the end a list of selected rows is presented to the end-user.
    thanks 4 ur assistance
    p.s have a look at the apex api "APEX_ITEM.DISPLAY_AND_SAVE" ?

  • Sql case statement for parametes

    I am using sort parameters in the stored procedure
    the following is my case statment
    CASE When @SORT_1 = 'CUSTOMER'
                     Then ar_ivhdr_tbl.EN_CUST_KEY
                     When @SORT_1 = 'BILLTO'
                    Then ar_bill_tbl.ar_bill_name
                     Else ' ' END SORTKEY
    what i would like to do is
    have the sort key sort by 2 fields so instead of just the customer sort sorting the customer field
    i would like it to sort customer and bill to
    this is the syntax i tried but sql doesnt like it
    CASE When @SORT_1 = 'CUSTOMER'
    Then ar_ivhdr_tbl.EN_CUST_KEY,ar_bill_tbl.ar_bill_key
    When @SORT_1 = 'BILLTO'
    Then ar_bill_tbl.ar_bill_name, date
    Else ' ' END SORTKEY
    syntax issues, any ideas?

    Hi Sharon,
    Your syntax is off.  Not sure what database you are using by it should look something like:
    CASE @SORT_1
    When 'CUSTOMER' Then ar_ivhdr_tbl.EN_CUST_KEY,ar_bill_tbl.ar_bill_key
    When 'BILLTO' Then ar_bill_tbl.ar_bill_name, date
    Else ' '
    END
    Good luck,
    Brian

  • Case sensitivity for text fields

    Does anyone know how to turn off case sensitivity for a text field??
    Your help is appreciated.

    Do you recommend another field type that can be used that does not use case sensitivity?
    Thank you

  • Using a scalar user defined function in a select case statement

    I have a simple select statement below and I want to have a case statement for some conditions based on the result of the udf returned value. I then want the returned value from that specific case statement to be returned where i have indicated 'DISPLAY
    ZIPCODE' below.
    SELECT
        CASE
             WHEN (SELECT Top 1 ZipCode FROM ufn_GetAddressByBusinessEntityIDandAddressTypeID(table1.BusinessEntityID,712) IS NOT NULL THEN 'DISPLAY ZIPCODE'
             WHEN (SELECT Top 1 ZipCode FROM ufn_GetAddressByBusinessEntityIDandAddressTypeID(table1.BusinessEntityID,714) as r) IS NOT NULL THEN 'DISPLAY ZIPCODE'
             ELSE NULL
           END as Zipcode,
    FROM
    table1

    SELECT COALESCE(ufn_GetAddressByBusinessEntityIDandAddressTypeID(table1.BusinessEntityID,712),ufn_GetAddressByBusinessEntityIDandAddressTypeID(table1.BusinessEntityID,712)) AS Zipcode
      FROM table1
    Nope. This is two function calls. coalesce(a, b, c, ...) is just syntatic sugar for
       CASE WHEN a IS NOT NULL THEN a
            WHEN b IS NOT NULL THEN b
            WHEN c IS NOT NULL THEN c
       END
    But if you use isnull it's a different matter. (But isnull() permits two arguments.)
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Problem to identify values in a case statement.

    Hi Friends,
    Total number of records in my report should be divided by 5 and to be alloted into 5 grades in Grade column.
    This is what I have done so far in my report with following layout.
    S.No - Col A - Col B - Col C - Grade ( Colums A,B,C will be hidden in Report)
    *****Column C will have only 5 values at max ( 0.0, 0.2, 0.4, 0.6, 0.8).The below example is for 6 records in a report.The same will be applied for 7,8,9,10 records.
    In column A: MAX(cast(RCOUNT(1) AS DOUBLE))/5 ( Ex : 6/5 = 1.2)
    In Column B: Truncate(MAX(cast (RCOUNT(1) as double)/5), 0) ( Ex : 6/5 = 1.0)
    In Column C: Col A- Col B ( EX:1.2 - 1.0 =0.2)
    (MAX(cast(RCOUNT(1) AS DOUBLE))/5 - Truncate(MAX(cast (RCOUNT(1) as double)/5), 0))
    Now In Grade coulum I want to use this column C to Grade the records with case statements in it.
    I am trying to use the following case statement for Grade Coulmn
    Case
    when (MAX(cast(RCOUNT(1) AS DOUBLE))/5 - Truncate(MAX(cast (RCOUNT(1) as double)/5), 0)) = 0.0 then .........
    when (MAX(cast(RCOUNT(1) AS DOUBLE))/5 - Truncate(MAX(cast (RCOUNT(1) as double)/5), 0)) = 0.2 then .............
    when (MAX(cast(RCOUNT(1) AS DOUBLE))/5 - Truncate(MAX(cast (RCOUNT(1) as double)/5), 0)) = 0.4 then .............
    when (MAX(cast(RCOUNT(1) AS DOUBLE))/5 - Truncate(MAX(cast (RCOUNT(1) as double)/5), 0)) = 0.6 then ........
    when (MAX(cast(RCOUNT(1) AS DOUBLE))/5 - Truncate(MAX(cast (RCOUNT(1) as double)/5), 0)) = 0.8 then .....
    end
    Case statement works gud for 0.0 but not for other 4 values.
    It is unable to identify other 4values.
    Please tell me, how can I make case statement work for all values in above scenario.
    Thanks in Advance,
    Varsha.
    Edited by: Varsha on Nov 28, 2010 6:23 PM

    In column A: MAX(cast(RCOUNT(1) AS DOUBLE))/5 ( Ex : 6/5 = 1.2)
    In Column B: Truncate(MAX(cast (RCOUNT(1) as double)/5), 0) ( Ex : 6/5 = 1.0)
    In Column C: Col A- Col B ( EX:1.2 - 1.0 =0.2)
    (MAX(cast(RCOUNT(1) AS DOUBLE))/5 - Truncate(MAX(cast (RCOUNT(1) as double)/5), 0))Change the formula a bit by adding the by dim value for the MAX column.
    Column A: MAX(cast(RCOUNT(1) AS DOUBLE) by DimTable.Column)/5
    Column B: Truncate(MAX(cast (RCOUNT(1) as double) by DimTable.Column)/5, 0)
    Column C: MAX(cast(RCOUNT(1) AS DOUBLE) by DimTable.Column)/5 - Truncate(MAX(cast (RCOUNT(1) as double) by DimTable.Column)/5, 0)
    now write a case statement on top column c, based on your logic every 5th record will have a value 0.0
    Note: Dimtable.column is the table.column for which the row count is taken.
    Thanks,
    Vino

  • Need help to write case statement

    Hi Guys,
    I have dashboard in which its has pprompt called PROPMT1 in that prompt it has three values A,B,C
    but iwant the full abbreviation of those values like A=APPLE B=BOY and C=Cindy
    and also in the report i have the coloumn is prompted by PROMPT1 which has again A,B,C values that need to be modified as A=APPLE B=BOY and C=Cindy
    how can i do it with case statement.

    For the prompt, write this in the Show window>SQL Results:
    1) CASE WHEN 1=0 THEN char_columnname ELSE 'A = APPLE' END FROM "your subject area" UNION ALL CASE WHEN 1=0 THEN char_columnname ELSE 'B = BOY' END FROM "your subject area" UNION ALL CASE WHEN 1=0 THEN char_columnname ELSE 'C = Cindy' END FROM "your subject area"
    2) Save the prompt to a presentation variable, pv_choice
    This will give you your three values. Make sure you use a CHAR column, doesnt matter what column, though.
    For the report,
    1) Create a BINS column on the column that contains the A, B, C values and make the BINS A = APPLE, B = BOY, C = Cindy just like the prompt values.
    2) Now put a filter on this BINS column and set it equal to your pv_choice presentation variable.
    That's it.
    NOTE: Obviously, if you want the prompt values to just say "APPLE," "BOY," and "Cindy," then take off the 'A = ', 'B = ' and 'C = ' appropriately. Same for the BINS in your report.
    Edited by: David_T on Jun 8, 2011 10:57 AM

  • Issue with case statement

    100*ifnull(x,1)/case when ifnull(yagox,1)=0 then 1 else yagox end)
    based on above condition my result should be like below
    99.8
    101.1
    99.4
    97.7
    Current displaying result like below
    99.8
    1,22,345,000
    99.4
    97.7
    2,34,567,400
    i need to display those two values also in %
    it may be happen denominater(yagox value is 1)
    could please give the proper case statement for resolving the issue
    betham
    Edited by: 961992 on Oct 22, 2012 10:15 PM

    Dear betham,
    welcome to the forum, could you please share the table structure and some sample data and also what your select statement is. This will help people come up with solution faster and also it would avoid going in loops.

  • Problem with Case statement

    I friends,
    I am using a case statement for a number field like this
    case when (customer_no is null or customer_no ='') then t.customer_no else gv.customer_no end as customer_no
    When i complie this i get an errror ORa-00932 inconsistent data types expected char got number....
    when i remove the case statement the query runs fine so i am sure its the case statement thats wrong here..Am i checking it the wrong way...
    Thank you in advance

    874167 wrote:
    I friends,
    I am using a case statement for a number field like this
    case when (customer_no is null or customer_no ='') then t.customer_no else gv.customer_no end as customer_no
    When i complie this i get an errror ORa-00932 inconsistent data types expected char got number....
    when i remove the case statement the query runs fine so i am sure its the case statement thats wrong here..Am i checking it the wrong way...
    Thank you in advancewith Oracle strings are enclosed in single quote marks
    so Oracle is confused & unhappy with line below
    customer_no =''
    since CUSTOMEER_NO is a NUMBER
    why do you compare number to a string?

Maybe you are looking for

  • Submitting a pdf in acrobat 9 (vista) send button doesn't work

    I have created a form in livecycle designer with either "submit by email" (sends xml file) or a submit button with a pdf chosen as submit type. The form works fine in acrobat 9 but when I click on either button and it opens my email client (outlook i

  • Recovery in media center m7580n code purple

    I ran my media center hdd on an msi mobo after my original boards pci x slot went bad, microsoft gave me a new key. I did not like msi board and before I changed it I tried a full recovery, message came up configuration error code purple, so I put it

  • MDM Server Password Reset

    Hi, In our MDM, someone has accidently change the password for the Server. As an Admin, how can I reset the MDM Server level Password without knowing the old password. Regards, Tanveer

  • Shared Server Process

    I have one query regarding Shared Server Process. 1)Why SHUTDOWN needs dedicated server process and not shared server process? Thanks in advance

  • New Window takes awhile to open

    Whenever I try to open a new window, either by clicking New Window, hitting CTRL N, or clicking on a link to open a new window, it takes the window 30+ seconds to launch. While it is in the process of opening Firefox works normally and I can work in