ITPub博客

首页 > Linux操作系统 > Linux操作系统 > oracle goldengate 调用存储过程案例

oracle goldengate 调用存储过程案例

原创 Linux操作系统 作者:paulyibinyi 时间:2011-10-25 09:54:57 0 删除 编辑

Example 1 The following example shows the use of a stored procedure that executes once to get a value
from the lookup table. The value is mapped to the target column in the COLMAP statement.


TABLE sales.cust, TARGET sales.cust_extended, &
SQLEXEC (SPNAME lookup, &
PARAMS (long_name = birth_state)), &
COLMAP (custid = custid, &
birth_state_long = lookup.long_name);

 


Example 2 The following example shows multiple executions of a stored procedure that gets values
from a lookup table. The values are mapped to target columns.


TABLE sales.cust, TARGET sales.cust_extended, &
SQLEXEC (SPNAME lookup, ID lookup1, &
PARAMS (long_name = current_residence_state)), &
SQLEXEC (SPNAME lookup, ID lookup2, &
PARAMS (long_name = birth_state)), &
COLMAP (custid = custid, &
current_residence_state_long = lookup1.long_name, &
birth_state_long = lookup2.long_name);

 
 
Example 3 The following example illustrates the use of ID . It enables each column map to
call a stored procedure named lookup separately and refer to its own results by means of
lookup1 and lookup2.
 

TABLE sales.srctab, TARGET sales.targtab, &
SQLEXEC (SPNAME lookup, ID lookup1, PARAMS (param1 = srccol)), &
COLMAP (targcol1 = lookup1.param2), &
SQLEXEC (SPNAME lookup, ID lookup2, PARAMS (param1 = srccol)), &
COLMAP, (targcol2 = lookup2.param2);
 
用ID别名来区分 可以调用包头和包体
 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7199859/viewspace-709624/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: OBEY 用法
请登录后发表评论 登录
全部评论
学习数据库

注册时间:2007-12-11

  • 博文量
    907
  • 访问量
    6894202