Substitution variable stored in a column?

I want to store some links in a database column and then output these. The links need to have substitution variables though (eg: f?p=&APP_ID.:&SESSION.). These must be stored in the column due to the way the data is automatically generated from a different process. Is it possible to use substitution variables in a table column? I tried, outputting the data with htp.p in a pl/sql region however the data output was the text "&SESSION." rather than the actual value for the session.

Forgot to mention - this is CLOB column containing quite a lot of text (with newline characters etc). I tried using replace(column,'&SESSION.',v('SESSION')) however this doesn't appear to work. It works if I replace column with some test text ('f?p=123:456:&SESSION.::: for instance) so I think it's something to do with the CLOB data type.
[edit]
hmm... If I try to replace the string "&SESSION." it doesn't work, but works fine replacing "SESSION"...?
Edited by: /dev/null on Nov 17, 2008 2:54 PM

Similar Messages

  • Substitution variables in stored procedures

    Help, anybody! I want to create a procedure that updates a column of a table, however I want that column and the new data specified at run time. I've tried writing a procedure that has substitution variables for the column and new_data values:
    CREATE OR REPLACE PROCEDURE update_client(v_account_id IN VARCHAR2)
    IS
    v_column varchar2(50);
    v_new_data varchar2(50);
    last_name varchar2(20);
    BEGIN
    v_column:=&v_column;
    if v_column=last_name then
    UPDATE Client set last_name='&v_new_data' where account_id=v_account_id;
    end if;
    end;
    but that's not working, and I also tried to pass v_column and v_new_data as parameters but that won't work either.
    CREATE OR REPLACE PROCEDURE update_client (v_account_id IN VARCHAR2, v_column IN VARCHAR2, v_new_data IN VARCHAR2) AS
    BEGIN
    UPDATE client set v_column=v_new_data where v_account_id=account_id;
    END;
    I get the error: unable to resolve "V_COLUMN" as a column
    Is there anyway at all to do this via a stored procedure? I'm all out of ideas.
    Thanks

    In Oracle8i you can use dinamic nebeded SQL. In previous versions you need DBMS_SQL.
    Regards
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Lori Fortner ([email protected]):
    Help, anybody! I want to create a procedure that updates a column of a table, however I want that column and the new data specified at run time. I've tried writing a procedure that has substitution variables for the column and new_data values:
    CREATE OR REPLACE PROCEDURE update_client(v_account_id IN VARCHAR2)
    IS
    v_column varchar2(50);
    v_new_data varchar2(50);
    last_name varchar2(20);
    BEGIN
    v_column:=&v_column;
    if v_column=last_name then
    UPDATE Client set last_name='&v_new_data' where account_id=v_account_id;
    end if;
    end;
    but that's not working, and I also tried to pass v_column and v_new_data as parameters but that won't work either.
    CREATE OR REPLACE PROCEDURE update_client (v_account_id IN VARCHAR2, v_column IN VARCHAR2, v_new_data IN VARCHAR2) AS
    BEGIN
    UPDATE client set v_column=v_new_data where v_account_id=account_id;
    END;
    I get the error: unable to resolve "V_COLUMN" as a column
    Is there anyway at all to do this via a stored procedure? I'm all out of ideas.
    Thanks<HR></BLOCKQUOTE>
    null

  • Where does substitution variable meta data stored?

    where does substitution variable meta data stored in the essbase folder?<BR>Thanks<BR>Arun

    I believe substitution variables are stored in the Essbase.sec (Security file).

  • 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

  • Error When Prompting for Substitution Variable

    Hi - I'm receiving an error when I try to run the following using the substitution variable - but only when I enter a string; when I enter a numeric value it runs fine.
    DECLARE
        l_SCR_Info            VARCHAR2(50) := '''SCR'||&SCR_NUM||'-'||'''';
    begin
    dbms_output.put_line(l_SCR_Info);
    end;Here is the error I receive when I supply a string value when prompted:
    ORA-06550: line 3, column 52:
    PLS-00201: identifier 'AB' must be declared
    ORA-06550: line 3, column 27:
    PL/SQL: Item ignored
    ORA-06550: line 10, column 22:
    PLS-00320: the declaration of the type of this expression is incomplete or malformed
    ORA-06550: line 10, column 1:
    PL/SQL: Statement ignoredCan anyone shed some light on what I'm missing here?
    Thanks!
    Christine

    Hi,
    It looks like you just want one string there:
    l_SCR_Info            VARCHAR2(50) := '''SCR&SCR_NUM-''';Remeber how substitution variables work: SQL*Plus replaces them with values before sending the code to the back end to be compiled.
    If you give a value like AB for the variable, the code you posted is equivalent to:
         l_SCR_Info            VARCHAR2(50) := '''SCR'|| AB ||'-'||'''';by the time it reaches the compiler. AB is not inside quotes, so the compiler looks for a variable or function called AB.
    If you gave a number:
         l_SCR_Info            VARCHAR2(50) := '''SCR'|| 123 ||'-'||'''';there's no problem; the compile knows what the literal number 123 is.

  • 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

  • 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/

  • Assign substitution variable to another substitution variable with truncation of value

    I launch a sql*plus .sql script by way of a concurent job. The concurrent job provides a date paramenter to the script.  Job log shows the date passed to scrpit as:
    Arguments
    2013/09/01 00:00:00
    For cosmetic purposes in the ouput's heading, I want to convert/truncate the character string to an end-user format of 2013/09/01.
    Trying to simply change one substitution variable
    (below is not working, but hopefully telegraphs my intention:
    UnDefine Low_date
    Define Low_date = '2013-09-01 00:00:00'
    UnDefine Low_date_10
    Define Low_date_10 = 'yyyy-mm-ds'
    select substr('&Low_Date',1,10) into &Low_date_10 from dual;
    prompt "Variable value is: &Low_date_10"
    WHICH PRODUCES:
    old:select substr('&Low_Date',1,10) into &Low_date_10 from dual
    new:select substr('2013-09-01 00:00:00',1,10) into yyyy-mm-ds from dual
    Error starting at line 8 in command:
    select substr('2013-09-01 00:00:00',1,10) into yyyy-mm-ds from dual
    Error at Command Line:8 Column:55
    Error report:
    SQL Error: ORA-00905: missing keyword
    00905. 00000 -  "missing keyword"
    *Cause:   
    *Action:
    old:prompt "Variable value is: &Low_date_10"
    new:prompt "Variable value is: yyyy-mm-ds"
    "Variable value is: yyyy-mm-dd"
    "I need to get to "Variable value is: 2013/09/01"

    Hi,
    SELECT ... INTO only works in PL/SQL.
    In SQL*Plus, you can use COLUMN ... NEW_VALUE, like this:
    DEFINE  low_date = '2013-09-01 00:00:00'
    COLUMN low_date_10_col        NEW_VALUE  low_date_10
    SELECT  REPLACE ( SUBSTR ( '&Low_Date', 1, 10)
                    )    AS low_date_10_col
    FROM  dual;
    PROMPT  Variable value is: &Low_date_10

  • Peculiar problem with Essbase (Calc Script) - substitution variable / UDAs

    This is odd but I have a script like :
    VAR iloop=1,break=0;
    FIX(<required POV>)
    Loop (20,break)
    VAR Country_total1,Country_total2,Country_total3;
    FIX (@UDA(Entity,@ALIAS(@CONCATENATE("&Country",iloop)))) // &Country1, &Country2 - are substitution variables with UDAs stored as strings
    Statements;
    /* +<statements for calculating total values.. for that country and stored against variables>+ */
    Country_total1=Country_total1+ +<Calculation>+
    ENDFIX
    /* Second part : Now again the calculations stored in the variables are to be stored against specific entities */
    FIX (@UDA(Entity,@ALIAS(@CONCATENATE("&Country",iloop))))
    FIX(@ISUDA(Entity,<Check1>)
    ..... Assign to relevant account
    ENDFIX
    ENDFIX
    ENDLOOP
    ENDFIX
    Now the problem is that the first fix statement works just fine, but the FIX statement in the 'second part' throws an error
    Error: 1200354 Error parsing formula for [FIX STATEMENT] (line 66): expected type [STRING] found [EXTVAR] ([iloop]) in function [@CONCATENATE]
    If I hard code the 'second part' FIX statement to the substitution variable directly - it works just fine.
    How can the first statement work and not the second one ? They are exactly the same.

    Glenn, thanks - I hadn't thought of that :).
    But it still does not entirely solve my problem (please see my previous post depicting a requirement similar to ours )
    - We have lots of countries (50-60+ might be much more) and each country can have multiple entities (3-4 on an average - can go unto 7-8)
    - so good guess would be around 200 entities
    - So say I have to do it for 2 countries only (two entity types). Then I need 4 variables - 2 for each country ('country 1 ET1 total', 'Country 1 ET2 Total')
    When the list is 20 counties - variables become 40 :(.
    - Still leaving aside the 40 variables for a bit -
    There are subsequent steps of calculations which needs to be done based on these totals (which are exactly the same for all countries) - just that we need the correct totals to begin with and the rest is already stored in the DB
    So since I have a different variable for each country - I cannot write one single calculation block to use the variables sequentially one by one (can I ?)
    I might have to write a separate calculation block for each of these countries. (20 separate blocks)
    That's what I was trying to avoid and simplify with the substitution variable (but is not working)
    - Create substitution variables - which would store the alias of the required countries (2/10/20 as many required)
    - Loop through these substitution variables - using them one by one
    - So I just need one single block of calculation with all the variable in the calc script being reused after each country calculation is done
    - and the user need not go into the script, as the only thing that will change are the countries. And he can change it easily through the substitution variable.
    Edited by: Ankur on Jun 27, 2012 12:53 PM

  • Issue with rule file and Substitution variable

    Hi All,
    I am using Essbase 9.3.3
    I created a rule file with 5 dimensions in which 3 dimensions I defined in columns and two dimensions I gave it as header in data column with comma seperated.
    Among those two dimension members, one is an account member with "/" in it within quotes and other is a substitution variable.
    The member assigned for that Substitution variable has a space in between and is updated within quotes in variables list.
    When I try loading data, I am getting an error saying that two members are not valid.
    Eg: "Tax/Unit",&Scenario is not valid.
    &Scenario - "Budget Q1"
    Can some one please suggest on the issue.
    I am not facing any problem in calc scripts or reports scripts using the substition variable.
    Thanks in advance

    Mark,
    Modifying the default files is dangerous and ill advised. You could always just add a style sheet (inline or linked) to your application that overrides that one setting while you wait on the permanent fix.
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen

  • 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

  • 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.

  • How to pass parameter [bind variable or substitution variable] to a view?

    How can I pass a parameter [bind variable or substitution variable] to a view in Oracle?
    Some will tell me that this is not necessary, that I can only pass the parameter when I query the view, but I found some case where this cause performance issue. In long view where I use subquery factoring [WITH], it's necessary to pass the parameter many time through different subqueries and not only to the resulting view.
    In other database (SQL Server, Access), we can pass parameters through query. I can't find how to do that in Oracle. Can some one tell me what is the approach suggest by Oracle on that subject?
    Thank you in advance,
    MB
    What I can do:
    CREATE VIEW "HR"."EMP_NAME" ("FIRST_NAME", "LAST_NAME")
    AS
    SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEES;
    What I want to do:
    CREATE VIEW "HR"."EMP_NAME" ("FIRST_NAME", "LAST_NAME")(prmEMP_ID)
    AS
    SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEES WHERE EMPLOYEE_ID IN (:prmEMP_ID);

    Blais wrote:
    How can I pass a parameter [bind variable or substitution variable] to a view in Oracle?
    Some will tell me that this is not necessary, that I can only pass the parameter when I query the view, but I found some case where this cause performance issue. In long view where I use subquery factoring [WITH], it's necessary to pass the parameter many time through different subqueries and not only to the resulting view.Yes, there can be performance issues. Views are a form of dynamic SQL and it is hard to predict how they will perform later.
    You can't pass parameters to a view. They are not functions. The mechanism to put the values in is what you mentioned, passing the parameter when you query the view.
    In other database (SQL Server, Access), we can pass parameters through query. I can't find how to do that in Oracle. Can some one tell me what is the approach suggest by Oracle on that subject? This functionality is not supported.
    What I can do:
    CREATE VIEW "HR"."EMP_NAME" ("FIRST_NAME", "LAST_NAME")
    AS
    SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEES;
    What I want to do:
    CREATE VIEW "HR"."EMP_NAME" ("FIRST_NAME", "LAST_NAME")(prmEMP_ID)
    AS
    SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEES WHERE EMPLOYEE_ID IN (:prmEMP_ID);Include the bind value when you use the view in a SELECT. The value will be applied to the view at run-time, somthing like
    CREATE  VIEW "HR"."EMP_NAME_VW" ("FIRST_NAME", "LAST_NAME","EMPLOYEE_ID")(prmEMP_ID)
    AS  SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEES;
    select *
      from emp_name_vw
      WHERE EMPLOYEE_ID IN (:prmEMP_ID);To use EMPLOYEE_ID I added it to your list of columns in the view so it can be referenced in the WHERE clause. If you don't want to see that value don't select it from the view.

  • && Substitution Variable in Package Body using SQL Developer

    Hi Folks,
    I've moved over to working to in SQL Developer (its a very early version - 1.0.0) from a combination of SQL*Plus command line and a text editor. I'm trying to get this upgrgraded, but I think the question will be the same with a newer version anyway.
    I am creating a package, and in the package body I have some &&my_var substitutions that I was previoulsy prompted for when calling the .sql from the command line SQL*Plus. I need this as the variable needs to be different for the development and live environment.
    When working in SQL Developer, I can load the package body from Connection->Packages->My Package->My Package Body, and click the edit button to edit the code, however, when I click the Compile button in the top of the window my code error's because of the substituion variablle. An example is:
    CREATE OR REPLACE
    PACKAGE BODY MY_PACKAGE AS
    PROCEDURE MY_PROCEDURE
    BEGIN
    my_variable := &&my_function_from_live_or_dev_database
    END MY_PROCEDURE
    Can anyone tell me if there is a way of defining a compiler variable within the IDE widow while editing a package body stored in the database, without manually copying the code into the Worksheet and running it as a script?
    Thanks,
    AM

    953104 wrote:
    Thanks for the reply, the code was just quickly typed to show the sort of thing I am doing, it wasn't actual code form my project.
    I've come from a C background so what I would have done would be create a #define and changed to when on live or development - or passed the variable to the build environment from the IDE or makefiles and the change would have reflected through my whole project.
    What I want to be able to do is alter a definition of some sort that will reflect throughout my whole project, so I can change it in one location to minimize code changes before going live. I don't really want to be prompted at all. On one system it needs to be DEV_10 and on the other it needs to be LIVE_10.Is there a possibility to elimiante this difference at all?
    For example if DEV_10 is the oracle schemauser on the development database and LIVE_10 would be the one on the production system. THen you could just remove all references to the schema from your code.
    IF you are already connected to this schema, then you don't need to specify the schema name anymore.
    example
    instead of
    create or replace package dev_10.myPackage
    ...you can simply use
    create or replace package myPackage
    ...If needed you can alter the cuurently connected user just before you run the script.
    alter session set current_schema = LIVE10;
    create or replace package myPackage
    ...This would be a different working window in the developer (script worksheet, instead of direct pl/sql editor).
    Substitution variables are allowed there.

  • How can I show the current value of a substitution variable in FR?

    Hello,
    I want to paste the current month in a text box using a substitution variable in my report. How can I use the Curmth sub-var in a text box? Which function would I use to paste the substitution variable. Thank you.
    -- Adi
    Edit:
    The Sub-Var is not used anywhere in the report but it is in the database that the report accesses.
    Edited by: Aditya26 on Apr 12, 2012 8:42 AM

    I think you can only reference items on the actual report.
    It might be easier to pull the subvar into the report (on a hidden column/row) and then you can reference the cell.
    Cheers, Iain

Maybe you are looking for