Use substitution methods in variable

Hi All,
How do I use substitution methods in variable? For example, I am trying to get a session number in to a variable.
I defined a variable and wrote the followign querry
select <%=odiRef.getSession("SESS_NO")%> from dual.
When I click on tick mark to check the syntax, it is throwing an error message saying missing expression. Please help me out. THank you!

Put quotes around the substitution method:
select '<%=odiRef.getSession("SESS_NO")%>' from dual
You will not be able to "test" this, you can execute it, and see what the result comes back.

Similar Messages

  • Additional condition check in using Substitution method...

    Hi All,
    We are using Substitution method to replace offsetting entry FRE with custom transaction key ZFR for all Finished goods for Purchase account active company codes.
    But our requirement is to replace FRE only when it is an off setting entry for FR1 (Freight cost). Could somebody help me in including this additional condition in the Substitution method?
    Thanks,
    Vamshi

    Hi
    can you let us know how you managed to replace FER with ZFR... This will help us in replying back to you
    br, Ajay M

  • How to get Interface's Internal ID using substitution methods

    Do anyone have any idea, how can I get an Interface's internal ID. Is there any substitution method that I can use to get the ID.
    I want to use this ID in the steps of Knowledge Module (KM).

    But querying SNP_POP to get the ID in a refresh variable will force me to create a package. I can't afford to do that because my KM will be used in several interfaces and packages. So, I have to find all such packages and add this variable in all of them which is a tedious task.
    Anyways, thanks for your response!
    Edited by: Sheku08 on Apr 6, 2012 2:10 AM

  • Additional condition check in the Substitution method...

    Hi All,
    We are using Substitution method to replace offsetting entry FRE with custom transaction key ZFR for all Finished goods for Purchase account active company codes.
    But our requirement is to replace FRE only when it is an off setting entry for FR1 (Freight cost). Could somebody help me in including this additional condition in the Substitution method?
    Thanks,
    Vamshi

    Hi
    can you let us know how you managed to replace FER with ZFR... This will help us in replying back to you
    br, Ajay M

  • Panic.. with substitution method

    Hi all, I would like use substitution method to do a dynamic check, but I really don't know how to do that. This is my first serious approach with substitution method.
    What I want to do is the following:
    I would like to do an insert into a fixed table reading source numeric fields only aggregating those. my English is so bad, so i believe is better explain with an example.
    the fixed table is something like :
    CREATE TABLE te001_se_chk (
    d_ela DATE NOT NULL, -- elaboration date
    n_seq NUMBER NOT NULL, -- source table id
    n_src_row NUMBER(9,0) NULL,
    n_trg_row NUMBER(9,0) NULL,
    n_src_val_1 NUMBER(19,4) NULL,
    n_trg_val_1 NUMBER(19,4) NULL,
    n_src_val_2 NUMBER(19,4) NULL,
    n_trg_val_2 NUMBER(19,4) NULL,
    n_src_val_3 NUMBER(19,4) NULL,
    n_trg_val_3 NUMBER(19,4) NULL,
    c_res VARCHAR2(2) NULL,
    n_prg_se_chk NUMBER(5,0) NOT NULL
    I have to read source table (as400 file), find the first 3 numeric fields of the source table and valorize n_src_val_1 ,n_src_val_2 ,n_src_val_3 fields with a sum() aggregation, the n_src_row field will be filled with the count(*) of the source table.
    If source table has the following record inside:
    1,2,'a',3
    2,4,'b',6
    3,6,'c',9
    the n_src_row will be 3
    the n_src_val_1 will be 6
    the n_src_val_2 will be 12
    the n_src_val_1 will be 18
    If the source table as only 1 numeric fields I would like to fill n_src_val_1 field and n_src_row only.
    Is it possible to do that with procedure or customized KM? If yes, how can I do that ?
    Thanks

    With the example you gave, I thought- 1st, 2nd & 4th fields are the numeric fields.
    Is it possible that the numeric fields in a record could be scattered?
    To check numeric ness, you can use SQL Functions directly/indirectly, depending on- Which database engine you're using.
    For instance-
    if you're using SQL Server, you may use- IsNumeric. ISNUMERIC returns 1 when the input expression evaluates to a valid numeric data type; otherwise it returns 0.
    if you're using Oracle, select length(translate(trim(column_name),' +-.0123456789',' ')) from dual. This gives you a 0 if it's a numeric or >0 for non-numeric(actually gives the count of non numeric characters)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Substitution method to change the posting date in FB50

    Guys,
               My client requires the posting date to be blank in FB50. I used substitution method to do so, but its validating only after FB50 comes into picture. I want the posting date to be blank as soon as the transaction is entered. Did any one come acorss such situvation?
    Thanks in advance,
    Isaac

    Hi Smart,
    When your user is on FB50 screen, ask him to empty the posting date field and from the menu choose System -> User Profile -> Set Data (yes, you read it right, it is Data, not date - and date is also data!!!). That will save blank posting date in user parameters (SU3). Exit FB50 and re-enter. You will see that Posting Date is blank, but is also greyed out. Don't worry, enter Doc. Date and press 'Enter' key. It will open up Posting Date field as initial and your user can enter any date he wants, provided the posting period is open.

  • FileName using Variable Substitution Method

    Hi SAP experts,
    I need some advise regarding this.
    I have here sample structure of message,
    DT_Root  --> root node
      Tree  --> occurence is 1 to unbounded
        SubTree1
        SubTree2
        SubTree3
    What will be my File Content Conversion parameters to be set in Variable Substitution Method in order for me to get the value of SubTree3 and make it as my filename?
    Also, the value of SubTree3 must not be present on my actual payload..
    var1:payload,1,SLI,1   ---?? what if it is unbounded?
    Kindly advise.
    Thank you very much.

    Hi Raj,
    I cannot open the link.
    Anyway, is it ok if you will advise me regarding my question a while ago?
    I have here sample message structure,
    CSV --> Message Type
    SLI  --> 1 .. unbounded (occurence)
      subSLI1
      subSLI2
      subSLI3
    FileNode --> 1..1 (occurence)
      FileName --> 1..1
    Here's my parameters in Variable Substituion method,
    FileName Scheme: %var1%.csv
    var1   --  payload:CSV,1,FileNode,1,FileName,1
    File Content Conversion Parameters:
    Recordset Structure: SLI,FileNode
    SLI.addHeaderLine: 3
    SLI.headerLine: PERIO;EAN;ILN,....
    SLI.fieldFixedLengths: 8;10;13;...
    SLI.fixedLengthTooShortHandling: Cut
    SLI.fieldSeparator: ;
    SLI.endSeparator: 'nl'
    FileNode.fieldFixedLengths: 0
    FileNode.fixedLengthTooShortHandling: Cut
    I must the output flatfile with a value of the filename in the FileName field.
    And the content of the flatfile must look like this,'
    PERIO;EAN;ILN;SALES;TURNO;PERFL;SUBSFL;SALUN;%CURRENCY%;STOCK;STOUN;ARTNR;ARKTX
    20071020;737052020198 ;4333342000008;         1;        9.95;W;X;ST ;EUR;0000000000;ST ;                                  
    20071020;737052056852 ;4333342000008;         1;       14.50;W;X;ST ;EUR;0000000000;ST ;                                  
    20071020;737052073552 ;4333342000008;         1;       12.95;W;X;ST ;EUR;0000000000;ST ;                                  
    *each field has a fixed field length.
    Kindly advise if my set parameters are correct.
    Thank you very much!

  • Can substitution methods other than the Global be used in a procedure ?

    Hi All,
    I am very much new to ODI .Apologies if the question seems silly.
    As part of an exercise I am working with ODI variables and substitution methods.
    My question is substitution methods like odiRef.getColList,odiRef.getFrom,getTargetColList() used in KM's for Code Generation while executing an interface,
    can they be used in a ODI procedure giving the necessary parameters as they require .
    Eg : Command on source :
    select     
         <%=odiRef.getColList("", "[COL_NAME]", ",\n\t", "", "")%>
    from <%=odiRef.getObjectName( "TABLE_NAME" )%>
    Command on target :
    insert into <%=odiRef.getTable("L", "TABLE_NAME", "D")%>
         <%=odiRef.getColList("", "[CX_COL_NAME]", ",\n\t", "","")%>
    values
         <%=odiRef.getColList("", ":[CX_COL_NAME]", ",\n\t", "","")%>
    Ofcourse ,this is what an interface does but my requirement is to pass table name as variables and run this code iteratively to load targets,which again will be passed as variable.
    Will this run as a ODI procedure ?I tried and am getting exception errors.The getobjectName being global works fine with the proper table name generated in the code,but the getCollist does not work .Hence wanted to know if this standalone procedure is possible or will this code run only as part of KM over a interface?
    Thanks,

    Hi ,
    I had gone through this document,and from other sources also got a same answer that it cant be used.But is there a way it can be done?
    Actually we have many number of the small tables with just 10 records to be brought into the warehouse.The idea is to instead of doing it via an interface , why not try with a control table with an just the relevant entries and a procedure as above posted code.
    Some ideas would help.
    Thanks,

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

  • 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

  • Variable Substitution Method

    Hi,
    When Im going through the variable substitution method with respect to the target directory:
    with the help of the blog
    An interesting usage of Variable Substitution in XI
    I dint understand what is the SID here. SID of different systems like DEV system, PRD system and etc. What exactly is an SID?
    If we take SID as a variable in the variable substitution method, then the value to VAR will be getting from the header i.e, Receiver_Service.
    From where does the Receiver_Service gets the SID? whenever the system is changed from DEV to PRD or to someother.
    Kindly let me know if i can get any such other blogs on this scenario.
    Thanks in Advance,
    Divya

    Hi ,
    As said above Message header contains the following informations
    sender_party
    sender_service
    receiver_party
    receiver_service
    interface_name
    interface_namespace
    message_id
    message_id_hex
    SID stands for System ID and is a three character unique name for a SAP system. It will be different for different systems like for Dev system it may be XXX and for quality system say YYY and similarly for production system say ZZZ. Message header values are accessed dynamically.
    Thanks!

  • How to use substitution variables in Microsoft Word using Hyperion Smart view

    Can we use Substitution Variables in copy data points and refresh in Microsoft Word? I tried it and it does not work dynamically (copy data points only copies what was in excel cell at that point). It only copies the static value of that variable from that cell. I want to use it dynamically in Word so that if I change the value of that variable in Essbase, it is updated in Word upon refresh. Any idea??
    We need this feature for reporting in microsoft word and keep using the data points every year (instead of copying the cells from excel over again)
    Any help/suggestion is appreciated.
    Thanks

    you can't use substitution variables with copy data points. I had tried a while ago (post 111.1.2.1.102) and it wouldn't work.  I checked with Oracle development and they said it I not available

  • Using Substitution Variable in Web forms

    Hi,
    I'm trying to use substitution variable in a planning web form &CurYr in the Column, after creating the form when I save it and try to open the form it says the substitution variable required for this calculation is undefined .Variable : &CurYr.It should be defined as I'm able to see it and select it for the column/row. Any kind of help is appreciated.
    Thanks
    Vinil

    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/

  • How can i use substitution variable

    Hai All
    This is my sql statement
    SELECT (TO_DATE(TO_CHAR(Intime,'DD-MON-YYYY')||' '||
    TO_CHAR(0815,'0000'),'DD-MON-YYYY HH24:MI')-intime) * 24*60
    from dail_att where to_char(intime,'hh24mi') between 0700 and 0815 ;
    Here my table name called Dailyattendance
    Intime field is declared as Date Type
    So now i have hardcoded 0815 and now my intime is subtracted from this time so i can calculate the employee
    coming late so how can i use substitution variable here to give the value at run time
    Ie i need to give 0815 instead or any other time at runtime
    Thanks In advance
    Srikkanth.M

    Where exactly are you planing to use it? Is sqlplus or at any other front end?
    One way is to use below given SQL
    SELECT   (  TO_DATE (   TO_CHAR (intime, 'DD-MON-YYYY')
                         || ' '
                         || TO_CHAR (:TIME_VAR, '0000'),
                         'DD-MON-YYYY HH24:MI'
              - intime
           * 24
           * 60
      FROM dail_att
    WHERE TO_CHAR (intime, 'hh24mi') BETWEEN 0700 AND 0815;*009*
    Edited by: 009 on Apr 6, 2010 2:15 AM

  • Mitigating SQL injection when forced to use substitution variables

    The 3rd party software that I use has exactly one way of allowing users to specify runtime parameters: Substitution variables.
    The scripts are executed using SQL*Plus. I'm looking for ways to secure this.
    Please don't say "Don't use substitution variables" - read above, it's the only way this software works.
    My first thought was something like this:
    var myvar varchar2(30)
    exec :myvar := '&user_input';That's no good. What if the user specifies "X'; execute immediate 'drop table sometable" Then we get
    exec :myvar := 'X'; execute immediate 'drop table sometable';Again, no good.
    I thought perhaps something like the following would work:
    exec :myvar := dbms_assert.noop('&user_input');but then again, a malicious user could specify "'); execute immediate 'drop table sometable'; dbms_assert.noop('"
    I'm open to suggestions.
    What can I do to sanitize substitution variables?
    Thank you!
    Edited by: krissco on Jan 30, 2013 3:02 PM

    You could use:
    var myvar varchar2(30)
    exec :myvar := DBMS_ASSERT.ENQUOTE_LITERAL('&user_input');For example:
    SQL> exec :myvar := '&user_input';
    Enter value for user_input: X';execute immediate 'begin dbms_output.put_line(''XXXX'');end;
    XXXX
    PL/SQL procedure successfully completed.
    SQL> exec :myvar := DBMS_ASSERT.ENQUOTE_LITERAL('&user_input');
    Enter value for user_input: X';execute immediate 'begin dbms_output.put_line(''XXXX'');end;
    BEGIN :myvar := DBMS_ASSERT.ENQUOTE_LITERAL('X';execute immediate 'begin dbms_output.put_line(''XXXX'');end;'); END;
    ERROR at line 1:
    ORA-06550: line 1, column 48:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:
    ) , * & = - + < / > at in is mod remainder not rem =>
    <an exponent (**)> <> or != or ~= >= <= <> and or like like2
    like4 likec as between from using || multiset member
    submultiset
    The symbol ")" was substituted for ";" to continue.
    ORA-06550: line 1, column 110:
    PLS-00103: Encountered the symbol ")" when expecting one of the following:
    * & = - + ; < / > at in is mod remainder not rem return
    returning <an exponent (**)> <> or != or ~= >= <= <> and or
    like like2 like4 likec between into
    SQL>SY.
    Edited by: Solomon Yakobson on Jan 30, 2013 8:28 PM

Maybe you are looking for

  • IPhone User Guide - desktop

    I have a link: http://help.apple.com/iphone/guide/desktop.html that opens up a great format of the guide and looks like it would work perfect for having an always ready support doc. The problem is that I can open this page on my iMac, but NOT my iPho

  • How to turn off this audit?

    I see lots of auditing records getting generated with action# 85, i looked up, it is truncate table. how can i turn it off? the following are the current auditing option from this database. which one is generating this action# 85. ==== AUDIT ADMINIST

  • No album art for uploaded cds

    I uploaded a couple of cds i bought, and i cant figure out how to get album art for those cds. Any one know how to fix this?

  • Free epub

    Hi A question to think of a workaround. I am using ibooks to create an ebook. However as I am not in the States, I can't sell it on the iBook Store, only do a free version. Is it possible to upload a book in free mode, re-download it to have the ePub

  • Iphone 5c lost icould

    I am posting this for my girlfriend, this is our last resort.  We have visited the iphone store, and talked online with support.  Last year this time she upgraded from an iphone 4s to a 5c.    A clerk at Verizon helped her set up the phone.  Fast for