Data model: single quote in default parameter value

Hello,
when I assign a default value to a parameter in my Data model, which includes a single quote (i.e. "It's a default value"), then the single quote is escaped with a backslash (i.e. "It\'s a default value") when I open the report associated with the data model. How can I get rid of the escape character when opening a report?
Regards,
Jure

Hi Yogini,
Thanks for your reply.
When the customer name is selected, discoverer reports automatically enclose the customer names in single quotes. like 'ABC LTD', 'ABC's INC',
I know how to change this single quote format. Also we don't want user to change the parameter selection criteria once selected.
Also related to double quotes isn't it doubles are treated as column names in the SQL query and can not be used for any other purpose.
Apologies, I haven't tried this but I think it will not work. Have you tried this with discoverer viewer.
As mentioned intrusting things is when a customer name with single quote is selected in discoverer Plus it automatically formats the filter criteria to look like ['ABC LTD', 'ABC''s INC'] but this thing doesn't happen in viewer.
I think this is a bug in discoverer viewer and think there must be some patch available to correct this problem.
Sorry, don't have a solution yet but will certainly update the thread once I get the solution.
Also please keep looking for a solution and let me know as well.
Thanks a lot in advance.
Best Regards,
Manish

Similar Messages

  • Dynamic SQL and Data with Single Quotes in it.

    Hi There,
    I have a problem in that I am using dynamic SQL and it happens that one of the columns does contain single quotes (') in it as part of the data. This causes the resultant dynamic SQL to get confused as the single quote that is part of the data is taken to mean end of sting, when in fact its part of the data. This leaves out a dangling single quote that was meant to enclose the string. Here is my dynamic SQL and the result of the parsed SQL that I have captured:
    ****Dynamic SQL*****
    l_sql:='select NOTE_TEMPLATE_ID '||
    'FROM TMP_NOTE_TEMPLATE_VALUES '||
    'where TRIM(LEGACY_NOTE_CODE)='''||trim(fp_note_code)||''' '||
    'and TRIM(DISPLAY_VALUE)='''||trim(fp_note_text)||''' ';
    execute immediate l_sql INTO l_note_template_id;
    Because the column DISPLAY_VALUE contains data with single quotes, the resultant SQL is:
    ******PARSED SQL************
    select NOTE_TEMPLATE_ID
    FROM TMP_NOTE_TEMPLATE_VALUES
    where TRIM(LEGACY_NOTE_CODE)='INQ' and TRIM(DISPLAY_VALUE)='Cont'd'
    And the problem lies with the single quote between teh characters t and d in the data field for DISPLAY_ITEM. How can I handle this?
    Many thanks,

    I have been reliably informed that if one doesn't enclose char/varchar2 data items in quotes, the right indices may not be usedI am into oracle for past 4 years and for the first time i am hearing this.
    Your reliable source is just wrong. Bind variables are variables that store your value and which are used in SQL. They are the proper way to use values in your SQL. By default all variables in PL/SQL is bind variable.
    When you can do some thing in just straight SQL just do it. Dynamic SQL does not make any sense to me here.
    Thanks,
    Karthick.

  • How to use different default parameter value for different report subscriptions

    In ssrs is it possible to define different default parameter values for different subscriptions? In the following example I have a report which has two subscriptions with different start date and end date values:
    Report name – Testsubscription.rdl
    Subscription-1
    Input parameter (default values):
    start_date = first day of current Month
    end_date = till date
    Subscription-2
    Input parameter (default values):
    start_date = first day of current Quarter
    end_date = till date
    I know an alternative way of doing this would be to copy the rdl file with a different name but I am curious whether this can be done within a single report definition file. I am using SQL Server 2008 R2 Standard Edition.
    Thanks!
    spp

    Hi sppdba,
    As per my understanding, there is a report with two parameter: start_date and end_date, you want to configure subscription for the report, and set different default values for start date and end date. And you want to know if it is possible to achieve you
    goal by using a single report definition file.
    Since you are using SQL Server 2008 R2 Standard Edition, we need to achieve your goal by configuring two subscriptions for the report. For detail information, please refer to the following steps:
      1. In design surface, right click start_date and open Parameter Properties dialog box.
      2. In General pane, type Name and Prompt, set Data Type to Date/Time.
      3. Click Available Values in left pane, select Specify Values.
      4. Click Add button, in Label text box, type “First day of Current Month”, click (fx) button in Value section, then type the expression like below:
    =DateSerial(Year(Now()), Month(Now()), 1)
      5. Click Add button, in Label text box, type “First day of Current Quarter”, click (fx) button in Value section, then type the expression like below, then click OK.
    =DateSerial(Year(Now()), (3*DatePart("q",Now()))-2, 1)
      6. Right click end_date and open Parameter Properties dialog box.
      7. In Available Values pane, select Specify Values.
      8. Click Add button, in Label text box, type “Today”, click (fx) button in Value section, then type the expression =Today(), then click OK.
    Now that the parameters are created, we need to configure subscription for the report. For detail information, please follow these steps:
      1. Open Report Manager, and locate the report for which you want to create a new subscription.
      2. Hover over the report, and click the drop-down arrow.
      3. In the drop-down menu, click Manage. This opens the General properties page for the report.
      4. Select the Subscriptions tab, and then click New Subscription.
      5. Select the delivery extension and data source for the subscription.
      6. Select a method of delivery, then choose report delivery options.
      7. Specify conditions that cause the subscription to process and delivery to occur.
      8. Set start_date to First day of Current Month, end_date to Today, then click OK.
      9. Create a new subscription as step4 to 7, set start_date to First day of Current Quarter, end_date to Today, then click OK.
    The following screenshots are for your reference:
    For detail information about Creating Standard Subscriptions, please refer to the following document:
    http://msdn.microsoft.com/en-us/data/ms156307(v=sql.105)
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    If you have any feedback on our support, please click
    here.

  • Crystal Reports 9 and SQL Server 2005 default parameter values

    We're using Crystal Reports 9 and upgraded from SQL Server 2000 to SQL Server 2005.
    I'm noticing a very weird problem which I wonder if anyone else has experienced (and hopefully found a resolution for). It appears that in using Crystal with SQL Server 2005 stored procedures, if we have default parameter values in the stored procedures, the default parameter values get completely ignored if you pass in a NULL value from Crystal!
    For example, if you have a stored procedure that begins like this:
    ALTER          Procedure [dbo].[StoredProcedure]
    @Param1 VarChar(200) = '',
    @Param2 VarChar(200) = ''
    AS ...
    both @Param1 and @Param2 have a default value of an empty string, and therefore should become empty strings if nothing (NULL values) gets passed in for them.
    But, like I said, what I'm finding is that with Crystal calling the stored procedure with NULL @Param1 and @Param2 values, they never become empty strings, but rather remain as NULLs.
    This was never a problem with SQL 2000.
    Very perplexing. Anyone else every experience this?
    Thank you.

    Please ignore my earlier post -- answered my own question.
    NULL parameter values do not get replaced by default values in SQL -- that is normal behavior in both SQL 2000 and SQL 2005. Just goes to show, that no many how many years programming experience you have, you can still get tripped up sometimes : (

  • Dynamic default parameter value

    Hi,
    I'm running Oracle BI Discoverer Plus 10g (10.1.2.45.46c)
    Is it possible to make the default parameter value dynamic ?
    In my case I want the default parametervalue to be set to the week before actual week.
    Eg if I'm running the report during this week it would be set default to '2005W43',
    running the report during next week it would be set default to '2005W44' and so on...
    Have tried to assign the default value with "TO_CHAR(SYSDATE-7,'RRRR')||'W'||TO_CHAR(SYSDATE-7,'IW')"
    Note the enduser must have the possibility to change from the default week to some other week.
    Any ideas ?
    /Sam
    Message was edited by:
    [email protected]

    Post Author: synapsevampire
    CA Forum: General
    A common solution is to use a Union All in a query to get the ...All and the dynamic values using a Command Object.
    select '...All' from tableUNION ALLselect field from table
    -k

  • Can I use calculated value as default parameter value?

    Discoverer version:
    Oracle BI Discoverer 11g (9.0.4.00.00)
    Oracle Business Intelligence Discoverer Plus 11g (11.1.1.3.0)
    Discoverer Model - 11.1.1.3.0
    Discoverer Server - 11.1.1.3.0
    End User Layer - 5.1.1.0.0.0
    End User Layer Library - 11.1.1.3.0
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    Java Virtual Machine: Sun Microsystems Inc. 1.6.0_29
    JVM Memory Available: 9286KB out of 43728KB
    Operating System: x86 Windows 7 6.1
    Can I have a pre-calculated value in the value selection box E.g. a date value that is calculated from a function that getting current finanical year from a item.
    That is, when 'Edition Parameter value' window pop up, a calculated value exists instead of a blank field.
    Edited by: 901005 on Dec 8, 2011 6:12 PM

    Hello
    Your friend is wrong - this functionality has never existed. Perhaps your friend is getting confused over the ability to define a fixed default value which has always been there.
    Sorry about this.
    Michael

  • Date without single quotes in SQL Where clause turns to 00000000. Why?

    The below program works in 4.6c but does not in ECC 6.0, the issue is the date actually turns to 00000000, debug shows the internal table as having the correct value that was inserted but st05 trace shows that the variable is holding the value 00000000, this works fine when the date is put inside single quotes but the actual program where I have this issue does not warrant adding single quotes. Has someone come across this situation. Any help is appreciated!
    data v_vbeln like vbak-vbeln.
    data: begin of where_tab occurs 0,
          s_date(20) type c,
          end of where_tab.
    where_tab-s_date = 'audat = 19971106'.
    append where_tab.
    select vbeln into v_vbeln from vbak where (where_tab).
      write:/ v_vbeln.
    endselect.

    HI,
    data v_vbeln like vbak-vbeln.
    ******data: begin of where_tab occurs 0,
    ******s_date(20) type c,
    ******end of where_tab.
    ******where_tab-s_date = 'audat = 19971106'.
    ******append where_tab.
    ***** The above statements are not needed for the select query.
    ******select vbeln into v_vbeln from vbak where (where_tab).
    Your select query can be re-written as
    select vbeln into v_vbeln from vbak where audat eq '19971106'.
    write:/ v_vbeln.
    endselect.
    and if your requirement is to check for multiple dates then,
    append them to a select-options and rewrite the select query as
    select vbeln into v_vbeln from vbak where audat IN S_DATE. " S_DATE is your select-options
    Regards
    Sharath

  • How to deal with single quote (') in a field value?

    I can successfully insert value with single quoet using
    Prepared statement with placeholder(?) construct .
    I can also successfuly use value with single quote(') in
    WHERE clause.
    My question is, is there a way to use string with single
    quote if a Statement like:
    String slqString ="INSERT INTO customers (name, address) VALUES ( 'O'Reilly Bob', 'St Mary's Street') ";
    Statement sqlStmt = con.createStatement();
    sqlStmt.executeUpdate(sqlString);
    The last statement will thow an SQLException because due to single quotes
    Any ideas?

    I think the question was regarding the ' in O'Reily. Use ' twice when using the Statement interface, i.e.
    ("O''Reilly Bob", "St Mary''s Street")
    So that's two single quotes, not a double quote, to successfully insert a single quote, if you know what I mean....
    But like you said PreparedStatement does things like this for you.

  • CR-XI How to prefil Default Parameter value in code

    I am setting parameter default value(s) in VB6 code.  When the report is launched the default parameter is in the list but not selected.  The user has to manually select the value instead of just accepting the default value and pressing enter key to launch the report.  I would like parameters to prefil with default values like they did in Crystal version 7 when using the OCX.
    I am using CR XI and VB6.  I am passing a default parameter by using .
    <report object>.ParameterFields(1).AddDefaultValue
    If I use <report object>.ParameterFields(1).AddCurrentValue the parameter then the report viewer knows the parameter value and the form does not display the value incase the user desires to change it.
    My Question is how can I display the parameter and prefill with the default value.  When I use "AddDefaultValue" like above the parameter will be in the dropdown but will be blank when the form opens.  This requires the user to use the mouse and click the dropdown to display the default value.  I would prefer the default show in the dropdown so the user just has to press the enter key to launch the report (if the user wants to accept all default values).
    If this is not possible with the current viewer class then maybe the development team can include in future updates. 
    Thanking you all in advance.

    Hi Brent,
    The document you linked is for the Enterprise Product.  As Jonathan stated, the RDC for XIR2 is supported for use in VB6, you do not have to have .NET.  This can be found in the Crystal Reports supported Platform document found here:
    [http://resources.businessobjects.com/support/communitycs/TechnicalPapers/cr_xi_r2_supported_platforms_windows_sp3.pdf|http://resources.businessobjects.com/support/communitycs/TechnicalPapers/cr_xi_r2_supported_platforms_windows_sp3.pdf]
    Crystal Report XIR2 is the last version that has the RDC.

  • How to handle XML string with Single Quotes as a parameter to SP dynamically?

    Hi,
    I would like to know if there is a way to handle the Single Quotes in XML value when it is passed to Stored Procedure?
    I should be able to handle it without adding another Single Quote to it.
    Thanks,
    Chandra Shekar

    Hi Chandra,
    Your requirement is not precise. Based on my understanding and guessing, are you metioning something like the below sample?
    /*If the xml is generated you have no need to escape the singe quote(')*/
    DECLARE @xmlTbl TABLE (ID INT,name VARCHAR(99));
    INSERT INTO @xmlTbl VALUES(1,'Eric''s')
    INSERT INTO @xmlTbl VALUES(2,'Zhang''s')
    DECLARE @xmlDoc1 XML
    SELECT @xmlDoc1
    FROM @xmlTbl FOR XML PATH('PERSON'),ROOT('PERSONS')
    EXEC yourProcedure @xmlDoc1
    /*If your copy and paste the xml, you have to escape the single quote(') with 2s('')*/
    DECLARE @xmlDoc2 XML
    SET @xmlDoc2 = '<PERSONS>
    <PERSON>
    <ID>1</ID>
    <name>Eric''s</name>
    </PERSON>
    <PERSON>
    <ID>2</ID>
    <name>Zhang''s</name>
    </PERSON>
    </PERSONS>'
    EXEC yourProcedure @xmlDoc2
    If that is not regarding your requirement, please elaborate with more details.
    Eric Zhang
    TechNet Community Support

  • How to update row when data contains single quote  ?

    Hi,
    Please see this query:
    update query_tab set  title='It's common knowledg' where
    id='1121';I have this update query coming from .NET, but abviously this is error since single quote in the text (title column) given by user gives wrong meaning to sql parser. So, how to solve this problem ?
    Edited by: bootstrap on Dec 25, 2010 9:53 AM

    Hi,
    To include a single-quote in a string literal, use two of them in a row:
    update      query_tab
    set       title     = 'It''s common knowledge'
    where      id     = '1121';The method above works in any version of Oracle.
    Starting in Oracle 10, you can also use Q-notation, like this:
    update      query_tab
    set       title     = Q'[It's common knowledge]'
    where      id     = '1121';For details, look up "Text Literals" in the SQL Language manual:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/sql_elements003.htm#sthref337

  • Saved default Parameter values not appearing in Run Time version of report

    I've created a report in Crystal 2008 and set up a number of parameters. I supplied each of them with a default value. I check it out in Crystal Reports and a nice looking window opens up that shows all my parameters with the default values. I save the report and open it within our application and upon pressing print, a plain looking box appears that lists my parameters but none of the saved values are included. Is this a problem with my version of Crystal Reports (ver. 12.2.0.290) that I can get an update for to fix; Or, is this a problem with the crviewer.dll that we are running in our application (ver 11.0.0.1282, dated March 8, 2005)?
    I'm worried about updating to the latest Crystal 2008 crviewer.dll because I've read where it is only for reports with Saved Data and that won't work for us. We need the ability to refresh the data on the reports.

    Hi Mike,
    It likely is the viewer causing the problem. 2008 now has cascading parameters and the activex viewer does not support them.
    All I can suggest is you try CR XI R2 which you can upgrade for free, you have to contact CIC to get a keycode to deploy your app, and test again.
    R2 is out of support now so no fixes available...
    http://downloads.businessobjects.com/akdlm/crystalreports/crxir2_sp4_full_bld_0-20008684.exe
    http://downloads.businessobjects.com/akdlm/crystalreports/CRYSTALREPORTS06_0-20008684.EXE
    Thanks
    Don

  • Lexical parameter and single quotes

    I am using perl to build the lexical parameter that is being passed to the report builder. The perl builds an "in" statement for the where clause. In the data the users select some of the values may contain a single quote. I have used a perl script to replace the internal single quote with two single quotes.
    Example:
    selected values: eeee'ss, ffff'22ww
    final string passed: "in ('eeee''ss', 'ffff''22ww')"
    I am getting any error message indicating quoted string not properly terminated. Any ideas?
    Thanks

    I have actually found that if the single quote is embedded in the string I can get it to work, however, if the single quote is at the end of the string I am still getting the error message.
    To get it to work with the single quote in the string I actually had to create the string with 3 single quotes in place of the embedded one single quote.
    Thanks for the suggestion. I will check it out.

  • SSAS SSRS Report Action on Cell Value w/ Embedded Single Quote Not Executing

    I have configured an SSAS 2008 R2 cube SSRS ReportAction. I'm having problems when the member value for a cell has an embedded single quote, e.g. abc's. The action displays on the context menu appropriately, but when I click on the action, nothing happens.
    For member values that do not have the single quote, the action works as designed. I've added a calculated ember to escape the embedded single quote by adding another single quote, e.g. abc''s, with no luck. Is there a resolution or workaround for this?

    Hi Mdccuber,
    According to your description, you create a reporting action in you cube, and it works fine except the members that have embedded single quote, right? In your scenario, it seems that you pass this value to the report as the parameter.
    In SQL Server Analysis Services (SSAS), when pass values to a report, multi-select parameters have to be placed into IN statement and SQL Server Reporting Services (SSRS) will do single-quote wrapping for string values automatically. In this case, the original
    value that have embedded single quote will be damaged. So this action not work. You can submit a feedback at
    http://connect.microsoft.com/SQLServer/Feedback and hope it is resolved in the next release of service pack or product.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Default Parameter Dynamic Values in BIP

    Hi All,
    I have Period Name which is Varchar data Type and has values like JAN-2014, so I want to set the Default Parameter value to previous month dynamically. I tired setting with {$To_Char(Add_Months((Sysdate),-1),'MON-YYYY')$) but it didn't work as I thinking for using this Data Type should be only DATE format.
    Any Help or Thoughts
    Thanks
    SYK

    Hello,
    We are trying to create a BI Publisher Report in Siebel by passing the values dynamically from Siebel field to report. Is it possible to
    1. Pass dynamical values to parameter values of type picklist from Siebel, while executing BI Publisher Reports?
    As far as I am aware, it is not possible to have picklist values to be passed on from Siebel while executng BI Publisher reports.
    2. Select more than one value in the parameter values while executing the report?
    Parameters can have one of the many values defined while generating the report.
    3. How to attach Calendar as a parameter to the report?
    No, one cannot have calender as a parameter to the report. You can define the parameter as a sting and users can enter a date value in that string.
    Thanks
    Swarna

Maybe you are looking for