通过PL/SQl过程调用odi Mappig [英] Call odi Mappig through PL/SQl Procedure
问题描述
在此处输入图像描述我在下面提到了一个匿名块,我想用odicenscenn代替execute立即执行语句.
enter image description hereI have an anonymous block mentione below , i want to replace the execute immediate statement with the odi scenarion .
使用odi过程完成该操作的任何方法.如果我可以使用任何odi api或odi utilities命令替换它.
Any way of doing it with odi procedure. If i can use any odi api or odi utilities command to replace it.
即:
OdiStartScen"-SCEN_NAME = LD_T_RD_ACCOUNT_POC""-SCEN_VERSION = 001" "-CONTEXT = GLOBAL""-LOG_LEVEL = 6""-AGENT_CODE = OracleDIAgent1" "-SYNC_MODE = 1";
OdiStartScen "-SCEN_NAME=LD_T_RD_ACCOUNT_POC" "-SCEN_VERSION=001" "-CONTEXT=GLOBAL" "-LOG_LEVEL=6" "-AGENT_CODE=OracleDIAgent1" "-SYNC_MODE=1";
DECLARE
VAR VARCHAR2(2000);
VAR2 DATE;
BEGIN
BEGIN
Select XYZ INTO VAR
From DUMMY
Where ID= 2; end;
BEGIN
l_exec_sql:= 'INSERT INTO DUMMY VALUES('1')';
IF VAR LIKE 'XY%' THEN
execute immediate(l_exec_sql); --Replace it with odi scenario
ELSE
IF FUNCTION_F(VAR) THEN
execute immediate(l_exec_sql); --Replace it with odi scenario
END IF;
END IF;
END;
推荐答案
关于匿名块,您应该这样重写它:
Regarding your anonymous block, you should rewrite it like this:
- 创建一个新的ODI程序包;
- 在var中创建一个名为VAR(或您喜欢的方式)的新变量,将所需的内容与适当的逻辑模式配对;
- 打开新创建的ODI包,拖放变量并选择刷新变量类型"(见下图);
- 在拖放变量之后,再次选择它并拖放,这一次选择类型Evaluate变量,并编写您的第一个条件(请参见下图);
- 然后拖放所需的ODI场景;
您可以使用odi包变量以更多方式播放".例如,您可以创建一个变量,如果第一个条件满足,则返回YES,如果第二个条件满足,则返回NO.您的变量将执行一条sql语句并返回一个值(仅一行,一列),然后您将对其求值并选择要执行的方案.
You can "play" in many more ways with the odi package variables. For example, you can create a variable that will return YES if the first condition is meet and NO if second one is meet. Your variable will execute an sql statement and will return a value (only one row, one column) and then you will evaluate it and choose what scenario to execute.
希望它有用
您可以从ODI Procedure中调用ODI方案,但是对于应调用该方案的任务,技术应为ODI工具.
You can call an ODI Scenario from ODI Procedure, but the techonology should be ODI Tools, for the task that will call the scenario.
对于您的示例,您可以这样做: *在您的plsql块中,您有-用odi场景替换",放置此替换变量:" ;在第二个变量评估上,放置" 等; *在相同的过程中,执行另一个任务并编写如下内容:
For your example you can do like this: * inside your plsql block, where you have "--Replace it with odi scenario", place this substitution variables : ""; on the second variable evaluate, place "" etc; * in the same procedure, make another task and write something like this:
<$
if (var.equals("call secenario 1") {
$>
OdiStartScen "-SCEN_NAME=NAMEOFSCENARIO" "-SCEN_VERSION=001"
<$
}
$>
此新任务应具有技术:ODI工具.
This new task should have Techonology: ODI Tools.
您不能在与运行plsql过程相同的任务中调用场景,因为PLSQL过程将需要Technology Oracle,而调用场景将需要ODI工具.
要查看运算符中的值,请转到ODI程序,然后为每个任务检查下一个选项.保存重新生成方案(如果有方案):
To see the value in operator, go to your ODI Procedure, and please check the next option for each of your task. Save an regenerate the scenario (if you have a scenario):
在哪里可以看到操作员中的代码: 双击会话>选择要查看的任务>展开它>双击>代码
Where to see the code in Operator: Double click the session > choose the task you want to see> expand it> double click > Code
这篇关于通过PL/SQl过程调用odi Mappig的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!