Using variables in a procedure

Hello experts,

I am new in odi, but did very well but I'm not reached to use variables ate a bunch of odi.
Let me explain the problem:

(1) I create three variables non-persistent to odi that retrieves the value of a sql statement select, like this, for example:

Select '< % odiRef.getPrevStepLog ("SESSION_NO") = >' FROM DUAL; (Variable name-SESS_NO)
Select '< % odiRef.getPOP ("POP_NAME") = >' FROM DUAL; (Variable name-INTER_NAME)
Select '< % odiRef.getPrevStepLog ("STATUS") = >' FROM DUAL; (Variable name-FLAG_STA)
...

(2) then I create an odi procedure that insert values into a table of newspaper: insert into < table_name > values ('#SESS_NO', 'INTER_NAME', '#FLAG_STA')

(3) then I create a package that has the following:

Interface (success)-> procedure (with the insert statement)

The question is, where do I put the variables? Everywhere where I put them, the operator gives me an error message which, during the execution of the insert statement, indicate that the variable has no value. I'm trying to insert then before the intervention, (Interface (success)-> var1 (success)-> Var2 (success)-> Var3 (success)-> procedure (with the insert statement)), but they, of course, an error because the previous step of the var1 var2, where should be the interface.

I'm trying to create a scenario (new package) with the variables and the main package becomes like this:

