执行下面的sql, 老是报错。 但单独执行select一点问题都没有。ORA-04052: 在查找远程对象时出错
ORA-01948: 标识符的名称长度(37) 超过最大长度(30)注, tt_address_web 是个public synonymeDECLARE
cursor sel_cur is
select "uid"
from tt_address_web
where 1=1
and "deleted" = '0'
and "pid" = '503'; BEGIN
FOR sel_rec in sel_cur
LOOP
update tt_address_web set "deleted" = '1' where "uid" = sel_rec.U_ID;
commit;
END LOOP;
END;
/
ORA-01948: 标识符的名称长度(37) 超过最大长度(30)注, tt_address_web 是个public synonymeDECLARE
cursor sel_cur is
select "uid"
from tt_address_web
where 1=1
and "deleted" = '0'
and "pid" = '503'; BEGIN
FOR sel_rec in sel_cur
LOOP
update tt_address_web set "deleted" = '1' where "uid" = sel_rec.U_ID;
commit;
END LOOP;
END;
/
cursor sel_cur is
select uid
from tt_address_web
where 1=1
and deleted = '0'
and pid = '503'; BEGIN
FOR sel_rec in sel_cur
LOOP
update tt_address_web set deleted = '1' where uid = sel_rec.U_ID;
commit;
END LOOP;
END;
cursor sel_cur is
select uid
from tt_address_web
where 1=1
and deleted = '0'
and pid = '503'; BEGIN
FOR sel_rec in sel_cur
LOOP
execute immediate 'update tt_address_web set deleted=''1'' where uid='||sel_rec.U_ID;
commit;
END LOOP;
END;
这样试一下,貌似块里面要使用动态的sql。
Text: error occurred when looking up remote object %s%s%s%s%s
-------------------------------------------------------------------------------
Cause: An error has occurred when trying to look up a remote object.
Action: Fix the error. Make sure the remote database system has run
KGLR.SQL to create necessary views used for querying/looking up
objects stored in the database.*** Important: The notes below are for experienced users - See Note:22080.1
Note:
KGLR.SQL is now called catrpc.sql - it is run from catproc
运行这个catrpc.sql 脚本试试。在$ORACLE_HOME/rdbms/admin下
where uid=1 如果不报错自然就是这里的问题。