Invalid prompt Error in derived table

hello All,
I have the below query which works in SQL server...but the same query in derived table is giving invalid prompt error when instead of hardcoding the value...I gave  @prompt for user input value.
SELECT
  convert(varchar(6), dateadd(MM,-3, convert(datetime, substring(cast(EMR_REPORTING.dbo.vMH_MEASURE_PRACTICE.RPT_YEAR_MONTH as varchar), 5,2) + '/' + '30' + '/'+ substring(cast(EMR_REPORTING.dbo.vMH_MEASURE_PRACTICE.RPT_YEAR_MONTH as varchar), 1,4))), 112) as prequarter,
  Primed_Status,
  EHR
FROM
  EMR_REPORTING.dbo.vMH_MEASURE_PRACTICE
  where RPT_YEAR_MONTH = '201406'
SELECT
  convert(varchar(6), dateadd(MM,-3, convert(datetime, substring(cast(EMR_REPORTING.dbo.vMH_MEASURE_PRACTICE.RPT_YEAR_MONTH as varchar), 5,2) + '/' + '30' + '/'+ substring(cast(EMR_REPORTING.dbo.vMH_MEASURE_PRACTICE.RPT_YEAR_MONTH as varchar), 1,4))), 112) as prequarter,
  Primed_Status,
  EHR
FROM
  EMR_REPORTING.dbo.vMH_MEASURE_PRACTICE
  where RPT_YEAR_MONTH = @Prompt('Enter values for Rpt Year Month:','N','Folder\MeasurePractice\Rpt Year Month',Mono,Constrained)
Thanks in advance for any inputs.
Regards.

Please check the Prompt definition and whether you are entering all the parameters in the prompt syntax.  As I could see there are only 5 parameters there in your prompt definitions