(Interface (success)-> script (new package) (success)-> procedure (with the insert statement)

But the error still occurs, and no value is assigned to the variables.

Any help will be appreciated gratefully.

Thanks in advance,

Daniel huh

Published by: user10470648 on November 10, 2008 04:11

Hi Daniel,.

Sorry for my delay to answer you...

To solve the problems...

(1) OK

(2) you must repeat the "refresh state variable' running after each interface or the procedure. It is possible to paralallel the execution but it's a different architecture.

(3) on the variables, simply drag and drop it to the package and leave it as declaring type. This wll allow you, after creating a scenario, use these variables as stamped.

I'll send you an ODI paper on how to use it (in replay to the email you sent me)

This help you?

Published by: Cezar Santos on 11/12/2008 11:34

Tags: Business Intelligence

Similar Questions

  • using variable in a procedure stored

    Hello
    I have a select statement that returns a numeric value.
    I need to store the value in a variable and pass it to an insert...
    to do this, I created a stored procedure that accepts two variables... one for the select statement and the other for the Insert...

    the stored procedure:
    ---------------------------------------------------------------------------------------------------------------------------

    create or replace procedure ins_state (State in varchar2, countr in varchar2)
    as
    var I digital;
    Start
    I: = select country_id of countries where country_name = countr.
    insert into statement (country_id, state_name) values (i, State);
    commit;
    end ins_state; /

    ---------------------------------------------------------------------------------------------------------------------------

    the problem is that I m getting the error: -.

    ---------------------------------------------------------------------------------------------------------------------------

    ERROR on line 6: PLS-00103: encountered the symbol "INSERT".

    4. start
    5 i: = select country_id of countries where country_name = countr.
    6. Insert the values of the State (country_id, state_name) (i, State);
    7 validation;
    8 end ins_state; /

    ---------------------------------------------------------------------------------------------------------------------------

    Any help...
    Thank you
    Zita, India

    Find the right syntax below:

    create or replace procedure ins_state (State in varchar2, countr in varchar2)
    as
    i the number;
    Start
    Select country_id in I country where country_name = countr.
    insert into statement (country_id, state_name) values (i, State);
    commit;
    end ins_state; /

  • Problem running procedure using Variables

    Hi all

    I am trying to execute the procedure in a statement declared/Begin/End and using variables as parameters of entry in my interior but I get away to an invalid SQL statement error. My code is below:
    declare
    
      START_dt  VARCHAR2(30);
      END_DT VARCHAR2(30);
      
         
      begin
            
        SELECT '01-APR-2011'
        INTO END_DT
        FROM DUAL;
      
        SELECT '01-APR-2020'
        INTO END_DT
        FROM DUAL;
             
           
         BEGIN EXECUTE IMMEDIATE 'INSERT_PROV_ACSC_IND_REF('||START_dt||','||END_DT||')';END;COMMIT;
    
     end;
    
    Error at line 1
    ORA-00900: invalid SQL statement
    ORA-06512: at line 18
    Is the way that I normally run my procedure outside this statement Declare/Begin/End: EXECUTE INSERT_PROV_ACSC_IND_REF('01-APR-2011','01-APR-2020');

    The table that takes the data from the procedure does not correct timestamp but my procedure takes the varchar above dates and turns them into dates in the procedure so that the entry date settings are left as a string.

    Any help would be appreciated.

    Thank you

    And if you want to use variables:

    declare
        START_dt  VARCHAR2(30);
        END_DT VARCHAR2(30);
    begin
        START_dt := DATE '2011-04-01';
        END_DT := DATE '2011-04-01';
        INSERT_PROV_ACSC_IND_REF(START_dt,END_DT);
    end;
    /
    

    SY.

  • Using variables such as table names. Ideas for alternative designs

    Hello

    I am the design of an application that uses synonyms to pull information from the 'client' DBs via links from DB. Synonyms are created with a DB_ID in name (example: CUSTOMER_100, CUSTOMER_200... where the 100 and 200 are DB IDs of 2 separate DBs customer.)

    I have a procedure that selects data in the synonym based on what DB_ID is passed to the procedure. I want to be able to perform this procedure for any entered DB_ID. I know now I can't use variable for the table names names and using EXECUTE IMMEDIATE does not seem suitable for what I'm trying to do.

    Does anyone have suggestions or re-design options, I could use to achieve this generic procedure which will select a certain synonym based on the information of DB input parameters? Thank you.

    CREATE or REPLACE PROCEDURE CUSTOMER_TEST (p_host IN VARCHAR2, p_db_name IN VARCHAR2, p_schema in VARCHAR)

    IS

    v_hostname VARCHAR2 (50): = UPPER (p_host);

    v_instance VARCHAR2 (50): = UPPER (p_db_name);

    v_schema VARCHAR2 (50): = UPPER (p_schema);

    v_db_id NUMBER;

    v_synonym VARCHAR2 (50);

    CURSOR insert_customer

    IS

    SELECT

    c.customer_fname,

    c.customer_lname

    OF v_synonym_name c;

    BEGIN

    -MADE BASED ON INPUT PARAMETERS DB_ID

    Select d.db_id

    in v_db_id

    of t_mv_db_accounts ac.

    t_mv_db_instances I,.

    t_mv_dbs d,

    t_mv_hosts h

    where ac.db_ID = d.db_ID

    and i.db_ID = d.db_ID

    and i.HOST_ID = h.host_id

    and upper (H.HOST_NAME) = v_hostname

    and upper (D.DB_NAME) = v_instance

    and upper (Ac.ACCOUNT_NAME) = v_schema;

    -ADD DB_ID TO NAME SYNOYNM

    v_synonym: = 'CUSTOMER_ | v_db_id;

    FOR cust_rec IN insert_customer

    LOOP

    INSERT INTO CUSTOMER_RESULTS (First_Name, Last_Name)

    VALUES (cust_rec.customer_fname, cust_rec.customer_lname);

    END LOOP;

    COMMIT;

    END;

    /

    RGS,

    Rob

    EXECUTE IMMEDIATE ' INSERT IN CUSTOMER_RESULTS (First_Name, Last_Name) SELECT customer_fname, customer_lname FROM ' | v_synonym;

  • updating of a variable in a procedure

    Hello!

    I know this thread has already posted several times, but I am doing everything as it is explained and it still does not work.

    I created the variable STARTDATE: TEXT, the most recent value and a package with following steps:

    (1) declare the Variable STARTDATE
    (2) update the Variable STARTDATE
    (3) procedure

    The procedure uses the variable, but does not recognize it.

    Update Table1 set eof_timestamp_2 = eof_timestamp_1 where eof_timestamp_1 > = to_date ('#ODS.) STARTDATE ',' dd.mm.yyyy hh24:mi:ss')

    Thanks for help
    Marcin

    It should work... seems that ODI is not translating the variable.

    Let me suggest something to debug this variable...

    Creat a step before update like:

    Technology: Java BeanShel
    Check ignore error checkbox

    Command:

    throw new Exception ("' \n\n is the value of the variable: #STARTDATE \n\n '")

    This command should show if ODI can recognize the variable inside the procedure.

    Run and tell me what you have to tab performance (operator)

    Cezar Santos
    [www.odiexperts.com]

  • What are the parameters? How are Variables differenet? Why we can not use variables to pass data to one sequnece to another? What is the advantage to use parameters instead of Variables?

    Hi all

    I am new to TestStand. Still in the learning process.

    What are the parameters? How are Variables differenet? Why we can not use variables to pass data to one sequnece to another? What is the advantage to use parameters instead of Variables?

    Thanks in advance,

    LaVIEWan

    I'm sorry... I discovered that... its not at all possible to pass data to another sequence using variables... it must be through settings... once again I apologize for the display of such a stupid question

  • Impossible to use variables shared when deploying an exe file

    I tried to use variables shared for some time. I have been all over the forums and still have had no luck. I can get these VI to work until I have install on another PC while they do any work. I don't know what I'm doing wrong. I forced libraries to deploy, but they still do not work on the machine, that I install the exe file. I don't think that libraries are being installed. I can't see in the Distributed System Manager. I can see libraries on other machines, but not on the one that I have.

    Have you included libraries in section always included the source files.  You did, and then change the destination of the library of media files on the Source code file settings tab?

    In the code are you using the correct path when calling the libraries deployment method.   Current path of the VI should be stripped twice and have "data\name.lvlib" built in the end.

  • Using variables on localization files

    Hi all!

    I would like to know if it is possible to use variables on the HR files, so they could be replaced by a dynamic text while the application is running.

    My point is, I need to post this message on an alert:

    "Hi Carlos, the pleasure of you review", "Carlos" is the user name and of course it's different for each installation.

    Must be something like this:

    key: GREETINGS_MSG

    value: Hi %s, the pleasure to see you

    And then.

    Dialog.Alert (_res.getString (GREETINGS_MSG, "Carlos").

    So, is it possible to do this?

    Thank you!

    According to what you're asking, it's what I found.

    See if you can try this:

    http://www.BlackBerry.com/developers/docs/5.0.0api/NET/rim/device/API/i18n/MessageFormat.html

    http://Java.Sun.com/J2SE/1.3/docs/API/Java/text/MessageFormat.html

    Example:

    Object[] arguments = {     new Integer(7),     new Date(System.currentTimeMillis()),     "a disturbance in the Force" };
    
     String result = MessageFormat.format(     "At {1,time} on {1,date}, there was {2} on planet {0,number,integer}.",     arguments);
    
  • You can use variable substitution in the Calc script.

    Hi guys,.

    I want to use variable substitution in the calculation script. I v_SECSUBAREA that my substitution variable and its value would be like C12.00 or C13.00 or C12.00, C13.00.

    But it gives me error mentioned below by checking the syntax of the calculation script.

    Error: parsing formula [statement of DIFFICULTY] (line 15) 1200315 error: invalid object type

    Calculation script:

    -----------------------------

    FIX (& v_CLEARYEAR, & v_CLEARMON)

    FIX (& v_SECSUBAREA)

    DIFFICULTY ('REPGBP', 'REPEUR', 'REPUSD', 'local', @DESCENDANTS ("DIVISION"), @LIST(&v_SECDNBENTITY), @DESCENDANTS ("SubAnalysis"),

    @DESCENDANTS ("RTNROW"), @DESCENDANTS ("RTNCOL"))

    CLEARDATA "RESUB."

    ENDFIX;

    ENDFIX;

    ENDFIX;

    Variable substitution:

    ----------------------------------

    PRCCOR_ALLv_SECSUBAREAC12.00

    Calculation script does not have C12.00 as the value for the variable substitution. If I give FY15 then Script gives me a correct syntax.

    Please help me to get this resolved.

    Thank you

    Shruti

    Hello

    Assuming that you calculate in the PRC. Database COR_ALL.

    You may set the C12.00 value in quotes like "C12.00".

    Kind regards

    Philip Hulsebosch.

  • How can I use variable presentation logic SQL

    Hi Experts,

    How can I use variable SQL logical presentation. I need the exact syntax. Kindly help me to achieve this goal.

    "Time". "" Date "between the Date of 2014 '-1-17 'and Date' ' 2014-2-16

    Thanks in advance

    Asim

    It's done... We can use it in the logical query with the same syntax where we use in converting this filter as SQL...

  • How will I know use db_link on the procedure or function?

    If PROCEDURE A use YES dblink

    PROCEDURE AN ACE

    CURSOR CUR_1 IS

    SELECT * from oracle. DEPT@YES;

    BEGIN

    .....

    END;

    Is there a way to select ?


    SELECT * FROM DBA_DB_LINKS;

    The PROCEDURE has use YES DB_LINE...




    You can use the view all_dependencies to get the name of the db link. Try the following query

    SELECT REFERENCED_LINK_NAME FROM ALL_DEPENDENCIES WHERE name = 'proc_name"AND the TYPE = 'PROCEDURE '.

    (GOLD)

    SELECT * FROM ALL_DEPENDENCIES WHERE REFERENCED_LINK_NAME IS NOT NULL';

    If you want more, you can check below link

    Ask Tom & quot; addiction & quot;

  • Captivate 7 text truncated when using variables.

    I use 7 Captivate and feels truncated text when I use variables in text captions. I have a text entry area that I assigned to a variable of 'v_name' to. In a text caption, I have the following text: "$$ v_name$ $ to view the text stored in the variable.» I know there is a way to adjust the length of the variable, but I can't seem to find in this version!

    Do not type "$$var$ $" in the text of the legend, but Insert button X (near the button symbol) in the role of composition of the properties panel. In the dialog box, you will find a way to increase the length of the inserted variable.

  • SSL mutual authentication using the Oracle stored procedure

    Hello

    DB version:
    Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

    Is possible to perform mutual authentication SSL uses the Oracle stored procedure?
    I read articles and forums saying that it is not a good approach to call the Web service using the Oracle procedure (and I don't know if it's even possible authentication using procs). But I would like to know if it's possible and how.

    In other is words there a way to incorporate the client certificate information into a procedure that calls a Web service.

    I read the articles to do it in JAVA or .net. But please advice how we can achieve using Oracle procedures.

    Thank you.

    934451 wrote:

    Is possible to perform mutual authentication SSL uses the Oracle stored procedure?

    To learn more. SSL what for?

    Oracle PL/SQL only supports client standard TCP sockets. However, interface for HTTP, Oracle PL/SQL also supports HTTPS - which requires the certificates of authentication of the server to be stored in a portfolio of Oracle web and used during the transmission via HTTPS. See the code example {message identifier: = 1925297} for more details.

    I read articles and forums saying that it is not a good approach to call the Web service using the Oracle procedure (and I don't know if it's even possible authentication using procs).

    Forums and articles written by idiots. For idiots.

    And no, I'm not to embellish my response to this pitch that you met. It is false. It is written by ignorant people who don't know ANYTHING about the use of Oracle and PL/SQL. And feel free to forward my response to these idiots. They find me here if they want to argue...

    As an example of how to call a web service, see {message identifier: = 10158148} and {message: id = 10448611}.

  • Using variables to get the answers to the questions of fill-in-the-White

    Hello

    Fill-in-the-blank questions, to provide answers. I want to provide these in the form of variables (user-created), rather than in the form of fixed strings (so, as $$ var1$ $ and not as 'Rabbit'). I could not get this to work. The variable input function is available (in the properties panel), but it does not in fact (i.e. even if you select a variable to be entered, it is not actually automatically registered).

    Is there a way around the problem?

    1. NB containing the same question for text entry boxes (rather than fill-in-the-blank questions). If I could get this works for text entry boxes, I'd use questions these rather than fill-in-the-white.

    2. a peut use variables for the answers to the multiple-choice questions. So I hope I can make it work for fill-in-the-blank questions as well.

    Thank you in advance. Marvin DuBois

    That would be my suggestion. I don't have a blog, but using BER of for this kind of questions me as well. And unlike the widget/interaction, that I've mentioned before, BER is an interactive object, which means it can be validated and that there may be a score attached to it. But, it will not help you, since you have to add the correct answers in the same way as for a drop-down list in the issue of the FIB (they are the sorts of TEB). And it is this list that does not enter a variable rather than a fixed sequence of characters.

    This means that you are into stocks advanced, identical to that of my blog posts with the widget/interaction.

    Have a work around (after all I'm the work around Queen) having intercourse, if you don't check that BER, described here:

    http://blog.lilybiri.com/report-custom-questions-part-2

    The idea is to use another interactive object that can have a score. Actually, I use two instances of the same object: a score of 0 and one with score of X and show the right according to the conditional action.

    However if you want to have multiple TEB on the same blade, which must be verified with the same tip action, you will need either the mastery of InfoSemantics (only for output SWF) widget or Javascript.

    Lilybiri

  • ODI, using variables

    Hello

    We can use variables in interfaces?

    I have to use the first day of the last month

    for example, today, the variable must generate

    01.05.2012 ' 00:00 '

    is there a choice to do this?

    After that, can I use as an interface?

    Thank you

    Another option to use TRUNC to get the same result

    Select trunc (trunc(sysdate,'MM')-1, 'MM') "First day of the last month" double

Maybe you are looking for

  • Problem printer with XP updates

    I updated to XP and lost the ability to print on my HP OfficeJet Pro 8500.  Other users has solved the problem by doing a system restore.  My restore feature has been turned off, so I did not have this option.  Another way to reverse the cause someth

  • Start Up manager does not start

    I want to run my program starts, but whenever I open, it prompted me to start windows defender, which I can't start because I have already installed Microsoft Security Essential. Can anyone help on how to open the Boot Manager again? Thank you.

  • Photosmart 6510 connect to the new computer with Windows 8

    I have a photosmart 6510 e - all in one printer series.  I just bought a new computer with Windows 8.  When I tried to connect my printer, an error message came up saying that I have to upgrade to Vista or Windows 7.  He does not Windows 8.  Is there

  • Cannot open the Windows Firewall, says cannot open for reason unidentified.

    Original title: Windows Firewall problem I can not open it says cannot open Windows Firewall for unidentifies reason, someone suggessions?

  • How to reinstall creative cloud after the death of the computer

    In the month of March. My wife bought a basic package of Photoshop/creative cloud for me with a one year subscription. Order #AD003506394UK. Unfortunately, the motherboard of my computer blew a couple of days, and I had to by a new PC. I had to re -