Error by subtracting 2 columns  (SQL results-Cube Results)

Hi,
I am running a report, where i compare the number of room nights by resort and month for 2011, with the number of room nights generated with a SQL script.
It is not a problem generating a column in the same report showing the number of room nights from SQL, but when I add a column to calculate the variance, get the below error:
Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 22818, message: ORA-22818: subquery expressions not allowed here at OCI call OCIStmtExecute. [nQSError: 17010] SQL statement preparation failed. (HY000)
SQL Issued: SELECT Resort.Resort saw_0, Time."Month" saw_1, Time."Date Order" saw_2, "Non Revenue Facts".Rooms saw_3, "Non Revenue Facts".Stays saw_4, "Non Revenue Facts"."Arrival Adults" saw_5, evaluate('(select sum(stay_rooms) from reservation_stat_daily where to_char(business_date,''RR'')=''11'' and to_char(business_date,''Mon-RR'')=%1 and resort=%2 )', Time."Month",Resort.Resort) saw_6, CAST(evaluate('(select sum(stay_rooms) from reservation_stat_daily where to_char(business_date,''RR'')=''11'' and to_char(business_date,''Mon-RR'')=%1 and resort=%2 )', Time."Month",Resort.Resort)as DOUBLE)-"Non Revenue Facts".Rooms saw_7 FROM RESV_HISTORY WHERE (Time."Year" = '2011') ORDER BY saw_2
Without the variance column, it is working fine:
SELECT Resort.Resort saw_0, Time."Month" saw_1, Time."Date Order" saw_2, "Non Revenue Facts".Rooms saw_3, "Non Revenue Facts".Stays saw_4, "Non Revenue Facts"."Arrival Adults" saw_5, evaluate('(select sum(stay_rooms) from reservation_stat_daily where to_char(business_date,''RR'')=''11'' and to_char(business_date,''Mon-RR'')=%1 and resort=%2 )', Time."Month",Resort.Resort) saw_6 FROM RESV_HISTORY WHERE (Time."Year" = '2011') ORDER BY saw_2
Any idea?
Regards
G.

Hi G,
The EVALUATE() is only to call any DB level functions from BI Server. So, I guess the issue is with the SQL Statement that you are asking the DB to execute through EVALUATE().
I think you may want to try creating a .rpd based column for your select and see.
Hope this helps.
Thank you,
Dhar