Similar Messages

  • Way to use Prompts , UDFs in Derived table

    Hi guys,
    In our org we have been using prompts in the derived tables. Derived table would return Single final select statement. Now that report requirements are complex we would have to use table variables, UDFs, and many select, delete, update statements. How should we handle many such statements in a derived table to return a result set for the report?
    If we cannot handle many selects in a derived table, I am hoping to use Table-Valued Function in the derived table something like this:
    create myFunction()
    Returns Table as (......)
    select * from myFunction()
    But then I should be able to use the user input prompts in the syntax: @PROMPT('test1','A',Multi,,). The user would input 5 such prompts from the report.
    Any ideas from anyone who has used Prompts, UDFs in a derived table?
    Environment: BO X1r2, Crystal x1r2, sql server 2005
    Thanks !

    In the past, I have opted to create complex logic in a server-side procedure, complete with prompts.  The prompt are passed to and presented in Crystal.  This way, instead of splitting the logic between UDFs, derived tables and prompts, you can keep the logic in a relatively tidy procedure.

  • ORA - 00922 Missing or Invalid option error while creating table

    I am tryin to create a table with the following syntax
    1 CREATE TABLE TEST_FOR_SCRIPT (
    2 TEST_A NUMBER NOT NULL
    3 ,TEST_B VARCHAR2(30) DEFAULT 'UNDEFINED' NOT NULL
    4 )
    5* @storage_parms_table_cmn
    6 /
    @storage_parms_table_cmn
    ERROR at line 5:
    ORA-00922: missing or invalid option
    Here, storage_parms_table_cmn.sql reads like this
    tablespace DBK_CMN_DATA
    Can anyone please guide me how to overcome this error.

    What is your Oracle Version?
    i can do it exactly what you did without error
    sql> CREATE TABLE vd.TEST_FOR_SCRIPT (
    2 TEST_A NUMBER NOT NULL
    3 ,TEST_B VARCHAR2(30) DEFAULT 'UNDEFINED' NOT NULL
    4 )
    5 @test1.sql
    6 /
    Table created.
    Cheers
    http://fiedizheng.blogspot.com/

  • Business Rule - Invalid prompt error - Security flaw?

    Hello all,
    I have a business rule in which users transfers volume from one cost center to another. The users have write access to sending cost centers and no access to receiving and this is how it is need. When I designed the rule and during the testing the business rule ran fine. I am pretty sure that I ran the rule successfully with a test user setup with a lower access to test the scenario. But now the rule has stopped working. It will work only if I give write acess to user to both sending and receiving cost center.
    The error message is " The following value is not valid for the run time prompt it was entered for: CCName."
    As far as I understand, the security controls access to objects like calc scripts. The access just gives users the rights to view/run the script but what ever is written in script, even if it outside the scope of user access, it will still get executed. I am positive that I have done this before and it worked fine.
    Any ideas as to why this wont work and why the error would start popping up? Nothing has been changed in the system.

    Hi Amit,
    The person running the rule will need to have read access to both cost centers in order to transfer otherwise as you have seen the prompt will be invalid -- when select the prompt you should find the cost center that have no access to do not appear in the prompt itself. If you a value that the prompt does not make available then it will error out.
    If you do not want to provide read access to both cost centers, you may be able to setup a multi-step process with a transfer out by a previous owner and transfer in by the new owner using a temporary cost center both have read access to -- workforce planning uses both (one step and two step) depending on how your security is provisioned.
    Regards,
    -John

  • Prompt error/invalid in Derived table

    Hello everyone...
    I have a filter in my Universe.
    filter1
    dbo.RPT_YEAR_MONTH= dateadd(month, -3, @Prompt('Enter values for Rpt Year Month:','N','Folder\MeasurePractice\Rpt Year Month',Mono,Constrained))
    Now i want to write a derived table...I expect that the derived table should select data for primed status when input for reporting period is given and miuns 3 months to that input perios and give data for Primed Status.
    But i am getting an invalid prompt error for below...
    Select
    dbo.vMH_MEASURE_PROVIDER.PRIMED_STATUS
    from
    dbo.vMH_MEASURE_PROVIDER
    Where
    dbo.vMH_MEASURE_PRACTICE.RPT_YEAR_MONTH= dateadd(month, -3, @Prompt('Enter values for Rpt Year Month:','N','Folder\MeasurePractice\Rpt Year Month',Mono,Constrained))

    Please check the Prompt definition and whether you are entering all the parameters in the prompt syntax.  As I could see there are only 5 parameters there in your prompt definitions

  • Can we create prompts in Derived Table sql query

    Hi,
    I am trying to define derived table sql query as below. Though the syntax parsing is going through but when I am generating the report it is throwing and invalid prompt definition error.
    " select * from table_a where call_direction = @Prompt('Enter Call Direction','A','"derivedtable_a".SHORT_STRING',mono,free,not_persistent,) and
    where call_type = @Prompt('Enter Call Direction','A','"derivedtable_b".SHORT_STRING',mono,free,not_persistent,) "
    Can somebody please share your thoughts if this can be achieved in universe or not ?
    Appreciate immediate responses as it is a show stopper for my deliverable.
    Thanks in advance.
    Thanks and Regards,
    Shireen.

    Hi Shireen
    We can use prompt in the derived table. There is issue with the SQL that you have used while creating the Derived Table.
    Instead of using the "derivedtable_a".SHORT_STRING' field use the object from the class on which you are creating the derived table.
    For example: If you are creating a derived table in the sample universe efashion on Agg_yr_qt_rn_st_ln_ca_sr table then use the following query:
    SELECT *
    FROM Agg_yr_qt_rn_st_ln_ca_sr
    WHERE Agg_yr_qt_rn_st_ln_ca_sr.Yr = @Prompt ('Enter Value','C','Time Period\Year',mono,constrained)
    Hope this helps!
    Thanks

  • @prompt functions usage in Derived table

    How can we use prompt functions in Derived table?.Please repaly ASAP.
    Advanced thanks.
    Thanks&Regards
    Ramu

    Hi Ramu,
    It is quite straight foward.You define your derived table using the normal sql but then put in the @prompt code in the where clause.
    This worked for me in XI 3.0 using the Efashion universe.
    SELECT
    Article_Lookup_criteria.Article_Lookup_criteria_id,
    Article_Lookup_criteria.Article_criteria_id,
    Article_Lookup_criteria.criteria_type
    FROM
    Article_Lookup_criteria
    WHERE
    Article_Lookup_criteria.criteria_label = @prompt('Label,'A',,Mono,Free,Presistent)
    Regards
    Alan

  • Derived table

    Plz re-Play
      @ functions,@ prompts @ awareness are using in Derived table

    Hi,
    You can use @functions, @Prompts, @awareness in Derived Tables.
    But
    ■Do not use derived tables instead of aggregate tables.
    And see the following site for full Information.....
    http://www.msatish.com/sap-businessobjects-designer-universe-using-derived-tables/
    All the Best,
    Madhu...

  • Pl/SQL is prompting "invalid number" error

    Hello Sir/Madam,
    I'm not very clear why pl/sql cursor is prompting "invalid number" error.
    I need to load single as well as multi Gas meter data for an automation process.  The procedure is loading single meter data fine, but when I add multi meter data to that table it is halting and prompting "invalid number".  I made sure that each record is unique. Define primary key based on three field ( they are: SERVICEPOINTID, METERID, and ENDDATE )
    in the sample file, they are in that order
    I would appricaite your help & explantions on this issue
    sample procedure code:
    CREATE OR REPLACE procedure GSO_SBX_ADMIN.row_add_v2 is
    rct_cnt number := 0;
        header_key gso_hourlylog_header.hrly_log_hdr_ky%TYPE;
        dailyorder_key gso_hourlylog_header.DLY_ORDER_KY%TYPE;
        customer_key gso_customer_log.CUST_KY%TYPE;
        channel_key gso_cust_channel_privs.CHNNL_KY%TYPE;
        custlog_key gso_customer_log.CUST_LOG_KY%TYPE;
        hourly_custlog_detail_key gso_hourly_cust_log_detail.HRLY_CUST_LOG_DTL_KY%TYPE;
        customer_name GSO_CUSTOMER_LOOKUP.CUST_NM%TYPE;
        row_processing_status VARCHAR2(100) := '';
        other_customerlog_issue VARCHAR2(5) := 'FALSE';
        ls_curr_user VARCHAR2(30) := 'GSO_PROCESS_IEE_INTO_GSO';
        record_processable VARCHAR2(5) := '';
        rec_processing_timestamp TIMESTAMP;
    begin
    for daily_gis_add in
            SELECT '', METERID, ENDDATE, HOURENDING, VOLUMEVALUE, CUSTOMERNAME, DEVICEID, CUSTOMERID, SERVICEPOINTID
            FROM GSO_IEE_STAGE gis where  trunc(gis.loaded_dt) = trunc(sysdate)
    loop
    insert into gso_iee_process_log
        VALUES
              rec_processing_timestamp,
              daily_gis_add.METERID,
              daily_gis_add.ENDDATE,
              daily_gis_add.HOURENDING,
              daily_gis_add.VOLUMEVALUE,
              daily_gis_add.CUSTOMERNAME,
              daily_gis_add.DEVICEID,
              daily_gis_add.CUSTOMERID,
              daily_gis_add.SERVICEPOINTID,
              customer_name,
              customer_key,
              channel_key,   
              dailyorder_key,
              header_key,
              custlog_key,
              hourly_custlog_detail_key,
              row_processing_status,
              SYSDATE
            commit;
          rct_cnt := rct_cnt + 1;
      dbms_output.put_line(' rowadded '|| rct_cnt);
    end loop;
    end;
    sample data:
    32096040001 11048610FGI 5/25/2013 10 AM 10 Tower Hill School 1104861000217112 257808404 32096110001 6/21/2013 10:40:18 AM
    26107010002 11086348FGI 5/25/2013 10 AM 10 Emily Bissell Hospital 1108634800050877 261070100 26107010002 6/21/2013 10:40:18 AM
    32101140001 11086356FGI 5/25/2013 10 AM 10 Delaware River Bay Authority 1108635600413231 321011400 32101140001 6/21/2013 10:40:18 AM
    31875230004 110680FGI 5/25/2013 10 AM 10 Arlon Inc. Gas 11068000021253 318752300 31875230004 6/21/2013 11:04:58 AM
    31875230003 110681FGI 5/25/2013 10 AM 10 Arlon Inc. Gas 11068100022092 318752300 31875230003 6/21/2013 11:04:58 AM
    Regards,
    Vani Sonti

    Hello,
    I've commented out or removed the fields that are not listed.. here is the modified code.. I just added the part where is was prompting errors..
    Yes, I tested just now and it is looping and printing all five record counters..
    CREATE OR REPLACE procedure GSO_SBX_ADMIN.row_add_v3 is
    rct_cnt number := 0;
    begin
    for daily_gis_add in
            SELECT '', METERID, ENDDATE, HOURENDING, VOLUMEVALUE, CUSTOMERNAME, DEVICEID, CUSTOMERID, SERVICEPOINTID
            FROM GSO_IEE_STAGE gis where  trunc(gis.loaded_dt) = trunc(sysdate)
    loop
    insert into gso_iee_process_log
       TIMESTAMP_ID,  PREMISEID,METERID,ENDDATE ,HOURENDING,VOLUMEVALUE ,
       CUSTOMERNAME,DEVICEID,CUSTOMERID,SERVICEPOINTID
        VALUES
              SYSDATE,
              daily_gis_add.METERID,
              daily_gis_add.ENDDATE,
              daily_gis_add.HOURENDING,
              daily_gis_add.VOLUMEVALUE,
              daily_gis_add.CUSTOMERNAME,
              daily_gis_add.DEVICEID,
              daily_gis_add.CUSTOMERID,
              daily_gis_add.SERVICEPOINTID
            commit;
          rct_cnt := rct_cnt + 1;
      dbms_output.put_line(' rowadded '|| rct_cnt);
    end loop;
    end;
    Vani

  • The ORDER BY clause is invalid in views, inline functions, derived tables..

    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: 37000 code: 1033 message: [Microsoft][ODBC SQL Server Driver][SQL Server]The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP or FOR XML is also specified.. [nQSError: 16002] Cannot obtain number of columns for the query result. (HY000)
    I have already tried to follow this thread below, but no change.
    HI
    In this specific report ran above the offending sql uses a CTE.
    I am on 11.1.1.6.1, Windows Server 2008
    Currently in testing phase in migration from 10g.
    I know what the error means, just not how to resolve it or what setting may be causing this.

    In Physical layer, go to specific database(Physical layer's) properties, database features tab -> Un check the EXPRESSION_IN_ORDERBY_SUPPORTED.
    For that failed report, go to Answers-> advance tab-> Look for 'Advanced SQL Clauses'
    Check this box to issue an explicit Select Distinct
    Let me know updates
    If helps Pls mark correct or helpful

  • Error while deriving the currency from table

    i am getting the below error while simulating the payroll for india.
    Error while deriving the currency from table T001P & Error during Initialization of payroll.
    i am SAP HCM Trainee.. practicing at home.

    Pls check the currency in table T500C.
    You can use TCode OE00 for table maintenance T500C.
    Also check whether currency is there in table V_CURC and T510.
    Hope this will help.
    Regards
    Ghouse

  • Error while deriving the currency from table T001P.

    Hi Friends,
    I am trying to run payroll for NZ using schema NZ00 but i am getting an error stating "Error while deriving the currency from table T001P. Error during initialization of Payroll"
    I have checked V_T001P, V_T001 and have deleted the personnel area and subarea and again created it but still i am unable to solve this problem.
    Could you please help me as to where this error can be corrected.
    Thanks,
    Manj

    About the incidence, the problem might be related to the links between
    personnel area, company code and currency set up (table T001P, T500P and
    T001).
    Please check the following points:
    1- Have you assigned the Personnel area to the Company code under SPRO -
    IMG -> Enterprise Structure -> Assignment -> Human Resource Management
    -> Assignment of Personnel Area to Company Code.
    2- SPRO -> Personnel Management -> Personnel Admin -> Basic Settings ->
    Determine Currencies (Public Sector Currency Need to be maintained along
    with the other node).
    3- SPRO- Personnel Management -> Personnel Admin -> Payroll Data ->
    Basic Pay -> Define Hourly Rates for several decimal places. (Please
    maintain all the nodes).
    4- Maintaining the table t500c through transaction code OE00.
    Regards
    Ramana

  • Error while deriving the currencyfrom table T001P for International payrol

    Dear Experts,
    when i run the payroll in simulation mode. im geting an error msg as ' error while deriving the currency from table T001P'
    I have checked all PA assignement with compnay code and country grouping (molga =99), which is correct and also i have checked all bellow tables.
    V_T510F_B
    T500W
    T500C
    Transaction code OE00
    In Trasaction code OE00, system not allowing me to give the currency (LKR - Srilankan Rupees). its giving an error msg as ' maximum of 2entries are allowed for each country in table T500c'(Its not alowing me to save it)
    I dont knw how to over come from this issue.
    I have chnaged the company code and tried but still im getting the same error while running the payroll.
    Any idea from Anyone....?
    Regards
    Dinesh.

    HI Mohan,
    Thz for your reply.i have checked all tables which u have mentioned. but currency (LKR- Srilankan Rupees) has been assigned.
    In V_CURC.. there are no 2 entires. but when i try to assign the currency in T-Code OE00. its giving an error msg " A maximum 2 entries are allowed for each country in Table T500C"
    I have tried to make one more intry in the same table and the same currency then its giving an error msg as " An entry already exist with the same key"
    V_TCURR  is currency exchnage rate...  Is it necesory?
    Thz,
    Dinesh.

  • Error while deriving currency from table T001P

    Hi All,
    Error while deriving currency from table T001P
    I am getting this error while payroll run by using country GRP=99 in SU2 for Non-SAP supported country.
    I assigned country grouping as 99 in V_T500P table while assigning comp code to personnel area.
    The company code is assigned with BD as country key in configuration and currency as BDT.
    Referring previous links for the same error I checked all concerned tables and maintained correctly.
    What will be the probable reason of this error?

    Hi,
    I had the exact same problem a while back. The problem was that in V_T001 I had a different comp code which was either assigned to the same country  that had a blank currency  or assigned to the same currency but was missing the country. It was a different comp code than the one I was running payroll for so it took a long time to find the cause - I'll bet this is what's causing your error. 
    Rgds,
    Kristopher

  • NVL in prompt on date in derived table

    hi
    needed some help in derived table end date is bind variable data base is oracle
    like this how to apply prompt on this  if end Date =0 or no value could accept in prompt
    ch.endDate <= nvl(:end Date,ch.endDate)
    i've tried in report level but optional prompt is not available could you please help me out of this

    Hi
    derived table will not pass null values using @prompt
    use this formula
    To_date(CASE WHEN @prompt(':bind variabe','D',,mono,free,persistent,{'01/01/2099'}) = '01/01/2099' then to_char(ch.end_date) else @prompt(':bind variabe','D',,mono,free,persistent,{'01/01/2099'}) END)
    for only in this situation it will work ch.end_date=NVL(:end date,ch.end_date)
    thanks
    Ravi Kumar

Maybe you are looking for

  • Computer Science Student - MPB 13" i5 or i7?

    I will be starting the first year of a 4 year Computer Science course in September and wanted to know which MacBook Pro 13" model would be best for me, the i5 or the i7? Considering my CS course is 4 years, would the i7 processer model with the 8GB R

  • Info about Element entry values for an element

    Hi Im trying to get info on something. Im supposed to get entry values for a certain Sc med element. Now i know that the entry values reside in pay_element_entry_values_f. The values i need are for the input EE Contr Now when i query the pay_element_

  • ADobe Bridge show Quicktime icon

    When viewing clips stored on my external drive in the view panel all I see is the Quicktime icon and no obvious way to play them. 1. How do I change the Quicktime icon to a thumbnail view? 2. How do I view them? The clip is HDV footage. Thanks Kent

  • 10.4.11, WPA,  AND Verizon Router

    Should I be able to connect wirelessly with WPA encription to a Verizon Wireless N Actiontec Router with OS 10.4.11? Have an old G3 and G4 that's worked forever and with the new router can't seem to get on line, though see the network name.  No probl

  • Recording Failed Technical Fault 10 (28)

    I've read similar posts but there doesnt seem to be a resolution. My 2TB is two months out of warranty, and now all of a sudden 8 out of 10 recordings are failing with Technical Fault 10(28). On demand works fine. I've upgraded the software and done