请教关于VARCHAR2(4000)的使用经验

[复制链接]
查看11 | 回复2 | 2005-10-30 17:05:33 | 显示全部楼层 |阅读模式
create or replace procedure pro1(v_code in varchar2)
as
v_1 varchar2(4000);
v_2 varchar2(4000);

begin
select ... into v_1,v_2from tab1@db where code=v_code;
insert into tab2
values(...,v_1,v_2...v_8);
commit;
end;
exec proc1(600069);
I get the message ORA-01478
Error: ORA 1478
Text: array bind may not include any LONG columns
-------------------------------------------------------------------------------
Cause: An attempt was made to use array bind on a column whose maximum size
is greater than 2000 bytes.
This is not permitted.
Action: Do not use array bind for a LONG column.
Use an ordinary bind instead.
If I don't use the database link @db ,it is correct.
There are not any LONG columns in tab1 and tab2.
如果不使用DBLINK就可以正确执行。
我使用动态SQL,使用SUBSTR,||等方法,改过SDU,都没有效果
请各位指点,是否有其他的方法实现远程表之间的更新
(表中有个8字段是VARCHAR2(4000),最多的包含1500左右的汉字)

回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
Are you sure you use "exec proc1(600069);" when you got the error?
According to your code, you probably should use "exec pro1('600069')"
Now tell us your both oracle versions and table structure:
desc tab1@db
desc tab2
and post your complete procedure code, then we should be able to help.
Guang
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
desc tab1@db
code number
jnsmnrvarchar2(4000)
gd varchar2(4000)
desc tab2
code number
jnsmnrvarchar2(4000)
gd varchar2(4000)
结构是一样的
ORACLE9I UNDER REDHAT7.2
create or replace procedure pro1(v_code in varchar2)
as
v_1 varchar2(4000);
v_2 varchar2(4000);
begin
select jnsmnr,gd into v_1,v_2 from tab1@db where code=v_code;
insert into tab2
values(v_code,v-1,v_2);
commit;
end;
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行