Issue: I am supposed to call and execute a PL/SQL procedure which is previously defined in DB and requires an input value. In addition, there must be a checking statement that controls the input (which will later provide by entering it at runtime) is not zero. (This is a business condition even though it is possible it is not logically needed.)
Solution:
- I have created an ODI variable with a background code, used this variable as input value of the called procedure. I mean, if the variable name is tst_var:
begin
my_schema.procedure_name(#ODI_PROJECT.tst_var);
end;
- I have created an ODI package and put these ODI variable and procedure sequentially in it. Also I have selected type of set variable for my variable. The output is as following:
This stream that I explained, works well. But as it is evident, there is no checking statement. Can anyone help me with issue that how can I add an IF-ELSE statement to control the value of variable tst_var?
Actually, if I want to put my thought down on paper, it would be:
current_Date= TO_CHAR(TO_DATE(SYSDATE - 1),'YYYYMMDD');
if #ODI_PROJECT.tst_var<> 0 then my_schema.procedure_name(#ODI_PROJECT.tst_var);
else my_schema.procedure_name(current_Date);
Now, I have no idea of implementing the equivalent of above logic in ODI.
