注册

南大通用数据库的存储过程和触发器迁移到DM数据库

海阔天空 2023/07/21 944 0

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:7
【操作系统】:湖南麒麟Linux
【CPU】:x86
【问题描述】*:南大数据库存储过程和触发器迁移到DM数据库:
以下是南大通用数据库的存储过程:
create procedure gdidict:insert_1557_pro()
referencing new as new old as old for scm_calcdb_online:flow_sum_conf
begin
define r_v_longid decimal ( 20,0 );
define v_station_key decimal ( 20,0 );
define v_station_name varchar ( 32);
define v_flowmeter_name VARCHAR ( 32 );
define v_in_fqa decimal ( 20,0 );
define v_in_fqpd decimal ( 20,0 );
define v_in_fqcd decimal ( 20,0 );
define v_in_fq bigint;
define r_o_phno bigint;

call GDIDICT:scm_create_longid ( 'calcdb', 'flow_sum_conf', 'online', 1557, NULL, 0, new.ph_no ) returning r_v_longid,r_o_phno;
let new.key = r_v_longid;
let new.ph_no = r_o_phno;

   select oo_st, descr, in_fqa,in_fqpd, in_fqcd, in_fq INTO 
         v_station_key, v_flowmeter_name, v_in_fqa, v_in_fqpd, v_in_fqcd, v_in_fq 
         from scm_psdb_online.meteragesystem WHERE key = new.flowmeter_key;

   let new.station_key = v_station_key;
   let new.flowmeter_name = v_flowmeter_name;
   let new.in_fqa = v_in_fqa;
   let new.in_fqpd = v_in_fqpd;
   let new.in_fqcd = v_in_fqcd;
   let new.in_fq = v_in_fq;
   
   select descr into v_station_name from scm_psdb_online.st WHERE key = v_station_key;
   
   let new.station_name = v_station_name;

end
end procedure;

以下是南大通用数据库的触发器:

create trigger insert_1557
insert on flow_sum_conf
for each row
(
execute procedure gdidict:"gbasedbt".insert_1557_pro() with trigger references );

请问怎么迁移到达梦数据库呢?

回答 0
暂无回答
扫一扫
联系客服