Using an apostrophe in a substitution variable

Hello, I have a simple sql plus script which sets a substitution variable and then uses this in an INSERT statement to insert the value of the variable into a database table.
For example:
DEFINE TEXT = 'For full details see PQPs website'
insert into CONSTS(PARAMETER, VALUE, TYPE) values ('admin.marketing.website', '&TEXT1', 'ADMIN');
That's all fine and dandy.
However, I want to put a possessive apostrophe in PQPs, i.e. PQP's but can't find a way that lets me do it and I've tried everything I can think of.
Using the escape character \ doesn't work
i.e.
set escape \
DEFINE TEXT = 'For full details see PQP\'s website'
I just get the string 'For full details see PQP\'
Also using two apostrophes doesn't work either
i.e.
DEFINE TEXT = 'For full details see PQP''s website'
I get the error "ORA-01756: quoted string not properly terminated"
when I try and insert into the database.
I've tried surrounding the value in double quotes etc. and everything I can think of but for the life of me I can't get a string containing an apostrophe into the database using a substitution variable. It must be possible though, isn't it?
Thanks
Andy Birchall

Could this be a solution ?
TEST@db102 > var text varchar2(50);
TEST@db102 > exec :text := 'For full details see PQP'||chr(39)||'s website';
PL/SQL procedure successfully completed.
TEST@db102 > insert into CONSTS(PARAMETER, VALUE, TYPE) values ('admin.marketing.website', :text, 'ADMIN');
1 row created.
TEST@db102 > select * from consts;
PARAMETER                      VALUE                                              TYPE
admin.marketing.website        For full details see PQP's website                 ADMIN
TEST@db102 >

