SQL expression in ODI

I Have the following interface in oracle data integrator
http://i44.tinypic.com/2mrsmxt.png
# it execute successfully before inserting the following expression 
  In the mapping I insert the following SQL expression to get the average when the quantity is 0
AVG(
CASE WHEN TEST.QUN = 0 THEN
(SELECT TEST.QUN FROM TEST
WHERE TEST1.PRUDU=TEST.PRUDU
AND TEST1.FLOW=TEST.UNIT
AND TEST1.UNIT=TEST.UNIT
AND to_char(TEST.DATEDDD,'MON')= to_char(TEST1.DATEDDD,'MON')
AND TEST1.DATEDDD !=TEST.DATEDDD
GROUP BY TEST.QUN
ELSE TEST.QUN
END)
when I check this expression in ODI ..
# the sql expression is correct for this  RDMS 
when I executed the interface i get this error
Caused By: java.sql.SQLSyntaxErrorException: ORA-00937: not a single-group group function
any idea ?

I changed the code a little ..
CASE WHEN TEST.QUN = 0 THEN
(SELECT AVG(TEST.QUN) FROM TEST
WHERE TEST1.PRUDU=TEST.PRUDU
AND TEST1.FLOW=TEST.FLOW
AND TEST1.UNIT=TEST.UNIT
AND to_char(TEST.DATEDDD,'MON')= to_char(TEST1.DATEDDD,'MON')
AND to_char(TEST.DATEDDD,'YYYY')!= to_char(TEST1.DATEDDD,'YYYY')
ELSE TEST.QUN
END
And I get this error ..
ORA-01427: single-row subquery returns more than one row tips.
The TEST Table from the source and TEST1 is a lookup table because I couldn't  do the alais in ODI
In sql developer I did the following code that will do the same thing and work successfully ..
update test B
set B.qun=
(SELECT AVG(TEST.QUN) FROM TEST
WHERE  TEST.FLOW=B.UNIT
AND TEST.UNIT=B.UNIT
AND TEST.PRUDU=b.prudu
AND TEST.FLOW=b.flow
AND to_char(TEST.DATEDDD,'MON')= to_char(B.DATEDDD,'MON')
AND to_char(TEST.DATEDDD,'YYYY')!= to_char(B.DATEDDD,'YYYY')
where B.qun=0;
any help ?
thanksssss
naif ..

Similar Messages

  • SQL Expression in decode function or case statement?

    Can I put SQL expressions in decode function or case statement?
    For example,
    select le.profile, decode( select count(1) from profile_data where NAME= 'XXXX_AFTER' and object_id = le.profile, 0, 'N', 'Y')
    from element le;
    or
    select le.profile, case WHEN ( select count(1) from profile_data where NAME= 'XXXX_AFTER' and object_id = le.profile) = 0 THEN 'N'
    ELSE 'Y'
    from element le;
    None of the above work.
    Can anyone tell me how to make it work?
    Is there any workaround?
    Thanks,
    J

    You simply needed and END to your CASE statement;
    SQL> with profile_data as (
       select 'XXXX_AFTER' name, 1 object_id from dual),
         element as (
       select 1 profile from dual union all
       select 2 from dual)
    select le.profile,
       case WHEN ( select count(1) from profile_data where NAME= 'XXXX_AFTER' and object_id = le.profile) = 0
       THEN 'N'
       ELSE 'Y'
       END new_col
    from element le
       PROFILE N
             1 Y
             2 N

  • NOT ABLE TO SEE SQL EXPRESSION FIELDS IN CR2008

    Hi,
    I am not able to see the SQL EXPRESSION FIELDS in the FIELD EXPLORER of CR 2008.Can
    you please help me
    BABASHARI

    Hi,
    I would suggest you open the question in the Crystal Reports forum.
    Ingo

  • SQL Expressions in RAD -Getting error during runtime while generating rpt

    Hi
    We have just migrated from WSAD to RAD Version: 7.0.0.7. 
    The issue is: I am getting the error at the runtime when I am trying to use the SQL expression in my one of the report. The SQL Expression feature is not supported by this version of RAD. I checked the Help contents. It says
    Field Objects: SQL expression fields
    This report contains SQL Expression fields. These fields are not visible in this version of the Crystal Reports designer, but they will be evaluated by the system when the report is executed. New SQL Expression fields cannot be created by the designer. SQL Expression fields will remain in the .rpt file after saving and can be edited by other Crystal Reports designers
    To me it seems you can use the 'SQL Expressions' in the report using some Crystal Reports designers and at the runtime it will be evaluated. So I edited my report with some Crystal Reports Designer and tested it on WSAD. It worked fine. Now since we have migrated to RAD, this is an issue since I am getting the following error:
    ERROR [WebContainer : 0] com.crystaldecisions.reports.formatter.formatter.objectformatter - com.crystaldecisions.reports.dataengine.be: Failed to parse expression.
    [12/17/08 15:12:14:750 EST] 0000001c SystemOut     O 15:12:14,671 ERROR [WebContainer : 0] com.businessobjects.reports.sdk.JRCCommunicationAdapter - Failed to export report
    com.crystaldecisions.reports.exportinterface.exceptions.ExportException: Failed to parse expression.
         at com.crystaldecisions.reports.formatter.a.c.if(Unknown Source)
         at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)
         at com.businessobjects.reports.sdk.b.b.int(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)
    When I remove the expression fields, it works fine on RAD too.
    I am using following versions:
    RAD Version: 7.0.0.7
    Crystal Reports for Rational Application Developer Version: 11.5.6.v20080304.
    Crystal Report Runtime Support version is 11.8.4.v1094
    Please let me know if somebody has faced the similar issue.
    Any help/suggestions would be appreciated.
    Thanks,
    Kamal

    Hi
    We have just migrated from WSAD to RAD Version: 7.0.0.7. 
    The issue is: I am getting the error at the runtime when I am trying to use the SQL expression in my one of the report. The SQL Expression feature is not supported by this version of RAD. I checked the Help contents. It says
    Field Objects: SQL expression fields
    This report contains SQL Expression fields. These fields are not visible in this version of the Crystal Reports designer, but they will be evaluated by the system when the report is executed. New SQL Expression fields cannot be created by the designer. SQL Expression fields will remain in the .rpt file after saving and can be edited by other Crystal Reports designers
    To me it seems you can use the 'SQL Expressions' in the report using some Crystal Reports designers and at the runtime it will be evaluated. So I edited my report with some Crystal Reports Designer and tested it on WSAD. It worked fine. Now since we have migrated to RAD, this is an issue since I am getting the following error:
    ERROR [WebContainer : 0] com.crystaldecisions.reports.formatter.formatter.objectformatter - com.crystaldecisions.reports.dataengine.be: Failed to parse expression.
    [12/17/08 15:12:14:750 EST] 0000001c SystemOut     O 15:12:14,671 ERROR [WebContainer : 0] com.businessobjects.reports.sdk.JRCCommunicationAdapter - Failed to export report
    com.crystaldecisions.reports.exportinterface.exceptions.ExportException: Failed to parse expression.
         at com.crystaldecisions.reports.formatter.a.c.if(Unknown Source)
         at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)
         at com.businessobjects.reports.sdk.b.b.int(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)
    When I remove the expression fields, it works fine on RAD too.
    I am using following versions:
    RAD Version: 7.0.0.7
    Crystal Reports for Rational Application Developer Version: 11.5.6.v20080304.
    Crystal Report Runtime Support version is 11.8.4.v1094
    Please let me know if somebody has faced the similar issue.
    Any help/suggestions would be appreciated.
    Thanks,
    Kamal

  • First time an SQL expression is placed on report a DB SELECT executes

    The same problem can be created using the normal Crystal Reports XI Release 2 developer environment and/or code (not only a code issue). I'm using CR XI.
    Symptom:
    We dynamically auto generate SQL Expressions, Tables, Joins, Formula's and anything through C# and place it onto the Crystal Report through code via run-time user input in a web environment. I recieved a notification from one of my DB admins that crystal reports is causing massive memory consumption via unknown SELECT statements that have no joins and/or WHERE criteria.
    Some Detective Work/More Info:
    After using Microsoft "SQL Profiler" along with Crystal, I understand what is happening but don't know the "work around" to make Crystal stop executing the following SELECT scenario.
    Anytime I create a new "SQL Expression" for the first time and then physically "drag and drop" it onto the report then Crystal is executing a "silent" SELECT statement against the database in the design environment. I'm calling it "silent" because I need MS SQL Profiler to see it happen. I'm guessing that this is used for validation or something but this is causing problems when automatically generating a report in a production environment.
    Steps to re-create:
    1. Open MS "SQL Profiler" and get it running. (will show Crystal Engine silently executes the SELECTS)
    2. Add a new "SQL Expression" to your report.
    3. Drag and Drop your new "SQL Expression onto your report
    4. You will see that Crystal has created an SQL query and executed it against your database in design environment.
    The Problem:
    I can see under normal circumstances why you might want this funtionality (if it's actually used for the Crystal Engine to validate your SQL Expression). But, What also makes this functionality horrible is that on my behalf Crystal is creating these SELECT statements and using cross joins which is a major problem in a production environment. As a result, huge record sets are being created on our DB Server. I don't believe that this has any purpose in a production evironment when the cross-joins can create huge amounts of results just for the sake of Crystal Internally validating a new SQL Expression placed onto a report. It would be nice to disable this functionality in production. I don't know a "work around" since these SELECT queries are created on my behalf by the Crystal Engine at design time (via code auto generation in production).
    Questions:
    Can this functionality be disabled to prevent a production server from incurring the execution of these queries?
    Anybody else notice this and have a "work around"?

    This is a cross post of:
    1st time an SQL expression is placed on report a DB SELECT executes
    Please do not cross post. See the [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement].
    The above post has been moved to the Crystal Reports Design forum, thus locking this thread.
    Ludek

  • 1st time an SQL expression is placed on report a DB SELECT executes

    The same problem can be created using the normal Crystal Reports XI Release 2 developer environment and/or code (not only a code issue).
    Symptom:
    We dynamically auto generate SQL Expressions, Tables, Joins, Formula's and anything through C# and place it onto the Crystal Report through code via run-time user input in a web environment. I recieved a notification from one of my DB admins that crystal reports is causing massive memory consumption via unknown SELECT statements that have no joins and/or WHERE criteria.
    Some Detective Work/More Info:
    After using Microsoft "SQL Profiler" along with Crystal, I understand what is happening but don't know the "work around" to make Crystal stop executing the following SELECT scenario.
    Anytime I create a new "SQL Expression" for the first time and then physically "drag and drop" it onto the report then Crystal is executing a "silent" SELECT statement against the database in the design environment. I'm calling it "silent" because I need MS SQL Profiler to see it happen. I'm guessing that this is used for validation or something but this is causing problems when automatically generating a report in a production environment.
    Steps to re-create:
    1. Open MS "SQL Profiler" and get it running. (will show Crystal Engine silently executes the SELECTS)
    2. Add a new "SQL Expression" to your report.
    3. Drag and Drop your new "SQL Expression onto your report
    4. You will see that Crystal has created an SQL query and executed it against your database in design environment.
    The Problem:
    I can see under normal circumstances why you might want this funtionality (if it's actually used for the Crystal Engine to validate your SQL Expression). But, What also makes this functionality horrible is that on my behalf Crystal is creating these SELECT statements and using cross joins which is a major problem in a production environment. As a result, huge record sets are being created on our DB Server. I don't believe that this has any purpose in a production evironment when the cross-joins can create huge amounts of results just for the sake of Crystal Internally validating a new SQL Expression placed onto a report. It would be nice to disable this functionality in production. I don't know a "work around" since these SELECT queries are created on my behalf by the Crystal Engine at design time (via code auto generation in production).
    Questions:
    Can this functionality be disabled to prevent a production server from incurring the execution of these queries?
    Anybody else notice this and have a "work around"?

    Note that this is a "Lagacy Application Development SDKs" forum and as such it is dedicated to topics related to legacy SDKs, including the Report Designer Component (RDC), OCX, VCL, and Crystal Reports Print Engine (CRPE).
    As your issue concerns the Crystal Report Designer (crw32.exe), transferring to the Crystal Reports Design forum:
    SAP Crystal Reports
    Ludek

  • First time an SQL expression is placed on report a DB SELECT executes -CRXI

    The same problem can be created using the normal Crystal Reports XI Release 2 developer environment and/or code (not only a code issue).
    Symptom:
    We dynamically auto generate SQL Expressions, Tables, Joins, Formula's and anything through C# and place it onto the Crystal Report through code via run-time user input in a web environment. I recieved a notification from one of my DB admins that crystal reports is causing massive memory consumption via unknown SELECT statements that have no joins and/or WHERE criteria.
    Some Detective Work/More Info:
    After using Microsoft "SQL Profiler" along with Crystal, I understand what is happening but don't know the "work around" to make Crystal stop executing the following SELECT scenario.
    Anytime I create a new "SQL Expression" for the first time and then physically "drag and drop" it onto the report then Crystal is executing a "silent" SELECT statement against the database in the design environment. I'm calling it "silent" because I need MS SQL Profiler to see it happen.  I'm guessing that this is used for validation or something but this is causing problems when automatically generating a report in a production environment.
    Steps to re-create:
    1. Open MS "SQL Profiler" and get it running. (will show Crystal Engine silently executes the SELECTS)
    2. Add a new "SQL Expression" to your report.
    3. Drag and Drop your new "SQL Expression onto your report
    4. You will see that Crystal has created an SQL query and executed it against your database in design environment.
    The Problem:
    I can see under normal circumstances why you might want this funtionality (if it's actually used for the Crystal Engine to validate your SQL Expression). But, What also makes this functionality horrible is that on my behalf Crystal is creating these SELECT statements and using cross joins which is a major problem in a production environment. As a result, huge record sets are being created on our DB Server. I don't believe that this has any purpose in a production evironment when the cross-joins can create huge amounts of results just for the sake of Crystal Internally validating a new SQL Expression placed onto a report. It would be nice to disable this functionality in production. I don't know a "work around" since these SELECT queries are created on my behalf by the Crystal Engine at design time (via code auto generation in production).
    Questions:
    Can this functionality be disabled to prevent a production server from incurring the execution of these queries?
    Anybody else notice this and have a "work around"?

    duplicate - please do not post multiple times

  • SQL Browser not started in SQL Express 2012

    I just installed SQL Express 2012 on a Windows Server 2008. I downloaded the advanced 64bit installation file and selected all the options except SSRS. Everything seemed to install successfully including SSMS. I was able to connect to the instance locally
    and create a database. However, when I tries to connect from a client PC, I got the "not configured for remote connections" error. I went into Configuration Manager on the server and saw that that SQL Browser was stopped. But the Start Service option
    was grayed out. How can I enable SQL Browser?
    Darrell H Burns

    Hi, be sure that service is enabled by
    hope it will help you,
    Questo post è fornito "così com'è". Non conferisce garanzie o diritti di alcun tipo. Ricorda di usare la funzione "segna come risposta" per i post che ti hanno aiutato a risolvere il problema e "deseleziona
    come risposta" quando le risposte segnate non sono effettivamente utili. Questo è particolarmente utile per altri utenti che leggono il thread, alla ricerca di soluzioni a problemi similari. ENG: This posting is provided "AS IS"
    with no warranties, and confers no rights. Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. Please Vote This As
    Helpful if it helps to solve your issue. This can be beneficial to other community members reading the thread.

  • How can I Purge in SQL Express database?

    For development purposes, we created a Hyper-V VM running Windows 7 with BizTalk Server 2010 installed running against a SQL Express database. We also installed Visual Studio (licensed) for map development.
    Over time, the BizTalk tables grow, and are taking up way too much storage space.
    I looked at the "Microsoft recommended" method of purging the BizTalk database/tables, but it requires enabling a DTA job in SQL Agent which is not available in SQL Express (as far as I know.)
    How can I purge the BizTalk tables in SQL Express to reclaim storage space?
    Since this is a development platform, I do NOT care about ANY historical data being retained, only "system" data (such as parties, etc.)
    Thanks!!
    Jim Barr

    You can use the various cleanup scripts to purge the database.  Details:
    http://biztalkscheduledtask.codeplex.com/
    Of course, you should not be using SQL Express.

  • Displaying diff dates using PL/SQL expression for 'display only' item ?

    Hi ,
    I am having a display only item -- :P2_FROM_Date . If its Thu,Fri,Sat or Sun I want to set the date as the last Monday's date . If its Mon,Tue or Wed then it should be the present Monday's date .
    E.g: Today is Friday and the last Monday was on 18th .
    So for yesterday , today,tomorrow and Sunday , the date should be displayed as 18-JUN-2012.
    From the coming Monday to Wednesday , the date should of be the coming Monday i.e , 24-JUN-2012
    I tried it doing under 'Source ' of item using PL/SQL expression and PL/SQL function body. Not working
    Can someone help ?
    Thanks & Regards
    Umer

    Nice1 wrote:
    declare
    lv_date number;
    begin
    select to_char(sysdate,'D') into lv_date from dual;
    if lv_date=2 then
    :P2_FROM_DATE := to_char(sysdate-1);
    end if;
    end;I tried this under " PL/SQL function body " in "Source " tab of the item P2_FROM_DATE
    When I run this , nothing is displayed corresponding to the item P2_FROM_DATEExactly as expected. This code will only set a value for <tt>P2_FROM_DATE</tt> when run on Mondays in territories where the first day of the week is Sunday, and when run on Tuesdays where Monday is the first day of of the week:
    SQL> var P2_FROM_DATE varchar2(30)
    SQL> alter session set nls_date_format='Dy DD-MON-YYYY';
    Session altered.
    SQL> select sysdate from dual
    SYSDATE
    Mon 25-JUN-2012
    SQL> alter session set nls_territory='AMERICA';
    Session altered.
    SQL> declare
      2  lv_date number;
      3  begin
      4  select to_char(sysdate,'D') into lv_date from dual;
      5  if lv_date=2 then
      6  :P2_FROM_DATE := to_char(sysdate-1);
      7  end if;
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SQL> print p2_from_date
    P2_FROM_DATE
    Sun 24-JUN-2012
    SQL> alter session set nls_territory='UNITED KINGDOM';
    Session altered.
    SQL> exec :p2_from_date := null
    SQL> declare
      2  lv_date number;
      3  begin
      4  select to_char(sysdate,'D') into lv_date from dual;
      5  if lv_date=2 then
      6  :P2_FROM_DATE := to_char(sysdate-1);
      7  end if;
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SQL> print p2_from_date
    P2_FROM_DATE
    SQL>Hence the questions about language above.
    >
    I am having a display only item -- :P2_FROM_Date . If its Thu,Fri,Sat or Sun I want to set the date as the last Monday's date . If its Mon,Tue or Wed then it should be the present Monday's date .
    E.g: Today is Friday and the last Monday was on 18th .
    So for yesterday , today,tomorrow and Sunday , the date should be displayed as 18-JUN-2012.
    From the coming Monday to Wednesday , the date should of be the coming Monday i.e , 24-JUN-2012
    >
    The coming Monday is 25-JUN-2012.
    Aren't these rules equivalent to "Monday this week, where Monday is the first day of the week"? In which case the PL/SQL Expression you require is:
    trunc(sysdate, 'iw')For example:
    SQL> with t as (
      2    select date '2012-06-21' + level d from dual connect by level <= 17)
      3  select
      4            d
      5          , trunc(d, 'iw')  monday
      6  from
      7            t;
    D               MONDAY
    Fri 22-JUN-2012 Mon 18-JUN-2012
    Sat 23-JUN-2012 Mon 18-JUN-2012
    Sun 24-JUN-2012 Mon 18-JUN-2012
    Mon 25-JUN-2012 Mon 25-JUN-2012
    Tue 26-JUN-2012 Mon 25-JUN-2012
    Wed 27-JUN-2012 Mon 25-JUN-2012
    Thu 28-JUN-2012 Mon 25-JUN-2012
    Fri 29-JUN-2012 Mon 25-JUN-2012
    Sat 30-JUN-2012 Mon 25-JUN-2012
    Sun 01-JUL-2012 Mon 25-JUN-2012
    Mon 02-JUL-2012 Mon 02-JUL-2012
    Tue 03-JUL-2012 Mon 02-JUL-2012
    Wed 04-JUL-2012 Mon 02-JUL-2012
    Thu 05-JUL-2012 Mon 02-JUL-2012
    Fri 06-JUL-2012 Mon 02-JUL-2012
    Sat 07-JUL-2012 Mon 02-JUL-2012
    Sun 08-JUL-2012 Mon 02-JUL-2012
    17 rows selected.
    SQL> alter session set nls_territory='AMERICA';
    Session altered.
    SQL> alter session set nls_date_format='Dy DD-MON-YYYY';
    Session altered.
    SQL> with t as (
      2    select date '2012-06-21' + level d from dual connect by level &lt;= 17)
      3  select
      4            d
      5          , trunc(d, 'iw')  monday
      6  from
      7            t;
    D               MONDAY
    Fri 22-JUN-2012 Mon 18-JUN-2012
    Sat 23-JUN-2012 Mon 18-JUN-2012
    Sun 24-JUN-2012 Mon 18-JUN-2012
    Mon 25-JUN-2012 Mon 25-JUN-2012
    Tue 26-JUN-2012 Mon 25-JUN-2012
    Wed 27-JUN-2012 Mon 25-JUN-2012
    Thu 28-JUN-2012 Mon 25-JUN-2012
    Fri 29-JUN-2012 Mon 25-JUN-2012
    Sat 30-JUN-2012 Mon 25-JUN-2012
    Sun 01-JUL-2012 Mon 25-JUN-2012
    Mon 02-JUL-2012 Mon 02-JUL-2012
    Tue 03-JUL-2012 Mon 02-JUL-2012
    Wed 04-JUL-2012 Mon 02-JUL-2012
    Thu 05-JUL-2012 Mon 02-JUL-2012
    Fri 06-JUL-2012 Mon 02-JUL-2012
    Sat 07-JUL-2012 Mon 02-JUL-2012
    Sun 08-JUL-2012 Mon 02-JUL-2012
    17 rows selected.Also note that using the item source properties will only set the <tt>P2_FROM_DATE</tt> in the rendered page, not in session state.

  • SQL Expression Question

    To the forum members
    In the Crystal Formula Editor, under Print State, there is a function called Previous.  This compares the contents of the current field to the previous one.  Is there a similar function in the SQL Expression Editor.  I'm trying to use a Case When statement to compare the current value in two fields to their previous value.  If these values do not match I need the SQL Expression to add 20 fields together and display the total.
    Thanks in advance.
    B.

    good sql forum
    http://www.sqlteam.com/forums/forum.asp

  • Error using presentation variable in SQL Expression

    Hi all,
    I'm receiving an error - '...Error getting drill information...' due to a presentation variable being used in a SQL Expression. It probably has something to do with a data type issue. I've narrowed the error to the use of the presentation variable.
    I'm setting a presentation variable, pres_mth_nme_to, from a dashboard prompt. The prompt contains a month name.
    I'm using the presentation variable as part of a SQL Expression in a filter. The gist of the SQL Expression is to use the
    presentation variable in a CASE and set a value accordingly. For example:
    Column: Month Sort Value
    Operator: Between
    Value: *10*
    SQL Expression: *Case  @{pres_mth_nme_to}{some default} WHEN 'NOV' THEN '10' WHEN 'DEC' THEN '11' WHEN 'JAN' THEN '12' WHEN 'FEB' THEN '13' WHEN...END*
    The month name is character. If I were to hard code this, I don't recieve the error. For example:
    CASE 'SEP' WHEN 'NOV' THEN '10' WHEN 'DEC' ...END
    There something going on with the data type from the prompt and it being used in the comparison. If I use a CAST, the problem still exists.
    CASE CAST(@{pres_mth_nme_to} as char(3)) WHEN 'NOV' THEN ... END
    If I'm in Answers, the problem doesn't exist, I'm assuming because of the default values. If I'm on the dashboard, it does exist, I'm assuming because of recieving the prompt value.
    I don't know what I'm missing. Any suggestions?
    Thanks.

    DJ,
    if the formula presented by you is exactly true, i mean it was not fabricated to present as an example in the forum, you should include the presentation variable in single quotes.
    i.e. your formula must look somthing like
    Case '@{pres_mth_nme_to}{some default}' WHEN 'NOV' THEN '10' WHEN 'DEC' THEN '11' WHEN 'JAN' THEN '12' WHEN 'FEB' THEN '13' WHEN...END
    let me know if it did solve the issue...
    -bifacts
    http://www.obinotes.com
    Edited by: bifacts on Oct 25, 2010 1:50 PM

  • OBIEE-Presentation Variable in SQL expression in a Column Filter

    Hi,
    I have the following:
    (1) A dashboard prompt having Month names like eg. October,July etc
    (2) I have declared a Presentation Variable by name @{Month}
    (3) A report is there where i have a column called 'Scenario' which has values like 'Actual','Budget','LE_Jul','LE_Oct' etc
    (4) In 'Scenario' column , i have given in the column filter-->SQL Expression as below:
    ('LE_'||SUBSTRING(CAST('@{month}{July}'AS CHAR(40))FROM 3))
    My end result should be like whatever month name(ex. July) is selected in the Dashboard Prompt, my scenario should be equal to 'LE_Jul'.
    I am getting Error like :
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 16001] ODBC error state: 37000 code: 8180 message: [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared.. [nQSError: 16001] ODBC error state: S0002 code: 208 message: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'DIM_SCENARIO'.. [nQSError: 16002] Cannot obtain number of columns for the query result. (HY000)
    Pls give ur inputs if anyone has faced such an issue.
    Thanks.

    Hi,
    I checked that box in Connection Pool Settings.
    But now , though i have data for Scenario "LE_Jul", i still get No Results.
    Kindly let me know what else i am missing out in this regard.
    Thanks.

  • How to change sql expression of SQL-Calculated Attribute of view object ?

    Hi
    jdev 11.1.1.5
    I have a view object with a SQL-Calculated Attribute (sumAnalytic) how can I change sql expression of this attribute in runtime?
    for example in application module method??

    Hi Mr Timo
    Thanks for your reply but I do not need dynamic vo because I can not change all of my vo
    I only need to change expression of SQL-Calculated Attribute of view object in run time.
    For this I set expression in view object something like this 'select 2 from dual' and in run time in my AM method I get the vo query and replace 'select 2 from dual' with something like 'selet sum(amnt) over (partition by 1)' and set new query.
    But I think the better solution must exist
    Thanks

  • SQL Express 2008 R2 Error:15209 - An error occurred during encryption

    I am trying to install SQL Server Express 2008 R2 but it keeps failing .
    The computer is Windows 7 x64, all the latest service packs and updates installed. 
    The application is by Greatland, called Yearli (formerly called WinFiler). 
    Last year’s WinFiler, which was installed on this PC, used SQL 2008 Express (x86). 
    This year’s version is using R2 and attempted to install a new database. 
    I have since uninstalled last year’s database.
    When I run the Yearli install, it first attempts to install SQL Express 2008 R2, but the install fails with this error at the end of ERRORLOG:
    Error: 15209, Severity: 16, State: 1. "An error occurred during encryption."
    I have been researching this for days.  What I have done so far, based on MSKB and other user posts, is the following:
    Changed the account for the SQL service from Local System to NETWORK SERVICE. 
    Add NETWORK SERVICE to the “Protect” folder with Full permission added.
    Neither of these have worked.  SQL appears to be installed, but the service will not start.
    In the Windows System log I get this message:
    The SQL Server (WFP_SS8E) service terminated with service-specific error The specified resource name cannot be found in the image file..
    In the Windows Application log I get this message:
    FileMgr::StartLogFiles: Operating system error 2(The system cannot find the file specified.) occurred while creating or opening file 'e:\sql10_main_t.obj.x86fre\sql\mkmastr\databases\objfre\i386\MSDBLog.ldf'. Diagnose and correct the operating system error,
    and retry the operation.
    The App log error is interesting because there is no E: drive on the system.
    SFC /Scannow came up clean.
    I don’t have any other ideas, so if anyone else does, I’d appreciate it.

    SQL appears to be installed, but the service will not start.
    In the Windows System log I get this message:
    The SQL Server (WFP_SS8E) service terminated with service-specific error The specified resource name cannot be found in the image file..
    In the Windows Application log I get this message:
    FileMgr::StartLogFiles: Operating system error 2(The system cannot find the file specified.) occurred while creating or opening file 'e:\sql10_main_t.obj.x86fre\sql\mkmastr\databases\objfre\i386\MSDBLog.ldf'. Diagnose and correct the operating system error,
    and retry the operation.
    Hi dfosbenner,
    According to your description, SQL Server fails to start and you get the error message (Operating system error 2……) in Windows Application log. To work around this issue, you might have to change the path of the files by running the following scripts from
    the command prompt. The example is to put MSDB files in C drive, you can change the path of the files to other drives.
    NET START MSSQL$SQLEXPRESS /f /T3608
    SQLCMD -S .\SQLEXPRESS
    ALTER DATABASE msdb MODIFY FILE ( NAME = MSDBData, FILENAME = 'C:\MSDBData.mdf');
    ALTER DATABASE msdb MODIFY FILE ( NAME = MSDBLog, FILENAME = 'C:\MSDBLog.ldf');
    go
    exit;
    NET STOP MSSQL$SQLEXPRESS
    For more details, please review the following thread.
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/54bbcac3-41c5-4a5d-a4f6-2669e538dc82/sqlserver-2008-express-install-error?forum=sqlexpress
    Thanks,
    Lydia Zhang

Maybe you are looking for