Capture bulk fetch error

todayandtomorrow todayandtomorrow 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
小弟最近遇到一个问题,如下描述:

有两个表,一个是数据表 start_tbl(有几千行数据),一个是最终表final_tbl(可能有数据)。
现在想把start_tbl表中得数据插入到final_tbl表中。但是start_tbl和final_tbl结构有一定得差距,比如start_tbl中列得大小比final_tbl中得大。假设start_tbl表中有id和name两列。

我采用得方法是:

produre SW_IN_FINAL
is
type t_id is table of final_tbl.id&type index by binary_integer;
v_id t_id;
type t_name is table of final_tbl.id&type index by binary_integer;
v_name v_name;
type T_SEL_CUR is ref cursor;
CUR_GET_RECORDS T_SEL_CUR;

v_sql long;
begin

v_sql = 'select id, name from start_tbl';

open CUR_GET_RECORDS for v_sql;

fetch CUR_GET_RECORDS bulk collect into
v_id,
v_name
limit 100;
。。。。。。
(以下省略插入语句)
end SW_IN_FINAL;

问题是在fetch数据进v_id和v_name得时候可能产生错误,如何获取这种错误,并让程序继续进行而不因错误而终止。
...全文

相关推荐

评论 5
收藏 已收藏
分享
返回顶部
todayandtomorrow
Oracle 17,133 成员 55,258 内容