Similar Messages

  • Using substitution variable with multiple values in Maxl Command

    Hi All,
    Is there any option to use multiple values in 1 substitution variable and use them in a Maxl command.
    alter database $app_name.$db_name clear data in region '{CrossJoin(CrossJoin(CrossJoin({StrTOMbr(&Months)},{XXX, YYY}),{StrTOMbr(&CURYR)}), {ZZZ})}'physical;
    In the above case
    Maxl is not working if I have multiple months in &Months Substitution variable.
    Let me know if there is an alternate option to implement this.
    Thanks
    Sathish

    What is the value of &Months?
    If you put that exact value into the code, does it work?
    Regards,
    Cameron Lackpour

  • Using substitution variables in a BS rule

    Hi there
    Im trying to use a substitution variable when selecting the current month. Se example below.
    I loading af YTD number on a member "YTD" and I would like to break the numbers down, so that I also can see the values as pr. month.
    I would like to use the substitution varible "currmth" to do this, so that it only calculates the current month. I know I could use a UDA for this, but shouldn't this work?
    ELSEIF (@ISMBR (&CurrMth) == "Aug")
    ("YTD" - ("jan" + "feb" + "mar" + "apr" + "may" + "jun" + "jul"));
    ELSEIF (@ISMBR (&CurrMth) == "Sep")
    ("YTD" - ("jan" + "feb" + "mar" + "apr" + "may" + "jun" + "jul" + "aug"));
    ELSEIF (@ISMBR ("Oct"))
    If you look at "sep" that is how I would like it to function, but I cant. It simple doesent calculate anything for the member. But if I use "Oct" and not the substitution variable "currmth" I get my member calculated.
    Is there something here im missing, or doesn't it work like this? Any help would be appreciated!
    Jacob

    Jacob,
    You don't need the @IsMbr when comparing the value of the substitution variable.
    ELSEIF (&CurrMth == "Aug")
    ("YTD" - ("jan" + "feb" + "mar" + "apr" + "may" + "jun" + "jul"));
    ELSEIF (&CurrMth == "Sep")
    ("YTD" - ("jan" + "feb" + "mar" + "apr" + "may" + "jun" + "jul" + "aug"));
    ELSEIF (@ISMBR ("Oct"))
    Robert
    Edited by: RobertR3 on Dec 4, 2009 9:45 AM

  • Can we use Substitution variables in MAXL?

    Hi,
    Can we use substitution variables in MAXL script?
    I have to run this MAXL command for clearing a slice of ASO cube on V11.1.1.3.
    alter database Apname.DBname clear data in region 'CrossJoin({[2009]},{[Dec]})';
    I am planning to use Current_year & Current_month variables instead of hardcoding 2009 & Dec as I have to use this everymonth to clear the current months data.
    If it is allowed, what is the syntax?
    Is there any alternative apart from substitution variables?
    Appreciate your thoughts.
    Thanks,
    -Ethan.

    You would just use ampersand and the variable name instead of the hard coding e.g. &yearVar &periodVar.
    Not tried it on aso clears but in theory it should work as ...'CrossJoin({&yearVar},{&periodVar})';
    just change yearVar and periodVar for your substitution variable names.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Use varialbe as a value in substitution variable

    Hi there,I incrementaly update my cube day by day.And I set a user variable in autoexec.bat to get the current date,eg '2003-06-23'.Could I use such variable as a variable's value in substition variable ?My platform is 6.5 on w2k.Regards,luau

    You can use that in a MAXL script to set the substitution variable.the MAXL script would be something like:Alter database $4 drop variable $5;alter database $4 add variable $5 $7 ;where: $4 is the app.cub $5 is the substitution variable name $7 is the value of the subs. variableRich Sullivan - Beacon Analytics

  • How to use a substitution variable in a load rule?

    I need to use a substitution variable in a load rule in a column, as I will receive a parameter to fix the Month and Year values within the data loading, could somebody tell me if this is possible. I put an expresion "&Yearproc" in the column value but it is not working.

    If you're a member of ODTUG (or even if not, you can sign up for an associate membership for free) you can download Glenn's presentation from 2009 Kaliedoscope "Little Used Features of Essbase (Like Data Mining and Triggers)" -- there is a section in that presentation on substitution variables -- he does a really good job in showing how this works.
    Go to: www.odtug.com, then Tech Resources, then Essbase/Hyperion, and search for Schwartzberg. Currently it's the ninth presentation on the list -- I think this changes based on popularity of downloads.
    Regards,
    Cameron Lackpour

  • Conditional suppression using substitution variable in Hyperion financial r

    Hi all,
    Is there a way that I can suppress a column using substitution variable in hyperion financial reporting?
    For eg, i want to suppress the column if the value of the substitution variable curr_mnth = jun.
    Is there a way to do this? In conditional suprression dialog box, I dont find this option.
    Please suggest.
    Your response is appreciated.
    Thanks,
    Sirisha.

    Hi Sirisha
    In my earlier reply I think I may have mislead you as I thought that you could set the member name equal to that in a row/column and I've managed to get into a HFR studio session this morning and realised that the conditional suppression only allows you to suppress where member name = 'XXX' (specific text) so that doesn;t meet your requirement.
    Different people will have different ways of achieving what you want and everyones requirements are different. If it helps my preferred way of conditionally suppressing periodic data (for Planning/Essbase) is to add a dynamic calc account member called 'TP-Index' into the database, set up a formula so that each period returns a numeric value from 1 to 12 to match the fiscal/calendar year as required.
    Then in reporting bring the account and period dimensions into rows/columns so that you are able to retrieve data for the TP-Index account and the period as defined in your substitution variable. You can then choose how the suppression works based on a numeric value, commonly you may want to suppress if greater than, e.g. you have a multi-period report where your actual data is to June so you want to suppress everything from July onwards.
    I'm sure that a similar thing could be achieved in HFM as well if that is your underlying system instead of Essbase.
    Does that help?
    Stuart

  • Using substitution variable in sql -- Issue

    Hello All
    I am trying to do a sql operation from command prompt of my system and that sql requires substitution variable which i am passing it but when i pass the variable ( there are two) the first one assign as " \c" and second gets both what i am passing.
    I am not sure what exactly happening here, i have done this on AIX but here its not working any ideas?
    System : uname -a
    Linux ## 2.6.18-128.1.1.el5 #1 SMP Mon Jan 26 13:58:24 EST 2009 x86_64 x86_64 x86_64 GNU/Linux

    AIX and Linux are not the same. An output of "\c" may indicate a compatibility issue of your shell script with your current command line interpreter (shell). A \c can be used to suppress a newline with the echo command. Bash understands both formats echo -n and echo \c, but other shells like Ksh don't. Try to run your script under a Bash, which is the default under Linux. If the problem persists you will need to post your script for any further analysis.

  • Problems using substitution variable in Web Analysis

    Dear all,
    I have a Web Analysis report that I need to show a raking table with the current month.
    For that I create a variable in Essbase that is updated with that date (E.g.: varCurrentMonth).
    After that I use it as my substitution variable to filter my date dimension in a report data source (E.g.: Scr5, row: product, column: date dimension & measure):
    2008 (current month)
    Product $ qty.
    AAA 100 10
    BBB 90 7
    CCC 80 5
    The problem is that in our cube we need to use an alias in every dimension not to have duplicate members (E.g.: DT.Date, MS.Measure, PD.Product, etc). And when we use it we need to set up the variable in Essbase using that alias (E.g.: DT.Feb/05/08). And if we use that variable as a substitution variable in the report data source the label displayed is the DT.2008 and not 2008 as expected.
    Does anybody have an idea how to solve that?
    Many thanks,
    Thiago Gabriel

    You usually get this error message if you are trying to assign a value from a sub var to a member that does not exist.
    e.g. trying to put FY08 which is a year member against a period dimension
    or trying to use a sub var of FY09 which does not yet exist in the essbase, so say you added a new year in planning FY09 and used the sub var in the form but have not refreshed the database then it would fail because the year would not have been pushed down to essbase yet.
    or the value of the subvar does not match a member name exactly
    or using a sub var name that does not exist in essbase, e.g. using &nextYear but the sub var has not been created in essbase.
    You can definitely use subsitution variables in columns in the version you are using and prior version.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Financial Reporting (FR) using Substitution Variables with Quotes

    HI all,
    I've created a substitution variable, &CurWk, for a Period Dimension member. The member name, Dec Wk2, has an embedded space, so I enclose the member name in quotes when assigning it to the substitution variable in EAS. However, when I try to use that substitution variable in Financial Reporting, it does not recognize the Substitution variable. I've closed down and re-opened the FR Studio. If I remove the quotes around the member name when assigning it to the Substitution Variable, then FR will recognize the substitution variable. However, I get an error in the calc scripts if I try to reference the substitution variable if this member name is not enclosed in quotes. In my mind, this seems to be a bug in FR since quotes can be optional when referencing any member name. Has anyone else had this problem? Is there a work-around? I'm using EPM 11.1.1. Thanks for your help!
    Vince Kelly

    Hi Vince,
    For the Calc scripts add & to the front of the sub var and surround the sub var with [ ], for example:
    where sub vars are ReptQTR, ReptYR, ReptScenario:
    CASE
    When (Is(QTR.Currentmember,[&REPTQTR]) and (IS(FY.Currentmember,[&REPTYR]))) then
         CASE
         When ((ISUDA(L000.CurrentMember,"NC"))) then
              CASE
              WHEN (ISUDA(L000.CurrentMember,"Expense")) THEN
              (([&REPTPYR],[ACT]) - [&REPTSCENARIO])
              ELSE
              ([&REPTSCENARIO] - ([&REPTPYR],[ACT]))
              END
         END
    END
    Edited to fix stupid html codes: Iain Curtain on Feb 1, 2010 5:44 PM

  • Use of Essbase substitution variables in filename of a MaxL report script

    Hey guys.
    Is there a way that I can embed the value of one or more Essbase substitution variables in the filename of a report script in a MaxL command?
    I'm running a report script that uses sub. vars for entities and accounts and based on which of those members are set in the variables I want the filenames to include those member names. I'm looking for a way to include the &varName in the filename using the export database command.
    THANKS!

    Not really.
    If you want to do a lot of string mangling in a script outside of the report script, you can use DISPLAY VARIABLE:
    MAXL> display variable CurMo;
    application         database            variable            value
    +-------------------+-------------------+-------------------+-------------------
                                             CurMo               MayRegards,
    Robb Salzmann

  • Using a Substitution Variable in a text box when the member isn't used in a grid

    Hi,
    I'm trying to create a footer in my report to display a substitution variable for the "Period" dimension. The Period dimension is not used in any of the rows or columns in my grid in my report in FR studio. It is left as a POV. I am trying to reference the substitution variable for CurrentMonth, which is independant of what the user selects for the Peiod POV.
    For example, the user runs the report and selects YearTotal for the Period dimension. I want to bring back the substitution variable of &CurrentMonth for Period even though it is not selected in the Grid for the report. Is there a way to do that?
    The workaround I am using is adding a second Grid and selecting the Substitution variable in the row and referencing the function from the second grid, which is hidden. This is bulky, and I'm hoping for a cleaner solution. The function I'm using from Grid 2 is below:
    <<MemberAlias("Grid2", 1, "Period")>>
    If I referenced Grid1 for Period, the function would display the user's POV selection, which is not what I want.
    Any help would be much appreciated. Thanks so much!!
    Tiffany

    Tiffany,
    I do the following which I think may fit you need:
    Add the "Period" dimension to the Columns section.
    Make the "Period" dimension the top most member of your column selections.
    Hide that row.
    Set the left most column to "Current Poinf of View for Period"
    Select "Same As Col A" (for example) for the remaining report columns.
    Add a column to the far right and use the &CurrentMonth substitution variable for the "Period" dimension. (The other dimensions in that column should be set, if possible, to retrieve as little data as possible.)
    Hide the new column.
    Change the function in the footer to <<MemberAlias(Grid1, A, "Period")>>
    This should allow your user to select their desired period without impacting the hidden column value of &CurrentMonth which will be displayed in your footer.
    Bill

  • Using a business rule to set the substitution variables

    Hi All,
    I am having issues with setting the value of Substitution variable from a Business rule.
    Any help would be appreciated.
    Thanks,
    Shakil

    Thanks for your response, John.
    I am trying to set the Substitution variable through a data form on which the Business rule is attached.
    The admin guide for Planning states that "You can set substitution variables on the Essbase server,
    application, or database level. The same substitution variable can exist on multiple levels;
    Planning uses the first one it finds as it searches in this order: 1) database 2) application 3)
    server." So I believe that it should be possible.
    Regards,
    Shakil

  • Substitution variable using in rules file

    Hi,
    I have a requirement to load the data only for the current month. But, my source file is having data for all the months till current month.
    ex: I have to load data for MAY. But, source file is having data from JAN to MAY
    Its a monthly process and it should load the data only for the current month using substitution variable.
    Means next month I will be having JAN to JUN data. But, I should load only JUN data.
    Could any one help in building rules file for this requirement.
    Thanks
    Sri

    Is the data coming from SQL or a flat file?  And is JAN through MAY represented in multiple columns or multiple rows?
    As Evgeniy says if it's a SQL source, you can use a subvar in the SQL statement.  If it's a flat file (and your periods appear as multiple rows) you can use a subvar in a SELECT/REJECT criteria.
    Honestly though, if a feeding system is producing a flat file for you, I would try and arrange to have the flat file contain only the data that is actually required.  Parsing a file that is up to 12 times larger than necessary is inefficient.

  • Report script - using substitution variable with multiple values

    Hi All,
    Substitution variable with multiple values is not working correctly with Report scripts. Can you please let me know what is the syntax to assign multiple values to a sub variable using maxl:
    alter database samp.samp set variable 'ExtractQuarter' 'Q1,Q2,Q3,Q4';
    alter database Samp.Samp set variable 'ExtractQuarter' 'Q1:Q4';
    I tried both of the above but they are errored out with the below error:
    Error: 1001005 - Unknown Member [Q1:Q4] in Report.
    my requirement is different for both Actual and forecast data extract so i would like to make use of this variable to extract whole year data for Forecast and current quarter data for Actual with out duplicating the report scripts for both processes.
    Thanks,
    PRaveen

    Hi,
    Please refer following thread,
    range of months in report script?
    Hope it helps.
    Regards

Maybe you are looking for

  • Has anyone seen this before?   -sh-2.05b#

    When I boot up my PB the screen goes blank and I get this message: -sh-2.05b# What's going on with my PB?

  • Difference balance between FK10N and FBL1N

    Hi All, In FK10N for a vendor for year 2012 there is a cumulative balance carried forward from previous year is 3711.80 When checked in FBL1N there is no items for 'Open items' and for 'all items' the balance is ZERO. Will balance of FK10N has to mat

  • "This category does not contain any topics"

    Not sure why this is happening but when I try to view any of the RoboInfo forums I always get "This category does not contain any topics" even though the main forums home page shows that there are posts in each forum? Sorry...I guess this is a user s

  • Set markup html on

    Hi, Some times I get following lines in output while generating output in 9.2 thru sqlplus <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <meta name="generator" content="SQL*Plus 9.2.0"> <style type='text/css'> b

  • Newly created follow-up document is inactive

    Hi Forum, I have just  created  a follow-up document for my service order and created a target transaction as another serv order document  through copy control. The target Service order is showing in the create follow up documents in the main menu, b