问一个循环插入报错,如何知道小弟我错哪了
问一个循环插入报错,怎么知道我哪里错了
就这么一个语句,到insert 语句后,就会跳到exception里面去,但是我用直接写插入语句是没有错误的,请教大家,sm_info@sms是连接服务器上的表
------解决方案--------------------
- SQL code
FOR r IN (SELECT 'hello' title, mobile,'还有'||yhnumber||'个工单需要处理。' message FROM USERS, (SELECT COUNT(yhid) yhnumber,userid,wm_concat(yhid) yhid FROM yh_tips WHERE ISclosed ='0' AND emailtime <= SYSDATE GROUP BY userid) T WHERE users.Userid = t.userid AND length(mobile) = 11) LOOP insert into sm_info@sms(catlog,mobilenum,message) VALUES(r.title,r.mobile,r.message); END LOOP
就这么一个语句,到insert 语句后,就会跳到exception里面去,但是我用直接写插入语句是没有错误的,请教大家,sm_info@sms是连接服务器上的表
------解决方案--------------------