日期:2014-05-17  浏览次数:20781 次

问一个循环插入报错,怎么知道我哪里错了
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是连接服务器上的表

------解决方案--------------------
探讨

好像记得对dblink中的表内容只能读取。不能修改。