Similar Messages

  • ABAP/4 Open SQL array insert results in duplicate database records in SM58

    Hi Everyone,
    I am testing a file to idoc scenario in my Quality system. When I passed the input file, the mapping executed successfully and there are no entries in SMQ2 but still the idoc wasn't created in the ECC system. When I have checked in TRFC, I am getting the error  ABAP/4 Open SQL array insert results in duplicate database records for IDOC_INBOUND_AYNCHRONOUS function module. I thought this is a data issue and I have tested with a fresh data which was never used for testing in Quality but even then I am getting the same error.Kindly advise.
    Thanks,
    Laawanya

    use FM idoc_status_write_to_database to change the IDoc status from 03 to 30 and then  run WE14 or  RSEOUT00 to change the status back to 03
    resending idoc from status 03 ...is a data duplicatino issue on receiving side...why do u need to do that ?
    Use WE19 tcode to debug
    In we19
    1)U can choose your Idoc number in existing Idoc textbox
    2)Press execute
    3)u will display ur Idoc struct
    4)Dbl click on any field then u can modify its content
    5)PressStd Outbound Processing Btn to process modified Idoc
    Thats it

  • RPD - Cannot obtain number of columns for the query result :Working with MS SQL 2012 schema

    Hi All,
    I have created my warehouse in MS SQL 2012.
    For management purpose, I have created different schemas in SQL database
    In RPD, Physical layer, when i view data > I get error as
    [nQSError:16002] Cannot obtain number of columns for the query result.
    [nQSError:16001] ODBC error state : S0002 code : 208 message: [Microsoft][ODBC SQL Server Driver][SQL Server] Invalid object name 'tbl'..
    [nQSError:16001] ODBC error state : S0002 code : 208 message: [Microsoft][ODBC SQL Server Driver][SQL Server] Statements could not be prepared..
    I have already browsed : OBIEE 11g Strange ODBC Driver Error with SQL Server : Total Business Intelligence ... did not help me
    please help!!!

    Hi All,
    After all R&D it is been found that Oracle business administrator( RPD) needs default dbo schema. It doesn't accept custom schema for pulling data.
    If anybody have other views please share.!!
    Thank you

  • A server error occurred on the current command. the results if any should be discarded in SQL 2008 R2

    Hi,
    I am using SQL server 2008 R2 and also MultipleActiveResultSet = true and Pooling = true (default value) in connection string.
    While executing query 'IF ORIGINAL_LOGIN() = SUSER_SNAME() EXECUTE AS USER = 'MyUser'', I received error stating  'A server error occurred on the current command. the results if any should be discarded'. At the same time I could check that SqlConnection
    state is also closed.
    I have also fired 'REVERT' query If I find such exception and again try to execute same query again. but no luck. I received the same exception while executing query (Execute As) again.
    What can be the solution to avoid such exception and make my code working?
    Thanks,
    Ashish

    Login failed for user 'sa'. The user is not associated with a trusted SQL Server connection.
    Above issue occurs genrally when authentication mode is set to Windows Authentication insted Mixed Mode.
    You can change the authentication mode of the SQL server from “Windows Authentication Mode (Windows Authentication)” to “Mixed Mode (Windows Authentication and SQL Server Authentication)”.
    Run following script in SQL Analyzer to change the authentication
    LOGIN sa ENABLE
    GO
    ALTER LOGIN sa WITH PASSWORD = '<password>'
    GO
    http://blog.sqlauthority.com/2007/04/14/sql-server-fix-error-18452-login-failed-for-user-null-the-user-is-not-associated-with-a-trusted-sql-server-connection/
    But as per the first post it seems issue is different have you observerd Error log?
    Check out at C:\Program Files\Microsoft SQL Server\MSSQL.n\MSSQL\LOG\ERRORLOG
    Location might differ as per the Server configration
    Please click the Mark as answer button and vote as helpful if this reply solves your problem

  • Error: The ABAP/4 Open SQL array insert results in duplic in EWM

    Hi Friends,
    During outbound process in EWM, my completed EWM delivery gets stuck in SMQ1 with error "The ABAP/4 Open SQL array insert results in duplic". I performed following checks and found all the ok. Please help me with your insights.
    - Checked the Master data Products, Business Partners,are CIFed properly. Yes they are done properly.
    - Checked if inbound is stuck in same way. But its not.
    - Checked if there is any enhancement stopping in ECC. There is some enhancement in Document_save in ECC outbound delivery which I got it commented. Still the problem is same.
    Please suggest what could be the root cause.
    Thanks
    Trivedi

    Hi Rushikesh,
    I checked all Number ranges (O/D in EWM and ECC, HU and Batches). All are ok. I tried taking help of ABAPer to see if any Run time errors occuring but no use.
    Regards,
    Trivedi

  • How to change font size, maximum column size in the result screen ?

    hi All
    That's great when using SQL Dev.
    But I also have a trouble that how to change font size, maximum column size in the result screen ?
    My users think that font in result screen is shown very small, and whenever the data in each colum is long then it's not shown full data in column, they must double click for extend the size. Have the option to default the max size for showing full data in each column ? I try but still not to do that .
    Appreciate for anyone to help us.
    Thanks all.
    Sigmasvn

    You can't change the font for the results screen yet, however you will be able to select an auto-fit option for selected columns, so if some columns have slitghtly wider text you'll be able to set the column widths to handle these wider columns.
    Also, there s the option of switching the layout of a record in the grid.
    Sue

  • Message "Error in connection:No result set, result attempts = 100" on VC

    Hi,
    I am using a JDBC datasource to retrieve, update, insert and delete information from a SQL Server database using executing store procedures from VC.
    The selection of the data is perfect but for the deletion, insert or update of any data using store procedures I always get the following message:
    "Error in connection:No result set, result attempts = 100"
    At the end the information is modified in the database but I get error.
    Here is an example of one of my store procedure:
    CREATE PROCEDURE [dbo].[DelData]
         @id uniqueidentifier
         -- Add the parameters for the stored procedure here
    AS
    BEGIN
         -- SET NOCOUNT ON added to prevent extra result sets from
         -- interfering with SELECT statements.
         SET NOCOUNT ON;
        -- Insert statements for procedure here
         delete from data     
           WHERE Rowid=@id;
    END
    Let me know if somebody knows the reason of this and if there is something that I am doing wrong.
    Thanks,
    Zareh

    Hi,
    when you SELECT data, you get a result. So your connection gets a result set. When you DELETE, INSERT,... you have no result, because you didn't select data. So your connection can't get any result sets.
    best regards,
    Christian

  • The ABAP/4 Open SQL array insert results in duplicate database records

    Hi,
    Iam getting following error :
    The ABAP/4 Open SQL array insert results in duplicate database records.
    Error in ABAP application program.
    The current ABAP program "SAPLV60U" had to be terminated because one of the
    statements could not be executed.
    This is probably due to an error in the ABAP program.
    " Information on where terminated
    The termination occurred in the ABAP program "SAPLV60U" in "VBUK_BEARBEITEN".
    The main program was "SAPMSSY4 ".
    The termination occurred in line 503 of the source code of the (Include)
    program "LV60UF0V"
    of the source code of program "LV60UF0V" (when calling the editor 5030).
    Processing was terminated because the exception "CX_SY_OPEN_SQL_DB" occurred in
    the
    procedure "VBUK_BEARBEITEN" "(FORM)" but was not handled locally, not declared
    in the
    RAISING clause of the procedure.
    The procedure is in the program "SAPLV60U ". Its source code starts in line 469
    of the (Include) program "LV60UF0V "."
    Please assist how to proceed further ..
    Many thanks
    Mujeeb.

    Sorry, THe correct note is 402221.
    Description from the note
    << Please do not post SAP notes - they are copyrighed material >>
    Edited by: Rob Burbank on Feb 22, 2009 3:46 PM

  • The ABAP/4 Open SQL array insert results in duplic

    Hi All,
        During monitoring of our SAP SRM system in SM58 transaction we have received the below error. Please advise on this.
    The ABAP/4 Open SQL array insert results in duplic
    SM58 for Wf-BATCH user
    SRM/MM: FM SPPF_PROCESS
    thanks and regards
    mohammed

    What action did you performed?

  • He ABAP/4 Open SQL array insert results in duplicate database records

    Dear Gurus,
    II am getting a dump when I run MD02/ MD03. (t- code to run MRP)
    Below is the message system is showing:
    Please help
    Thanks in Advance
    Best Regards
    Adhish
    Short text
    The ABAP/4 Open SQL array insert results in duplicate database records.
    What happened?
    Error in the ABAP Application Program
    The current ABAP program "SAPLM61U" had to be terminated because it has
    come across a statement that unfortunately cannot be executed.
    Error analysis
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught
    in
    procedure "INSERT_MDSBI_IN_MDSB" "(FORM)", nor was it propagated by a RAISING
    clause.
    Since the caller of the procedure could not have anticipated that the
    exception would occur, the current program is terminated.
    The reason for the exception is:
    If you use an ABAP/4 Open SQL array insert to insert a record in
    the database and that record already exists with the same key,
    this results in a termination.
    (With an ABAP/4 Open SQL single record insert in the same error
    situation, processing does not terminate, but SY-SUBRC is set to 4.)
    1 *----
    2 * ARRAY-INSERT auf MDSB
    3 *----
    4 FORM INSERT_MDSBI_IN_MDSB.
    INSERT MDSB6 FROM TABLE MDSBI.
    7 ADD SY-DBCNT TO STATS-RESBI. "statistics
    8 ENDFORM.

    Hi,
    There must be inconsistency in the number range. This happens when the current number in the number range for dependent requirements is lower than the highest number in the database table of the dependent requirements RESB.
    Please check the current number in transaction OMI2. Here in the interval you can see the current number. Then please check the highest number in table RESB. If the current number in OMI2 is lower than the highest number in table RESB then this should be the reason for the dump.
    Check and revert. If that's not the case we'll look into other possibilities.
    In mean time check for SAP Note 138108.

  • How to Create a new column from two different result sets

    How to Create a new column from two different result sets, both the result set uses the different date dimensions.

    i got solutions for this is apply filters in column formula it self, based on the requirement.

  • How can I remove the Location column from the search results in a .chm file?

    How can I remove the Location column from the search results in a .chm file?
    I generated the file in Robohelp HTML 9.
    As far as I know it's used when you've combined more than one source into the final help file. It is possible (though I don't remember doing it) that I did that once a couple of years ago but now I'm only using one source - the project that's generating the .chm.
    Can anyone tell me how I can remove it?
    Thanks
    Tom

    In Project Setup look at the Window properties. I think you will find Advanced Search is ticked.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • APEX 4.0 Report Query column limitation, 43 column maximum for the result!

    Hi there,
    I'm trying to generate report from Apex 4.0.1, but I got stucked with column limitation when I'm executing the report query.
    Case:
    Environment: oracle 11g, apex 4.0.1, oracle BI 11, windows xp
    Table: My test table is quite simple, by creating a sample table with 44 columns, the column name is random, i.e. column1..column44, column data type is varchar2 (20)
    report query:my report query is also simple, by "select * from testtable"
    Data: no data in my sample table
    Error: then I'll get the error: "HelpORA-06502: PL/SQL: numeric or value error: character string buffer too small"
    solution: If I shrink the table column from 44 to 43, then the report can be generated to xls, pdf, etc.
    Question: Is there any column limitation for Apex report query? I know there's a 32k row size limitation for varchar, but since there's no single data in my table, it shouldn't be the case.
    Does anybody get this issue before? Thanks for any generous input!! :)
    Horatio

    hi marko,
    Thanks for the reply, but i can't find the 45 column limitation from report query and report printing. any clue for this call?
    Regards
    Horatio

  • How to use : bind character in DB adapter Select Query SOA11g. Getting Error code :17003 .java.sql.SQLException: Invalid column index error

    Hi All,
    The Actual query to perform is below.
    SELECT name,number from emp  WHERE CASE WHEN :1='T' AND term_date IS Not NULL THEN 1 WHEN :1='A' AND term_date IS NULL THEN 1 WHEN :1='ALL' THEN 1 ELSE  1 END = 1;
    I have tried in DB adapter like below as a parameter for :1 as #vInputParam
    SELECT name,number from emp  WHERE CASE WHEN #vInputParam='T' AND term_date IS Not NULL THEN 1 WHEN #vInputParam='A' AND term_date IS NULL THEN 1 WHEN #vInputParam='ALL' THEN 1 ELSE  1 END = 1;
    Getting Error code :17003 .java.sql.SQLException: Invalid column index error.
    Please suggest me on using ':' bind character in DB adapter Select Query SOA11g.
    Can someone help me on this please?
    Thanks,
    Hari

    Hi,
    Could you please make sure your binding style(Oracle Positional,Oracle named..etc) of the Seeded VO and Custom Vo are same.
    This is the option you will get when you are extending your vo. So make sure that both are same.
    You can refer the below link too
    VO extension leads to "Invalid column index" exception
    Thanks
    Bharat

  • The ABAP/4 Open SQL array insert results in duplicate Record in database

    Hi All,
    I am trying to transfer 4 plants from R/3 to APO. The IM contains only these 4 plants. However a queue gets generated in APO saying 'The ABAP/4 Open SQL array insert results in duplicate record in database'. I checked for table /SAPAPO/LOC, /SAPAPO/LOCMAP & /SAPAPO/LOCT for duplicate entry but the entry is not found.
    Can anybody guide me how to resolve this issue?
    Thanks in advance
    Sandeep Patil

    Hi Sandeep,
              Now try to delete ur location before activating the IM again.
    Use the program /SAPAPO/DELETE_LOCATIONS to delete locations.
    Note :
    1. Set the deletion flag (in /SAPAPO/LOC : Location -> Deletion Flag)
    2. Remove all the dependencies (like transportation lane, Model ........ )
    Check now and let me know.
    Regards,
    Siva.
    null

Maybe you are looking for

  • Camera Roll Trouble

    OK, so when I go to the photos app on my iPhone 3GS, and I tap Camera Roll, only about half of my pictures show up. The rest are simply black thumbnails. However, when I tap on one, the picture shows up full screen. This is really annoying, and I wou

  • What is the best lossless compression for video?

    I have a large amount of captured video, which is saved in uncompressed format. I want to archive this video and I need to figure out what the best compression choice is. It's video only and I want the archived materials to be compressed as losslessl

  • Why this page has missing elements in FFox 8.0 ( running Lion 10.7)

    Why this page does not display the missing .png's on the bottom. looks fine in all other browsers http://www.jordieshapiro.com/home.html

  • Keynote audio for Windows

    I'm trying to prepare a slide presentation in Keynote, that I'll export into Windows.  I can also prepare the presentation in the Mac Version of PowerPoint in Office. My problem is in embedding an audio file.  I know AIFF will not work on a Windows m

  • Flash email from won't work

    Hi I'm trying to create a email form in flash, using action script and php. I've followed all the steps but nothing happens when the enter button is clicked. i've got a feeling it's something very simple and stupid I've missed. I've put all the relev