1.shell脚本例子
#!/bin/bash
2.存储过程模板
delimiter $$
CREATE PROCEDURE 过程名(in v_date varchar(8),out v_result varchar(10),out v_info varchar(500))
BEGIN
变量列表1
变量列表2
变量列表3
declare continue handler for sqlexception
bgein
get diagnostics condition 1
v_info=mesage_text;
end
call p_insert_log(v_date,v_proname,v_sysname);
set 1 into v_rows form table_name where condition;
if nvl(v_rows,0)=1 then
程序体
call p_update_log(v_date,v_proname,v_sysname,v_time,v_rows,’结束’||nvl(v_info,’’));
else
call p_update_log(v_date,v_proname,v_sysname,v_time,v_rows,’数据不具备’));
end
$$
delimiter ;