SQL Expressions

I  guess I really have 2 questions.
I am moving an application from Sybase over to SQL Server. I have created all of my tables. I have also created Scalar-value functions to return a total of a column from a child table based on a value from a master table. The reason I have done this I have multiple child tables that I want to return total on and I would have ahd to create subreports to retreive these totals.
My question first is "How do you call an SQL Expression and could some on show me the code"?
Second question is if I wrote a command to retrieve this scalar-value how would I pass the parameters?
Finally, I guess there were three questions <g>, Should I just go ahead and write the View over in SQL Server and use that for my report?

Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with your directly.
Also please post one question per post so others can use the answers. SQL Expressions are ODBC driven. If the ODBC driver doesn't have the function from DB to DB then you won't be able to use them between DB's you support.

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 &quot;così com'è&quot;. Non conferisce garanzie o diritti di alcun tipo. Ricorda di usare la funzione &quot;segna come risposta&quot; per i post che ti hanno aiutato a risolvere il problema e &quot;deseleziona
    come risposta&quot; 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 &quot;AS IS&quot;
    with no warranties, and confers no rights. Please remember to click &quot;Mark as Answer&quot; on the post that helps you, and to click &quot;Unmark as Answer&quot; 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

  • SQL Express 2008 R2 will not start on Windows 7 Home

    Ok, This used to work, and then over night my system rebooted and now I cannot start SQL Express 2008 R2 after I have unistalled, and re-installed.   Cleared out the folders and the certificates, changed the Named Pipes configuration and all to
    no avail.   Here is my log file.
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    2014-06-14 08:45:18.18 Server      Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64)
        Jun 17 2011 00:54:03
        Copyright (c) Microsoft Corporation
        Express Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)
    2014-06-14 08:45:18.18 Server      (c) Microsoft Corporation.
    2014-06-14 08:45:18.18 Server      All rights reserved.
    2014-06-14 08:45:18.18 Server      Server process ID is 8924.
    2014-06-14 08:45:18.18 Server      System Manufacturer: 'SAMSUNG ELECTRONICS CO., LTD.', System Model: '700Z3A/700Z4A/700Z5A/700Z5B'.
    2014-06-14 08:45:18.18 Server      Authentication mode is MIXED.
    2014-06-14 08:45:18.18 Server      Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.ACT7\MSSQL\Log\ERRORLOG'.
    2014-06-14 08:45:18.18 Server      This instance of SQL Server last reported using a process ID of 2820 at 6/14/2014 8:32:55 AM (local) 6/14/2014 1:32:55 PM (UTC). This is an informational message only; no user action is required.
    2014-06-14 08:45:18.18 Server      Registry startup parameters:
         -d C:\Program Files\Microsoft SQL Server\MSSQL10_50.ACT7\MSSQL\DATA\master.mdf
         -e C:\Program Files\Microsoft SQL Server\MSSQL10_50.ACT7\MSSQL\Log\ERRORLOG
         -l C:\Program Files\Microsoft SQL Server\MSSQL10_50.ACT7\MSSQL\DATA\mastlog.ldf
    2014-06-14 08:45:18.18 Server      SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
    2014-06-14 08:45:18.18 Server      Detected 8 CPUs. This is an informational message; no user action is required.
    2014-06-14 08:45:18.21 Server      Using dynamic lock allocation.  Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node.  This is an informational message only.  No user action is required.
    2014-06-14 08:45:18.23 Server      Node configuration: node 0: CPU mask: 0x00000000000000ff:0 Active CPU mask: 0x00000000000000ff:0. This message provides a description of the NUMA configuration for this computer. This is an informational
    message only. No user action is required.
    2014-06-14 08:45:18.25 spid7s      Starting up database 'master'.
    2014-06-14 08:45:18.28 spid7s      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'ACT7'.
    2014-06-14 08:45:18.29 spid7s      SQL Trace ID 1 was started by login "sa".
    2014-06-14 08:45:18.29 spid7s      Starting up database 'mssqlsystemresource'.
    2014-06-14 08:45:18.30 spid7s      The resource database build version is 10.50.2500. This is an informational message only. No user action is required.
    2014-06-14 08:45:18.32 spid7s      Server name is 'MARTINDAHL-PC\ACT7'. This is an informational message only. No user action is required.
    2014-06-14 08:45:18.32 spid10s     Starting up database 'model'.
    2014-06-14 08:45:18.32 spid7s      Informational: No full-text supported languages found.
    2014-06-14 08:45:18.32 spid7s      Starting up database 'msdb'.
    2014-06-14 08:45:18.33 Server      Error: 17190, Severity: 16, State: 1.
    2014-06-14 08:45:18.33 Server      Initializing the FallBack certificate failed with error code: 1, state: 1, error number: -2146893802.
    2014-06-14 08:45:18.33 Server      Unable to initialize SSL encryption because a valid certificate could not be found, and it is not possible to create a self-signed certificate.
    2014-06-14 08:45:18.33 Server      Error: 17182, Severity: 16, State: 1.
    2014-06-14 08:45:18.33 Server      TDSSNIClient initialization failed with error 0x80092004, status code 0x80. Reason: Unable to initialize SSL support. Cannot find object or property.
    2014-06-14 08:45:18.33 Server      Error: 17182, Severity: 16, State: 1.
    2014-06-14 08:45:18.33 Server      TDSSNIClient initialization failed with error 0x80092004, status code 0x1. Reason: Initialization failed with an infrastructure error. Check for previous errors. Cannot find object or property.
    2014-06-14 08:45:18.33 Server      Error: 17826, Severity: 18, State: 3.
    2014-06-14 08:45:18.33 Server      Could not start the network library because of an internal error in the network library. To determine the cause, review the errors immediately preceding this one in the error log.
    2014-06-14 08:45:18.33 Server      Error: 17120, Severity: 16, State: 1.
    2014-06-14 08:45:18.33 Server      SQL Server could not spawn FRunCM thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.
    -=-=-=-=-=-=-=-=-=-=
    I am logged into either the Administrator Account or my Account in which I am in the Adminstrator Group or an Admin.   My OS is Windows 7 Home Premium Edition, so I cannot clear out the MSSQL groups and things I have seen online.  Since this
    is Express, there is limited capabilities with the config tool.  
    I have tried to change the log in as in the SQL Configuration tool and every item I check, Local Service, Local System, Network Service all give the same error,
    "Cannot Find Object or Property. [0x80042004]
    SInce I have Home Premium, MMC will not load the snap in for Local Users and groups to check out these items.
    A check of the net user shows only the Administrator, Guest and my local login in Admin Account.  net localgroups show these items.
    *Administrators
    *Distributed COM Users
    *Event Log Readers
    *Guests
    *HomeUsers
    *IIS_IUSRS
    *IIS_WPG
    *Performance Log Users
    *Performance Monitor Users
    *SQLServer2005SQLBrowserUser$MARTINDAHL-PC
    *SQLServerFDHostUser$MartinDahl-PC$ACT7
    *SQLServerMSSQLServerADHelperUser$MARTINDAHL-PC
    *SQLServerMSSQLUser$MartinDahl-PC$ACT7
    *SQLServerSQLAgentUser$MARTINDAHL-PC$ACT7
    *Users
    The command completed successfully.
    I checked the SSL and Force Encryption is set to no and the certificates have been cleared.  
    I am not sure how to solve this problem.   Please help.   Thanks, in advance. 

    I created a new Administrator account on the machine, mdahl.   I then started the SQL Configuration Tool and changed the log on to this new account.  Same problem.   Here is the SQL Log.
    2014-06-14 11:24:15.83 Server      Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64)
        Jun 17 2011 00:54:03
        Copyright (c) Microsoft Corporation
        Express Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)
    2014-06-14 11:24:15.83 Server      (c) Microsoft Corporation.
    2014-06-14 11:24:15.83 Server      All rights reserved.
    2014-06-14 11:24:15.83 Server      Server process ID is 11448.
    2014-06-14 11:24:15.83 Server      System Manufacturer: 'SAMSUNG ELECTRONICS CO., LTD.', System Model: '700Z3A/700Z4A/700Z5A/700Z5B'.
    2014-06-14 11:24:15.83 Server      Authentication mode is MIXED.
    2014-06-14 11:24:15.83 Server      Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.ACT7\MSSQL\Log\ERRORLOG'.
    2014-06-14 11:24:15.83 Server      This instance of SQL Server last reported using a process ID of 5952 at 6/14/2014 11:21:35 AM (local) 6/14/2014 4:21:35 PM (UTC). This is an informational message only; no user action is required.
    2014-06-14 11:24:15.83 Server      Registry startup parameters:
         -d C:\Program Files\Microsoft SQL Server\MSSQL10_50.ACT7\MSSQL\DATA\master.mdf
         -e C:\Program Files\Microsoft SQL Server\MSSQL10_50.ACT7\MSSQL\Log\ERRORLOG
         -l C:\Program Files\Microsoft SQL Server\MSSQL10_50.ACT7\MSSQL\DATA\mastlog.ldf
    2014-06-14 11:24:15.83 Server      SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
    2014-06-14 11:24:15.83 Server      Detected 8 CPUs. This is an informational message; no user action is required.
    2014-06-14 11:24:15.87 Server      Using dynamic lock allocation.  Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node.  This is an informational message only.  No user action is required.
    2014-06-14 11:24:15.88 Server      Node configuration: node 0: CPU mask: 0x00000000000000ff:0 Active CPU mask: 0x00000000000000ff:0. This message provides a description of the NUMA configuration for this computer. This is an informational
    message only. No user action is required.
    2014-06-14 11:24:15.90 spid7s      Starting up database 'master'.
    2014-06-14 11:24:15.91 spid7s      1 transactions rolled forward in database 'master' (1). This is an informational message only. No user action is required.
    2014-06-14 11:24:15.91 spid7s      0 transactions rolled back in database 'master' (1). This is an informational message only. No user action is required.
    2014-06-14 11:24:15.91 spid7s      Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
    2014-06-14 11:24:15.92 spid7s      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'ACT7'.
    2014-06-14 11:24:15.93 spid7s      SQL Trace ID 1 was started by login "sa".
    2014-06-14 11:24:15.93 spid7s      Starting up database 'mssqlsystemresource'.
    2014-06-14 11:24:15.93 spid7s      The resource database build version is 10.50.2500. This is an informational message only. No user action is required.
    2014-06-14 11:24:16.03 spid7s      Server name is 'MARTINDAHL-PC\ACT7'. This is an informational message only. No user action is required.
    2014-06-14 11:24:16.03 spid10s     Starting up database 'model'.
    2014-06-14 11:24:16.03 spid7s      Informational: No full-text supported languages found.
    2014-06-14 11:24:16.03 spid7s      Starting up database 'msdb'.
    2014-06-14 11:24:16.03 Server      Error: 17190, Severity: 16, State: 1.
    2014-06-14 11:24:16.03 Server      Initializing the FallBack certificate failed with error code: 1, state: 1, error number: -2146893802.
    2014-06-14 11:24:16.03 Server      Unable to initialize SSL encryption because a valid certificate could not be found, and it is not possible to create a self-signed certificate.
    2014-06-14 11:24:16.03 Server      Error: 17182, Severity: 16, State: 1.
    2014-06-14 11:24:16.03 Server      TDSSNIClient initialization failed with error 0x80092004, status code 0x80. Reason: Unable to initialize SSL support. Cannot find object or property.
    2014-06-14 11:24:16.03 Server      Error: 17182, Severity: 16, State: 1.
    2014-06-14 11:24:16.03 Server      TDSSNIClient initialization failed with error 0x80092004, status code 0x1. Reason: Initialization failed with an infrastructure error. Check for previous errors. Cannot find object or property.
    2014-06-14 11:24:16.03 Server      Error: 17826, Severity: 18, State: 3.
    2014-06-14 11:24:16.03 Server      Could not start the network library because of an internal error in the network library. To determine the cause, review the errors immediately preceding this one in the error log.
    2014-06-14 11:24:16.03 Server      Error: 17120, Severity: 16, State: 1.
    2014-06-14 11:24:16.03 Server      SQL Server could not spawn FRunCM thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.
    Also, the link you provided is to Windows Vista, not Windows 7 Home Premium.  However, I did look at the registry setting they said to look at in the link.
    Locate the following registry subkey:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
    Under the ProfileList subkey, delete the subkey that is named <var>SID</var>.bak.
    Note <var>SID</var> is a placeholder for the security identifier (SID) of the user account that is experiencing the problem. The <var>SID</var>.bak subkey should contain a ProfileImagePath registry entry that points to the original profile
    folder of the user account that is experiencing the problem.
    Exit Registry Editor.
    Looking into my registry for my ProfilesList as mentioned. I have these items.
    S-1-5-19 Folder with Default (Value not set), Flags (REG_DWORD) 0x0000000, ProfileImagePath (REG_EXPANDS_SZ) C:Windows\ServiceProfiles\LocalService, State (REG_DWORD) 0x0000000
    S-1-5-20 Folder with Default (Value not set), Flags (REG_DWORD) 0x0000000, ProfileImagePath (REG_EXPANDS_SZ) C:Windows\ServiceProfiles\NetworkService, State (REG_DWORD) 0x0000000
    Then I have an item for each of my three accounts, Administrator, Martin Dahl, and mdahl, All admin Accounts, which has no sid.bak, but a Sid, so not sure how this link helps me either.   Still looking for assistance.  Still not starting.

Maybe you are looking for