Procedure of the ODI - Bind Variables in the conditional statements

In an ODI procedure, is it possible to add a conditional statement around bind variable?  For example, if I use OdiOutFile as the command on the target and Oracle as the command on the Source, I can use bind variables to fill the data in this table (we are in fact using OdiInvokeWebService and passing a XML structure very complex, but it's easier for testing):

OdiOutFile-FILE = C: / TEST. TXT

< person >

< first > #FIRSTNAME < / first >

< Middle > #MIDDLENAME < / Middle >

< last > #LASTNAME < / last >

< / person >

It is a way to add a conditional statement using one of these bind variables?  For example, if I wanted to test #MIDDLENAME null and null value, produced this portion of XML, such as:

OdiOutFile-FILE = C: / TEST. TXT

< person >

< first > #FIRSTNAME < / first >

< % if (#MIDDLENAME! = null) {% >}

< Middle > #MIDDLENAME < / Middle >

< %} % >

< last > #LASTNAME < / last >

< / person >

This type of scriptlet syntax seems to work fine, as long as the binding variable is not in the mix (if I put "true is true" or "true == false" in the case, it shows or does not show this line in the XML file, as expected).  I use ODI 11.1.1.7.0

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

Post edited by: KevinPratt

Thanks for the reply!  As suggested, in what follows, I changed the command and it works as you want

OdiOutFile-FILE = C: / TEST. TXT-APPEND

< person >

< first > #FIRSTNAME < / first >

< @ if (!) (("#MIDDLENAME".equals(""))) {@ >}

< Middle > #MIDDLENAME < / Middle >

{< @} @ >

< last > #LASTNAME < / last >

< / person >

Using the syntax <@ ...="" @="">serve your purpose. Also, I think you might want to include the variable binding in the quotation to avoid syntax errors.

Tags: Business Intelligence

Similar Questions

  • Procedure with the DML statements that insert values from 1 to 100 in only one table and it is matching word equivalent in the other

    Can someone help me create a procedure with the DML statements that insert values from 1 to 100 in a table "abc" and the procedure must connect the numbers into words in another table "xyz" without doing a commit explicitly. "."

    Currently on trial...

    SQL > create table abc (num number);

    Table created.

    SQL > create table xyz (num varchar2 (100));

    Table created.

    SQL > ed
    A written file afiedt.buf

    1. insert all
    2 values of 1 = 1 then in abc (num) (l)
    3 when the values of 1 = 1 then in xyz (num) (to_char (to_date(l,'j'), 'jsp'))
    4 * Select the level from dual connect by level<=>
    SQL > /.

    200 rows created.

    And the result...

    SQL > select * from abc;

    NUM
    ----------
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    ..
    ..
    ..
    98
    99
    100

    100 selected lines.

    SQL > select * from xyz;

    NUM
    ----------------------------------------------------------------------------------------------------
    one
    two
    three
    four
    five
    six
    seven
    eight
    nine
    ten
    Eleven
    twelve
    ..
    ..
    ..
    98
    Nineteen eighty
    Cent

    100 selected lines.

  • CALL THE PROCEDURE IN THE SQL STATEMENT

    Why we cannot call a procedure inside the SQL statement?

    Hello

    Usually when you select an item should return you data. In the case of a procedure, you cannot return any return value from the procedure directly it has to be done through some settings and to access these settings, you cannot use a simple sql statement. Where as in a function, you must return one of data that can be easily obtained accordingly.

    see you soon

    VT

  • Why I can't use the procedure in the select statement

    Why I can't use the procedure in the select statement

    And you may not usa a SQL function if it has out parameters

    SQL> create function myfun(p1 in out number) return number is
      2  begin
      3  p1:=1;
      4  return 2;
      5  end;
      6  /
    
    SQL> select myfun(5) from dual;
    select myfun(5) from dual
           *
    ERRORE alla riga 1:
    ORA-06572: Function MYFUN has out arguments
    

    In fact, the problem is that an output parameter is passed 'ref' and not 'val '...

    Max

  • Can we call a procedure in the select statement?

    Can we call a procedure in the select statement?

    Hello

    Raghu_appsdba wrote:
    Can we call a procedure in the select statement?

    # You can call functions, but not procedures.

    If the procedure does not change the State of the database (for example, it isn't updated all tables), then you can wrap it in a function, or re - write function.

    Here is an example of wrapping.

    CREATE OR REPLACE FUNCTION fun_x (in_txt IN VARCHAR2)
    RETURN  VARCHAR2
    IS
    BEGIN
            proc_y (in_txt);
            RETURN  in_txt
    END     fun_x;
    
  • Using Bind Variable in a SELECT statement

    Hello

    I am trying to build my SQL query running using bind variables and in Oracle® Fusion Middleware Fusion developer Guide for Oracle Application Development Framework 11 g Release 1 (11.1.1) it is said that ' after you define bind variables, the next step is to reference them in the SQL statement. While SQL syntax allows you to bind variables to appear in the SELECT list and in the WHERE clause, you'll generally use them in this context, as part of your WHERE clause. ».

    However, when I try to use bind variables in my SELECT list because I had set a type to the string of the variable variable is inserted with quotes each side for example SELECT TestTable FROM 'Service '. Is it possible to use bind variables to insert a value in my list of selection without the quotes around it?

    Thanks in advance,
    Tom

    Hi Robinst,

    I think you want to set up column name of the table that is not possible using bind variables. With the help of the bind variables you can send a value to the SQL. The String value is therefore always with inverted commas.

    Kind regards

    Branislav

  • spend the conditional statements

    Hello everyone I've been working on a duty where we created a game of the match.  It is for me to find a way to tell the script action what difficulties the game of the user of the game to.  There are 3 easy buttons, mediym, hard.  Each sets out an increased number of cards say 4 to 8 easy for way etc.

    We are supposed to use the conditional switch to do this.  My problem is how do you know what button was clicked the switch?

    Here's the code so far, he is only set up for the easy right now.  It works fine until I tried to set up the switch.

    Thanks for any help you might be able to give.

    package {}

    import flash.display.MovieClip;

    import flash.display.Sprite;

    import flash.events. *;

    import flash.text.TextField;

    import flash.utils.Timer;

    import flash.utils.getTimer;

    import flash.media.Sound;

    SerializableAttribute public class Match extends MovieClip {}

    var showingCard:Card = null;

    const DELAY_TIME = 1000;

    public void Match() {}

    trace ("Match");

    introscreen.btnMenu.btnEasy.addEventListener

    addChild (introScreen);

    If a card is displayed showingCard refers to it

    card otherwise

    introScreen.btnMenu.btnEasy.addEventListener (MouseEvent.CLICK, onClickButton);

    } / / end of the constructor

    function onClickButton(e:MouseEvent):void {}

    trace ("onClickButton");

    {Switch (e.Target.Level)}

    'easy ': case study

    layoutCards (2);

    break;

    }

    }

    //

    function layoutCards(gridSize:int):void {}

    trace ("layoutCards");

    put gameScreenOnTop

    addChild (gameScreen);

    creat bridge of the faceValues valid

    var Bridge: Array = [];

    var lastFrame:int = gridSize * gridSize / 2 + 1;

    for (var k: int = 2; k < = lastFrame; k ++) {}

    Deck.push (k, k);

    }

    trace (Deck);

    layout maps

    for (var i: int = 0; i < gridSize; i ++) {}

    for (var j: int = 0; j < gridSize; j ++) {}

    trace (i, j);

    Map: map of var = new Card();

    size

    Card.Width = stage.stageWidth/gridSize;

    Card.Height = stage.stageHeight/gridSize;

    location

    Card.x = i * card.width;

    Card.y = j * card.height;

    important assign a face value, drawn randomly from the deck

    card.faceValue = randomInteger (2.19).

    card.faceValue = deck.splice (randomInteger (0, deck.length - 1), 1);

    Listening

    card.addEventListener (MouseEvent.CLICK, onClickCard);

    Add

    card.gotoAndStop (1)

    gameScreen.addChild (card);

    } //j

    } //i

    } / / end of method of positioning cards

    makecard start clickable

    function onClickCard (e:MouseEvent) {}

    trace ("onClickCard");

    var clickedCard:Card = (e.target) Card;

    Turn the card clicked

    clickedCard.visible = false;

    Click on the first map in pair

    3 cases

    1 card clicked is the first in the bet

    See the map and remomber it

    make it not clickable at the moment

    If (showingCard == null) {}

    trace ("FirstCard")

    clickedCard.gotoAndStop (clickedCard.faceValue); external

    showingCard = clickedCard; internal

    clickedCard.removeEventListener (MouseEvent.CLICK, onClickCard);

    }

    2A - click map is a second pair, and friendly the FirstMatch

    both take-out

    Else if (clickedCard.faceValue == showingCard.faceValue) {}

    trace ("match")

    gameScreen.removeChild (clickedCard);

    gameScreen.removeChild (showingCard);

    showingCard = null;

    }

    2B - clickedCard is second and not a match for the first.

    Return both

    else {}

    clickedCard.gotoAndStop (clickedCard.faceValue);

    freeX during a short period of time

    addChild (blockScreen);

    var: timer = new Timer(DELAY_TIME,1);

    timer.addEventListener (TimerEvent.TIMER,

    function onTimer(e:Event) {function //annonymus

    delay this code

    clickedCard.gotoAndStop (1);

    showingCard.gotoAndStop (1);

    clickable map list

    showingCard.addEventListener (MouseEvent.CLICK, onClickCard);

    showingCard = null;

    addChild (gameScreen);

    }

    );

    Timer.Start ();

    }

    }

    } / / Match class

    } / / packages

    When I click on the easy button in the swf file I get this message.

    ReferenceError: Error #1069: property not found on flash.display.SimpleButton level and there is no default value.

    to Match / onClickButton)

    The switch statement checks the 'e.target.level' to see which option has been selected, the part level of this being the word "Easy" or anything else.  e.Target points to the object that sent the event, which seems to be a SimpleButton object.  But a SimpleButton object cannot have the properties created for her as a movieclip can, in order to verify his 'level' property is looking for something that is not normally.

    Where assign you the level of ownership, of what object it give you?

    (hindsight: don't want to jump on the reaction of Dave.)  This meets an ask me if... I always check before submitting a message to see if someone answered while I was devise a response and normally go back on the forum to check... If if I don't post unless there is a marked difference is answers this time I just went back one level and not seen no response, so I thought that none received... it looks like going back to the forum is the right path to follow)

  • Start or stop the conditional statement

    I have an animation that plays from the beginning to the end. I would like to add a conditional statement that

    IF the animation is to play and click the ANIMATION BUTTON, it stops and goes back to the framework.

    OTHERWISE (if the animation is on frame one (did not play) it starts to play the end.)

    My script goes like this-

    animation_btn.addEventListener (MouseEvent.CLICK, startplaying);

    function startplaying (event: MouseEvent); {} void

    Play();

    Animation.Play ();

    }

    the animation is the name of the animation time line.

    Your help is very appreciated.

    assuming that the movieclip you wish to order is the animation:

    animation_btn.addEventListener (MouseEvent.CLICK, startplaying);

    function startplaying (event: MouseEvent); {} void

    {if(animation.currentFrame==1)}

    Animation.Play ();

    } else {}

    animation.gotoAndStop (1);

    }

    }

  • Procedures with the return statement

    Hi all

    I know that you can include a return statement in the procedure, but without value, but I can't imagine how it works,

    could you give me an example and demonstrate the problem for me

    Thanks in advance

    Any reason you not try?  There is no need to imagine anything, since you can always download Oracle on your local machine and try it.

    CREATE PROCEDURE dont_do_this
    AS
    BEGIN
    RETURN;
    
      dbms_output.put_line( 'This line will never be reached' );
    END;
    

    Justin

  • How to use the return value of TestComplete (using COM) as a variable in the conditional statement (for example loops) TestStand

    Hello

    I have setup a COM interface for TestStand (TS) to run some scripts in TestComplete (TC).  Normally, when TestComplete has finished executing the script, it returns a 0 or 1 to designate the success/failure during the TestStand step (step test for example String value).  It worked well.

    However, now I need TestComplete to regain a vaule (e.g. 32) TS and TS need to assess this value in a while statement. So if the TC value is 32, I would have some statement in TS ike:

    While (return value! = 30)

    Do something...

    Thank you

    Jigg,

    No, the program does not have a new thread.  It's just a single sequential thread. She called other sequential files, and that's all.

    I think I'll have some luck with the StationGlobal.  It seems to work (for example by setting the StationGlobal a single sequence file automatically updates the Stationglobal in another movie file, sort of like passing the reference value)

    Thank you!

  • Formatting check box for the conditional statements in Adobe Acrobat format, form editor

    I'm looking for the format I should use boxes in Adobe Acrobat Pro XI, forms, Java Script Editor.  I am very familiar with this, as well as the use of the IF / AND statements.  I'm NOT using LiveCycle.

    Algorithm:

    -If either CB1 or CB2 are checked, then empty, equal

    -Si CB2 is checked then equal "N/a".

    D ' other...

    I don't know how I should be charged the formula.  I was also curious, I noticed in the properties of the box that the value of exports could be retained.  I've seen different variables, including here, Yes, 0, 1, True, etc.  Will there be an impact on the code?

    var v1 = + this.getField ("Check Box1") .value;
    var v2 = + this.getField ("Check Box2") .value;

    If ((v1 == "") & (v2 == "")) event.value = "";

    ElseIf (v2! == 'Off') event.value = "n/a";

    else event.value = ("... ») ;

    Any help is greatly appreciated.

    -Yes, of course. If you change the value of the export of the boxes - and then you have to adjust your code accordingly to take into account.

    -The value of a checkbox that is unchecked is always "Off".

    -When you add the symbol '+' before this.getField("XXX").value you want to convert it to a number. That doesn't look like a good idea in your case, then you should drop.

    -L' Boolean AND operator in JS is &, not &.

  • Help: Form sum from the ranks (of the conditional statements)

    I hope someone more advanced that I am.

    I have a form with a table requesting entry for travel expenses.  Rows contain for receipt number (auto-remplit with a whole number), Date, name of the vendor, Type of expense (drop-down filled beforehand with a variable), payment Type (drop-down filled beforehand with a variable), costs cost (user imput data to integer), Exchange Office (drop-down filled beforehand with a variable), Conversion rate, the cost of expenses in U.S. dollars (calculated total cost of spending * currency).

    The table has a row of data called 'Élément', and there is a button to add a row to the table.

    Table auto are the cost of the expenditure in USD field so there is total on the table.

    On the previous page (summary page), there is another table.  This table summarizes the fees information based on the Type of expenditure and the payment Type.

    Currently I have the following formula to calculate the amount under certain conditions fees according to the table below, based on the response to the Type of expenditure and the payment Type.  This example is meant to summarize all of the expenses that are "51807 - dues/contributions" and whose payment type is NOT equal "BMC-credit card."

    Form1. #subform [1]. Table1.Row1.Expense_51087::calculate - (JavaScript, client)
    var sum = 0;
    aLines var = form1.resolveNode ("#subform [3].") General_Expense.item [*] ");"
    for (var i = 0; i < aLines.length; i ++)
    {
    If (. expense_type.rawValue aLines.item [i] == "51807 - dues/contributions")
    & & aLines.item [i].payment_type.rawValue! = 'BMC-credit card')
    sum += aLines.item [i].total.rawValue;
    }

    sum;


    However, it does not add the values.  It doesn't do anything.

    Any suggestions?  I'll change the formcalc is someone has the solution.  I have a formcalc formula works, but it doesn't have the sum of several lines, only the first entry.

    Here is the sketch of the shape:

    http://www.Brynmawr.edu/Provost/documents/Travel_Form.PDF

    This is a modified version of your form. ... with a few suggestions:

    1. you should always call your subforms. I changed your subforms without title to page1, Page2... This makes things easier to follow when error messages are generated.

    2. I did 1 calculation in the table on page 2. By placing it on the Calc event dependence is established between this field and a field named in the Calc. So when one of these fields is changed, the script is run.

    3. I use has to loop through each row in the table on Page 3 and if the coonditions are met, we update the value on Page2.

    The syntax to get each item in the line is illustrated in the calc (using an expression xfa.resolveNode ("string") is the only way to get these values).

    Hope that helps

    BTW - nice shape looking

    Paul

  • Where the conditional statement

    Hello

    I'm trying to reuse this page so that it can be used by different areas of my request. Currently, it displays all tables in a particular schema. I would like to reuse so that it could be used by another page that displays only the tables of a particular schema with a particular value set to 'Y' or 'n'. I have tried using if / case identified in SQL and PL/SQL, but none work. My PL/SQL statement gives the error:

    Query cannot be parsed, please check the syntax of your query. (ORA-06550: line 1, column 9: PLS-00103: encountered the symbol "" when expecting one of the following: begin function package pragma procedure subtype type use form current cursor symbol "" has been omitted.) Ora-06550: line 2, column 18: PLS-00103: encountered the symbol "" when expecting one of the following: begin function package pragma procedure subtype type use form current)
    -----
    The code is:
    declare 
    q varchar2(4000);
    
    begin 
    q:= 'select UNIQUE_ROWID, 
    OET_TBL_NM,
    OEP_ACTIVE_IN
    from #OWNER#.VIEW_EDIT_DB
    where oeu_id = :P21_DB and OET_TBL_OWN_NM = :P21_SCHEMA ';
    if :P21_Repl != null then
    q:=q|| ' and OEP_ACTIVE_IN = :P21_Repl ';
    end if;
    q:=q|| ' group by OET_TBL_NM, oeu_id, OET_TBL_OWN_NM, OEP_ACTIVE_IN, UNIQUE_ROWID
    order by OET_TBL_NM, OEP_ACTIVE_IN ';
    The key is the: P21_Repl comparison, which is where I try to reuse this page (: P21_Repl would take a 'Y' or the value "n" of a page or be null on the other). Is that what the problem/solution any idea? Thanks for any help.

    Mike

    Published by: Gerd June 22, 2009 00:34

    Hello

    What about

    SELECT "UNIQUE_ROWID"
         , "OET_TBL_NM"
         , "OEP_ACTIVE_IN"
    FROM "#OWNER#"."VIEW_EDIT_DB"
    WHERE     oeu_id = :p21_db
          AND oet_tbl_own_nm = :p21_schema
          AND NVL( :p21_repl, 'X' ) = DECODE( :p21_repl, NULL, 'X', oep_active_in )
    GROUP BY oet_tbl_nm
           , oeu_id
           , oet_tbl_own_nm
           , oep_active_in
           , unique_rowid
    ORDER BY oet_tbl_nm
           , oep_active_in
    

    See you soon

    Ben
    http://www.munkyben.WordPress.com
    Don't forget to mark the answers useful or correct ;)

  • You can use * in the conditional statements?

    Hey all,.

    Simple scenario.

    We have VM that somewhere in their name, have "TR" to designate them as a training machine.

    I have a script that is already evident the cmdlet Get - VM VM, but I was asked recently to adapt it to catch the TR VM and make a special note in a newspaper.

    I thought it would be simple, but my logic appears not to work, looking for feedback

    Get-VM | 
        %{ 
            if ($_.Vm.Name -eq '*tr*')
            {
    <ommitted>
    

    But for some reason any he does not pick up all the virtual computer out of the entire list with "TR" in them.

    Thanks in advance!

    Sincere greetings,

    ALAN

    You can use the - as

    if ($_.Vm.Name -like '*tr*')
    

    or - the match parameter

    if ($_.Vm.Name -match 'tr')
    
  • Need help with the conditional statement.

    I have a conditional configuration to check the 6 values, and I don't know how to put in place.  I know that the way I have it Setup is wrong, but I'm stuck here after several attempts of other variants.

    LINE OF CODE IN QUESTION:

    If (eventObject.info.name! = "marker2" |) "marker4" | "marker5" | "marker6" | "marker7" | "marker8")

    FULL CODE BLOCK:

    var listenerObject:Object = new Object();
    listenerObject.cuePoint = {function(eventObject:Object):Void}
    If (eventObject.info.name! = "marker2" |) "marker4" | "marker5" | "marker6" | "marker7" | {"marker8")}
    var listenerObject:Object = new Object();
    listenerObject.stateChange = {function(eventObject:Object):Void}
    trace (_root.theVideo.State);
    If {(_root.theVideo.paused)
    mclContinue._visible = true;
    var myTween:TweenLite = new TweenLite (mclContinue,.35, {_alpha:100, ease:Back.easeOut, onComplete:contBtn});})
    } else {}
    var myTween:TweenLite = new TweenLite (mclContinue,.35, {_alpha:0, ease:Back.easeOut, onComplete:contBtn});})
    }
    }
    _root.theVideo.addEventListener ("stateChange", listenerObject)
    }
    }
    _root.theVideo.addEventListener ("cuePoint", listenerObject)


    Thank you.

    You are welcome.

Maybe you are looking for

  • Cannot install Adobe flash on FF, but could and use it on explore.

    I installed Adobe flash through Explorer and can play games on FB. I prefer to use Firefox, but when I try to play games it says I need to install Adobe Flash player. So, no I unhooked the flashplayer and tried to install via FF. He moved to Midway a

  • A restore XP CD can be used on another model?

    Hello I have a Toshiba Satellite A300 with Vista computer. I'm tired of Vista and XP instead. So here's my question: a friend of my having a restore XP to its L300 CD (I think), can use this on my A300?The two bought last year. Thanks :)

  • my macbook gives me an electric shock while I load it

    my macbook gives me an electric shock while I load it even when I use the plug 3 charger to Earth.

  • How remove the name of the printer on Wi - Fi?

    I have a laserjet M175 which I connected to my home Wi - Fi.  When I scan for local area networks with my phone (for example), I can see the printer as a wireless access point and it is not secure, it is open.  to work through the configuration of th

  • Help with the NOR-DAQ example Code

    Hello. I just started to work with the NI IBS-6211. It's the first ADC I have ever used, so I'm farily to this news. I have some programming knowledge. After a search in the installation files, I found some examples of C Code that runs in the command