SQL Query Issue - (inner not passing to outer query)

Hello everyone:
Here is my SQL query:
SELECT RD.SITE,
  ROUND(
  (SELECT COUNT (DISTINCT PB.EMP_ID)
  FROM BOOK PB
  WHERE PB.EMP_ID IN
    (SELECT PB.EMP_ID FROM BOOK PB
  (SELECT COUNT (DISTINCT PB.EMP_ID)
  FROM BOOK PB
  WHERE PB.EMP_ID IN
    (SELECT PB.EMP_ID FROM BOOK PB
WHERE MO.QUALIFIER > 4
  )* 100, 2) AS PERCENTAGE
FROM BOOK PB
LEFT JOIN POSITION MO
ON PB.EMP_ID = PO.EMP_ID
INNER JOIN PHYS_LOCATION RD
ON MO.HOUSED         = RD.SITE_ID
WHERE MO.ACTUAL_END IS NULL
GROUP BY RD.SITE;Why am I getting the overall percentage for all Sites as opposed to each percentage calculating for each individual site. I grouped by RD.SITE, so I presumed it would calculate percentages for each site. What did I do wrong?
Thank you for your assistance.

AquaNX4 wrote:
Hello everyone:
Here is my SQL query:
SELECT RD.SITE,
ROUND(
(SELECT COUNT (DISTINCT PB.EMP_ID)
FROM BOOK PB
WHERE PB.EMP_ID IN
(SELECT PB.EMP_ID FROM BOOK PB
(SELECT COUNT (DISTINCT PB.EMP_ID)
FROM BOOK PB
WHERE PB.EMP_ID IN
(SELECT PB.EMP_ID FROM BOOK PB
WHERE MO.QUALIFIER > 4
)* 100, 2) AS PERCENTAGE
FROM BOOK PB
LEFT JOIN POSITION MO
ON PB.EMP_ID = PO.EMP_ID
INNER JOIN PHYS_LOCATION RD
ON MO.HOUSED         = RD.SITE_ID
WHERE MO.ACTUAL_END IS NULL
GROUP BY RD.SITE;Why am I getting the overall percentage for all Sites as opposed to each percentage calculating for each individual site. I grouped by RD.SITE, so I presumed it would calculate percentages for each site. What did I do wrong?Because that is what you are requesting. Your scalar subquery to get the percentage is not restricted by the current site. Add filter columns to restrict the selected values for the computation
Edited by: riedelme on May 8, 2013 7:26 AM

Similar Messages

  • My query prompts does not appear in the Query prompt order list!

    Dear colleagues,
    All of my query prompts does not appear in the Query prompt order list in properties of the query. It seems random which of them that appears there and not.
    This makes it impossible for me to control or change the order of prompts, instead they order themselves alphabetically.
    Is this some kind of bug? Is there a fix for this problem?
    Regards
    Silje

    Hi Stratos,
    We use Edge.
    Correction- we use Enterprise, changed a few months ago!
    By the way, we heard about a bug that probarly causes the problem.
    If the query has ever had a prompt containing 'Between', all prompts created afterwards will not appear in the prompt order list! Even if the between-prompt is deleted.. We still havent heard about a fix for this, please contact me if you hear anyting. It is not an option to create all the queries from scratch again!
    Silje
    Edited by: Silje Mari Sunde on Oct 22, 2009 9:24 AM

  • [SQL Question] to_char function not eliminating time from query results

    Have a query that returns a time/date field, and I want to eliminate the time, because its not necessary
    select distinct c.short_name as client, c.client_id, p.list_id, p.entity_id, e.aid, a.first_name, a.last_name,
    p.sf_completed_date, p.email_sent, p.consent_given as dw1_consent, e.share_info_approved as rb_consent
         from profiles p, entities@ROADBED_ASPHALT_READ e,           clients@ROADBED_ASPHALT_READ c,
         lists@ROADBED_ASPHALT_READ l, associates@ROADBED_ASPHALT_READ   a
              where e.share_info_approved = 'Y'
              and sf_completed_date > trunc(to_date('09/11/2006', 'mm/dd/yyyy'))
              and e.list_id in  (715,/*959,*/993,/*995,*/1001,/*1106,*//*1252,*//*1292,*/1321,/*1354,*/1882,/*2061,*/2173,2273,2306,/*2334,*//*2464,*/2693,
    2716,2754,2779,2805,2863,/*2864,*//*2939,*/2966,/*3411,*/3412,3602,3679,/*3886,*//*4011,*//*4026,*//*4295,*/4777,4837,5418,7640)
              and p.entity_id = e.entity_id
              and p.list_id = l.list_id
              and l.client_id = c.client_id
              and e.aid = a.aid
              order by c.short_name, a.first_name, a.last_name, sf_completed_date;This query will run by the column of sf_completed_date, it still isn't getting ride of the time, and I have no idea why.
    thanks

    Use the function substr(p.sf_completed_date, (instr(p.sf_completed_date,'/',1) + 1), length(p.sf_completed_date))
    example :
    SQL> select instr('1234/5678', '/',1) from dual;
    INSTR('1234/5678','/',1)
    5
    Result gives the position of character '/'.
    SQL> select length('1234/5678') from dual;
    LENGTH('1234/5678')
    9
    SQL>
    Result gives length of the string - the last character.
    Now ----
    SQL> select substr('1234/5678',(instr('1234/5678', '/',1) + 1), length('1234/5678')) from dual;
    SUBS
    5678
    SQL>
    The result gives you the desired result after / here in your case the date
    Hope the example will help you to solve the problem
    Surej.
    Message was edited by:
    Surej

  • Results from conditions not passed to Jump query

    Dear all,
    I have created a summary query and I have a condition applied on it. The condition is 'KF' < 4. I get the results of the query. I have changed the Calculate Result As to 'Total' to show the total of only the records that are displayed.
    However I have a jump query on it and when I goto the Jump query, it shows all the records though they dont satisfy the conditions. I want the drill down report to show the results of only those values displayed in the Summary report.
    Is there a setting where I can change to get the required result.
    Any helpful reply would be awarded.
    thanks,
    KK

    Hey Roberto,
    Thank you for the reply. Yes I would also need to have the same condition in the reciever query. However, my condition is on result values in the reciever query. To explain u clearly...
    I have the data as below in my cube
    Material   QTY
    123     10
    124     20
    125     30
    126     40
    I have a summary query for which I want a condition where QTY < 40
    When I enter Material 123;124;125;126 I get the result as below
    Material   QTY
    123     10
    124     20
    125     30
    When I drill down I get the below result
    123     1     2
    123     2     4
    123     3     4
    <b>Result          10</b>
    124     1     5
    124     2     10
    124     3     5
    <b>Result          20</b>
    125     1     10
    125     2     10
    125     3     10
    <b>Result          30</b>
    126     1     10
    126     2     20
    126     3     10
    <b>Result          40</b>
    I cannot apply the same condition in the reciever query because I want the condition to be applied on the result rows. I have created one more formula KF with SUMCT(QTY) and applied condition on that but it still doesnt work.
    Any suggestions would be highly appreciated.
    thanks,
    KK

  • 2.1 EA1: Query Builder does not update View Results query

    When using the Query Builder, if you click onto the View Results tab to see the current query results, then go back to the "Select Columns" or "Create Where Clause" tabs to change the query, the "View Results" tab still shows the results of the original query even if none of the tables or columns from the original query exist. Clicking the Run Report button or setting a refresh interval has no effect.
    On a further note, the query builder still is not reentrant, in that you can't select (highlight a portion of or position the cursor within) a query and open the query builder for that query to graphically make modifications.

    Sentinel,
    The issue is known and is listed in the known issues in the release notes for the early adopter. We hope to have this addressed for production.
    The re-entrant query builder is still on our list of things to do. We plan to rewrite the Query Builder and address a number of the requests related to this feature. I'm hoping to make it a priority for the next release.
    Sue

  • Formatting web form query fields to be passed to RFC query FM

    We have a web front end used to query the SAP sales database. The fields can accept multiple or range selections. We have written a couple of FM (RFC enabled function modules) to retrieve the data based on the queries.
    The question is, what is the best way to handle multiple selections in the FM interface. Currently we are using SELOPT structures to handle the select criteria.
    On the web front end, is it simple and feasable to format the form fields in the SELOPT structure or is there a better way.
    Below is the interface currently proposed for the FM:
    FUNCTION ZE_GET_SALES_ORDERS.
    ""Local interface:
    *" IMPORTING
    *" REFERENCE(I_ORDER_STATUS) TYPE CHAR01 OPTIONAL
    *" REFERENCE(I_INVOICE_AUTH_FLAG) TYPE CHAR01 OPTIONAL
    *" TABLES
    *" T_VALID_SOLDTO STRUCTURE SELOPT
    *" T_SOLDTO STRUCTURE SELOPT OPTIONAL
    *" T_CUSTOMER_PO STRUCTURE SELOPT OPTIONAL
    *" T_SALES_ORDER STRUCTURE SELOPT OPTIONAL
    *" T_DATE_RANGE STRUCTURE SELOPT OPTIONAL
    *" T_STARS_QUOTE STRUCTURE SELOPT OPTIONAL
    *" T_BILLTO STRUCTURE SELOPT OPTIONAL
    *" T_SHIPTO STRUCTURE SELOPT OPTIONAL
    *" T_INVOICE_NUM STRUCTURE SELOPT OPTIONAL
    *" T_ORDER_HEADERLIST STRUCTURE ZORDERVIS_ORDERHEADER OPTIONAL
    *" T_INVOICE_LIST STRUCTURE ZORDERVIS_INVOICE_LIST OPTIONAL
    *" T_ORDER_HEADERLIST_SUMM STRUCTURE
    *" ZORDERVIS_ORDERHEADER_SUMMARY OPTIONAL
    *" T_SELECT_PARAMS STRUCTURE W3QUERY OPTIONAL
    *" T_ORDER_CREATE STRUCTURE SELOPT OPTIONAL
    *" EXCEPTIONS
    *" VALIDATION_CUST_MISSING
    Any advice or direction would be greatly appreciated.
    Thanks in advance,
    Jennifer

    Basically you can't! The RFC iView is in my opinion a bad way to get data out of SAP. It is difficult to edit and passing paramaters is a nightmare.
    Any chance you can use Visual Composer instead, or maybe right a little portal component to do the same thing?
    Ps: if you're using SSO< the username that is used to start the RFC is the same username in the backend system, so maybe you can use sy-uname?
    Cheers

  • Query hangs with outer query

    Hi,
    OS: SPARC 64 bit
    Oracle Version: 10.2.0.3.0 64 bit
    My query hangs when I include the outer query. When I execute without outer query It comes out in a fraction of second but when I includes outer query it starts hang
    Below is my original query which hangs
    select * from (select raw_sql_.**, rownum raw_rnum_ from (SELECT /*+ FIRST_ROWS */ NETWORK_ID||'","'||CALLER_NUMBER||'","'||CALLED_NUMBER FROM CDR FROM CDR WHERE 1 = 1
    AND day_of_year = 99 AND INTERFACE = 'TRAFIC' AND TIME_STAMP BETWEEN to_date('2009/04/08 00:00:00','yyyy/mm/dd hh24:mi:ss') AND to_date
    ('2009/04/09 00:00:00','yyyy/mm/dd hh24:mi:ss') AND NETWORK_ID IN (1025,1026) order by id desc) raw_sql_ WHERE rownum <= 10000) WHERE raw_rnum_ > 0;
    when I execute this it will come out immediately
    select raw_sql_.**, rownum raw_rnum_ from (SELECT /*+ FIRST_ROWS */ NETWORK_ID||'","'||CALLER_NUMBER||'","'||CALLED_NUMBER FROM CDR FROM CDR WHERE 1 = 1
    AND day_of_year = 99 AND INTERFACE = 'TRAFIC' AND TIME_STAMP BETWEEN to_date('2009/04/08 00:00:00','yyyy/mm/dd hh24:mi:ss') AND to_date
    ('2009/04/09 00:00:00','yyyy/mm/dd hh24:mi:ss') AND NETWORK_ID IN (1025,1026) order by id desc) raw_sql_ WHERE rownum <= 10000
    select * from (select raw_sql_.**, rownum raw_rnum_ from (SELECT /*+ FIRST_ROWS */ NETWORK_ID||'","'||CALLER_NUMBER||'","'||CALLED_NUMBER FROM CDR FROM CDR WHERE 1 = 1
    AND day_of_year = 99 AND INTERFACE = 'TRAFIC' AND TIME_STAMP BETWEEN to_date('2009/04/08 00:00:00','yyyy/mm/dd hh24:mi:ss') AND to_date
    ('2009/04/09 00:00:00','yyyy/mm/dd hh24:mi:ss') AND NETWORK_ID IN (1025,1026) order by id desc) raw_sql_ WHERE rownum <= 10000) WHERE raw_rnum_ > 0;
    but when I includes outer query I hangs it is really very weird for me?
    Here is the explain plan for that query
    Execution Plan
    Plan hash value: 3493649369
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
    | 0 | SELECT STATEMENT | | 1 | 2015 | 1 (0)| 00:00:01 | | |
    |* 1 | VIEW | | 1 | 2015 | 1 (0)| 00:00:01 | | |
    |* 2 | COUNT STOPKEY | | | | | | | |
    | 3 | PARTITION RANGE SINGLE | | 1 | 5894 | 1 (0)| 00:00:01 | 99 | 99 |
    | 4 | PARTITION LIST ALL | | 1 | 5894 | 1 (0)| 00:00:01 | 1 | 48 |
    |* 5 | TABLE ACCESS BY LOCAL INDEX ROWID| CDR | 1 | 5894 | 1 (0)| 00:00:01 | 4705 | 4752 |
    | 6 | BITMAP CONVERSION TO ROWIDS | | | | | | | |
    |* 7 | BITMAP INDEX SINGLE VALUE | IX_CDR_INTERFACE | | | | | 4705 | 4752 |
    Predicate Information (identified by operation id):
    1 - filter("RAW_RNUM_">0)
    2 - filter(ROWNUM<=10000)
    5 - filter("DAY_OF_YEAR"=99 AND "TIME_STAMP">=TO_DATE('2009-04-08 00:00:00', 'yyyy-mm-dd hh24:mi:ss') AND
    "TIME_STAMP"<=TO_DATE('2009-04-09 00:00:00', 'yyyy-mm-dd hh24:mi:ss') AND ("NETWORK_ID"=1025 OR
    "NETWORK_ID"=1026))
    7 - access("INTERFACE"='TRAFIC')
    can one explain why it happen? what could be the reason? Is it a bug or something? what should I do now? Issue is critical in the production enviromentent
    Waiting for your Valuable Reply
    Thanks In Advance
    With Regards
    Boo

    user454189 wrote:
    I suspect the issue with the where clause (raw_rnum_ > 0)
    Actually I using bitmap index on ' INTERFACE' column. Does it causing a prob or raw_rnum_ causing a problem?Boo,
    a couple of comments:
    1. Why do you use the deprecated FIRST_ROWS hint? From 9i on the FIRST_ROWS_n mode should be used instead, and since you're using a top-N query format the hint should be superfluous anyway since the optimizer should switch to FIRST_ROWS_n mode automatically.
    2. Why do you use a BITMAP index and not a conventional b*tree index? Let me hazard a guess: Because the INTERFACE column has a small number of distinct values? That would be in most cases a bad idea.
    3. What seems to be odd that you're accessing the data via the BITMAP index on INTERFACE, but request an ORDER BY ID DESC. But there is no order by in the execution plan posted. I wonder where the order should come from? Can you show us the DDL of the bitmap index?
    4. What does the plan look like if you run only the inner query without the outer query?
    You can always gain more information by tracing the statement execution or using the GATHER_PLAN_STATISTICS hint together with the DBMS_XPLAN.DISPLAY_CURSOR function.
    Please read this HOW TO: Post a SQL statement tuning request - template posting that explains what you should provide if you have SQL statement tuning question and how to format it here so that the posted information is readable by others.
    This accompanying blog post shows step-by-step instructions how to obtain that information.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Performance issue with NOT LIKE 'VA%' in Sql Query

    I'm fetching vendor details from po_vendor_sites_all , in the where clause i use vendor_site_code NOT LIKE 'VA%'. Database:10g
    NOT LIKE is reducing the performance, any other option to increase the performance.
    Any suggestions?
    Thanks
    dow005

    Assuming a fairly even distribution of vendor_site_codes and assuming a LIKE 'VA%'
    would pick up 1% of the rows and assuming an index on vendor_site_codes
    and a reasonable clustering we might expect that query to use an index.
    Your query is NOT LIKE 'VA%' which implies picking up 99% of the rows = Full table scan.
    The only option I can think of is to use parallelism in your query (if the system has the
    power to handle it) or perhaps use more where clause restrictions on indexed column(s)
    to reduce the number of rows picked up.
    I've had to assume a lot of things as you don't give any info about the table and data.
    If you could provide more information we might be able to help more.
    See SQL and PL/SQL FAQ
    Edited by: Paul Horth on 02-May-2012 07:12

  • ORA-06504: PL/SQL: Return types of Result Set variables or query do not mat

    Hello.
    I am trying to assign a weak type ref cursor to a strong type ref cursor. I call a procedure that executes a query using a SYS_REFCURSOR passed in as an IN OUT argument. After the procedure executes, I assign the passed in ref cursor to a strong type ref cursor in the calling procedure. I have found that if I use a static SQL statement in the procedure, the process works, but if I use a dynamic SQL statement in the procedure, I get the error message noted in the subject.
    I am running Oracle 9i on Solaris.
    Thanks for any thoughts on the matter.

    Thanks Bob,
    The Package spec part was created successfully.
    I am still confused about fetching records though.
    You said that 'Select Statement will populate the ref cursor.'
    But I do not have
    OPEN FOR
    SELECT
    INTO
    FROM
    I simply open o_cur_var
    select from several tables where........
    and then I am using FETCH statement.
    What's a better approach?
    How should I fetch values of o_cur_var?
    If I use SELECT INTO, should I use records that I declared in the package o_cur_type (..........)?

  • Query Issue with Inner JOIN

    I need to create the following SQL query in Toplinks, but cannot figure out how to do it. I just want to get all Contacts that have their InitialEventID set to some integer, or have a mapping in the ContactEvents table set to that integer. The mapping between Contacts and ContactEvents is @OnetoMany.
    Select DISTINCT Contacts.* from Contacts JOIN ContactEvents ON (Contacts.ID = ContactEvents.ContactID) WHERE (ContactEvents.EventID = 34 OR Contacts.InitialEventID = 34);
    I'm trying the following, but it obviouly doesn't work.
    SELECT DISTINCT c FROM Contacts c INNER JOIN c.contactEventsCollection ce WHERE ce.eventID = 34
    What should I do?

    Other than the query missing the 'or' clause, why isn't the query working, and what SQL gets generated? You can turn TopLink logging to Fine or Finest to get the SQL logged. You might also want to use OUTER JOIN intead since I assume that Contacts with an InitialEventID=34 may or may not have any ContactEvents associated with it:
    SELECT DISTINCT c FROM Contacts c OUTER JOIN c.contactEventsCollection ce WHERE ( (ce.eventID = 34) OR (c.InitialEventID = 34) )
    Best Regards,
    Chris

  • Filters not getting passed in MDX query while using SAP BW with OBIEE

    Hello,
    I've been working on OBIEE with SAP BW as back-end. I've created some reports & those are working fine when there is less amount of data. But when I try to run a report with 3 dimensions & 1 fact it throws an error saying "No more storage space available for extending an internal table". When I checked MDX query, I found that the filters that I had applied to request & also selected from prompts are not getting passed in that query. So, I tried running a simple request using a simple filter in Answers. Although this request returns results but I can't see filter conditions in query. MDX query always show crossjoin but I can't see filter conditions anywhere.
    Is it the normal OBIEE behaviour OR am I doing something wrong in there? Can you please help me out with this?
    Thanks,
    Rocky

    Hello Sainath,
    We tried those things. But it is still giving same error.
    State: HY00. Code: 10058. [NQODBC][SQL_STATE:HY000][nQSError: 10058] A general error has occurred. XML/A error returned from the server: Fault code: "XMLAnalysisError.0X80000005". Fault string: "The XML for Analysis provider encountered an error: MDX result contains too many cells (more than 1 million)". (HY000)
    The problem here, I think, is the filter parameters are not getting passed in the MDX query. Any idea why would that happen? Is there any setting to do so?
    Thanks in advance for help.
    Regards,
    Rocky

  • Filters 'OR' function not passing the values to the sql

    Hi,
    I am facing an issue with the 'OR' function on the filters that are used in the reports.
    The report needs to fetch all the records on the three tables as the user enters the value in the dashboard prompts.
    eg: [   update_dt_A1 is prompted
    and user_name_A1 is prompted ]
    or
    [    update_dt_B1 is prompted
    and user_name_B1 is prompted ]
    or
    [    update_dt_C1 is prompted
    and user_name_C1 is prompted ]
    The values entered in the dashboard prompt gets passed to the filter, but the vaules are not passed over to the SQL that runs on the database, hence the reports shows all values and does not reflect the values entered.
    When the 'OR' function is replaced with 'AND' the values get passed to the SQL.
    Can anyone help on what is the issue on the filters?
    Thanks

    Here is how my Filters are set up
    Vendor Name is Prompted
    AND
    Vendor Number is Prompted
    AND
    [   [Last_update_date_Vendor is prompted
    AND
    User_name_Vendor is prompted]
    OR
    [Last_update_date_Site is prompted
        AND
        User_name_Site is prompted]
    OR
    [Last_update_date_Bank is prompted
        AND
        User_name_Bank is prompted]
    The values from the dashboard prompts gets passed to the filter, but the sql that runs does not take the values in the where clause.

  • ORA-29540: class oracle/xml/sql/query/OracleXMLStaticQuery does not exist

    I am getting below error when trying to generate xml. Browsing on google did not help me. I would appreciate if someone can provide the solution.
    SQL> select dbms_xmlquery.getxml('select * from dual', 2) from dual;
    ERROR:
    ORA-29540: class oracle/xml/sql/query/OracleXMLStaticQuery does not exist
    ORA-06512: at "SYS.DBMS_XMLQUERY", line 19
    ORA-06512: at "SYS.DBMS_XMLQUERY", line 271
    ORA-06512: at line 1

    Then it is probably not the case that you are affected by the issue described in Metalink document 185857.1, but if I were you I would check it anyway, since it might be the problem.

  • [Execute SQL Task] Error: Executing the query "DECLARE_@XMLA nvarchar(3000) ,__@DateSerial nvarch..." failed with the following error: "Incorrect syntax near '-'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly,

    Hi
    DECLARE @XMLA nvarchar(3000)
    , @DateSerial nvarchar(35);
    -- Change date to format YYYYMMDDHHMMSS
    SET @DateSerial = CAST(GETDATE() AS DATE);
    --SELECT @DateSerial
    Set @XMLA = 
    N' <Batch xmlns="http://schemas.microsoft.com/analysis services/2003/engine">
     <ErrorConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2"
    xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200"
    xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200">
    <KeyErrorLimit>-1</KeyErrorLimit>
    <KeyNotFound>IgnoreError</KeyNotFound>
    <NullKeyNotAllowed>IgnoreError</NullKeyNotAllowed>
     </ErrorConfiguration>
     <Parallel>
    <Process xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2"
    xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200"
    xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300" xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300">
     <Object>
     <DatabaseID>MultidimensionalProject5</DatabaseID>
     <CubeID>giri</CubeID>
     <MeasureGroupID>Fact Internet Sales</MeasureGroupID>
     </Object>
     <Type>ProcessFull</Type>
     <WriteBackTableCreation>UseExisting</WriteBackTableCreation>
     </Process>
      </Parallel>
    </Batch>';
    EXEC (@XMLA) At SHALL-PCAdventureWorksDw ;
     iam executive the    query when iam getting below error.
      [Execute SQL Task] Error: Executing the query "DECLARE
    @XMLA nvarchar(3000)
    , @DateSerial nvarch..." failed with the following error: "Incorrect syntax near '-'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set
    correctly, or connection not established correctly. 
     how to solve this error;
     please help me

    What are you trying to do? What sort of data source is  SHALL-PCAdventureWorksDw?
    When you use EXEC() AT, I would execpt to see an SQL string to be passed to EXEC(), but you are passing an XML string????
    If you explain why you think this would work in the first place, maybe we can help you.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • SQL 2005 v9.0.2047 (SP1) - The query processor could not produce a query plan

    Hi Everyone:
    *Before* I actually call up Microsoft SQL Customer Support Services and ask them, I wanted to ping other people to see if you have ever ran into this exact error
    "Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support Services."
    I would have searched the forums myself, but at this moment in time, search is broken :(
    If anyone has run into this error before, what conditions would exist that this could happen?  That is, if I can sniff this out with suggestions from the community, I would be happy to do so. 
    It is an oddity because if I alter a couple subqueries in the where clause [ i.e., where tab.Col = (select val from tab2 where id='122') ]to not have subqueries [hand coded values], then the t-sql result is fine.  It's not as if subqueries are oddities... I've used them when appropriate.
    fwiw - Not a newbie t-sql guy.  ISV working almost daily with t-sql since MS SQL 2000.  I have never seen this message before...at least I don't recall ever seeing it.
    Thanks in advance for other suggested examination paths.

    This code also produces the error... the text is from an incident a while ago that I reported to microsoft.
    --I just found a way to break the query engine. Looks like the SQL Server team missed something. I was generating phony data for test cases, by the way.
    --Bad code:
    DECLARE @t_Asset TABLE
    (Asset_Id INT)
    INSERT INTO @t_Asset (Asset_Id) VALUES (1)
    INSERT INTO @t_Asset (Asset_Id) VALUES (2)
    INSERT INTO @t_Asset (Asset_Id) VALUES (3)
    DECLARE @Record_id INT
    ,@File_id NVARCHAR(MAX)
    ,@SKP_Cust_id NVARCHAR(MAX)
    ,@Unique_Barcode NVARCHAR(MAX)
    SELECT @Record_Id = (SELECT TOP 1 Asset_Id FROM @t_Asset)
    , @file_id = (SELECT LEFT(REPLACE(CAST(NEWID() AS NVARCHAR(50)), '-', ''), 10))
    ,@Unique_Barcode=(SELECT LEFT(REPLACE(CAST(NEWID() AS NVARCHAR(50)), '-', ''), 15))
    go
    --Msg 8624, Level 16, State 116, Line 12
    --Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support Services.
    --Code that doesn’t fry the optimizing engine:
    DECLARE @t_Asset TABLE
    (Asset_Id INT)
    INSERT INTO @t_Asset (Asset_Id) VALUES (1)
    INSERT INTO @t_Asset (Asset_Id) VALUES (2)
    INSERT INTO @t_Asset (Asset_Id) VALUES (3)
    DECLARE @Record_id INT
    ,@File_id NVARCHAR(MAX)
    ,@SKP_Cust_id NVARCHAR(MAX)
    ,@Unique_Barcode NVARCHAR(MAX)
    SELECT @Record_Id = (SELECT TOP 1 Asset_Id FROM @t_Asset)
    SELECT @file_id = (SELECT LEFT(REPLACE(CAST(NEWID() AS NVARCHAR(50)), '-', ''), 10))
    SELECT @Unique_Barcode=(SELECT LEFT(REPLACE(CAST(NEWID() AS NVARCHAR(50)), '-', ''), 15))

Maybe you are looking for

  • How do i get the doc to always appear at the bottom of the screen even if i am in an application?

    how do i get the doc to always appear at the bottom of the screen even if i am in an application?

  • Focusrite Pro 40 set up

    Does anyone know how to set up a Focusrite Sapphire Pro 40 in an iMac-downloaded driver but says firewire disconnected. This is a new imac and I am using the thunderbolt to firewire adapter and an 800/400 belkin cable. thanks muche

  • Where can I find firefox 3.0 ?

    Hello, This can seem strange but I need to install FF '''3.0''' :( on my Windows 7 system in order to test my Javascript application (customer constraint). Where can I find it ? Is there any way to install it on a PC where FF 5.0 already installed ?

  • Freehand MX activation woe's

    I have Freehand MX from the Studio MX2004 suite I bought a few years back. Since then I've upgraded to Studio 8, and now again to CS 3 (which is awesome). I don't normally use freehand, and I used to use it on my PC, but I've moved across to Mac (Stu

  • Putting Leopard on Older Macbook

    I have an older macbook pro with 10.4 and Intel core duo, my mom just bought a new macbook, can I use her install disc to put the leopard that came with her new computer on my older macbook pro?