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

ORA-06502: PL/SQL: 数字或值错误 原始变量长度过长如何解决?
PLSQL代码如下:报错信息见标题,各位朋友能否给个建议如何解决?
因为代码长度过长。简略介绍一下
declare 
  BinBuf Blob; 
  Buffs dbms_sql.varchar2s; 
 begin 
  Buffs(0) := ('''18A039050000020000000C000000D7CAB2FABBE3D7DCB2E9D1AF000000003000000017100000005F85F42854D0C44C8DC6CA7F814432961883FFFFFF00C0C0C00080808000010000000CA0DEE7BA39E340000000000000000018720101000039A5F0000A000000BFA8C6ACBFE2B2E9D1AF17010000000117020''');
  Buffs(1) := .....
  ....
  Buffs(140):=...
BinBuf := UTL_RAW.CAST_TO_RAW(Buffs(0)||Buffs(1)||Buffs(2)||Buffs(3)||Buffs(4)||Buffs(5)||Buffs(6)||Buffs(7)||Buffs(8)||Buffs(9)||Buffs(10)||Buffs(11)||Buffs(12)||Buffs(13)||Buffs(14)||Buffs(15)||Buffs(16)||Buffs(17)||Buffs(18)||Buffs(19)||Buffs(20)||Buffs(21)||Buffs(22)||Buffs(23)||Buffs(24)||Buffs(25)||Buffs(26)||Buffs(27)||Buffs(28)||Buffs(29)||Buffs(30)||Buffs(31)||Buffs(32)||Buffs(33)||Buffs(34)||Buffs(35)||Buffs(36)||Buffs(37)||Buffs(38)||Buffs(39)||Buffs(40)||Buffs(41)||Buffs(42)||Buffs(43)||Buffs(44)||Buffs(45)||Buffs(46)||Buffs(47)||Buffs(48)||Buffs(49)||Buffs(50)||Buffs(51)||Buffs(52)||Buffs(53)||Buffs(54)||Buffs(55)||Buffs(56)||Buffs(57)||Buffs(58)||Buffs(59)||Buffs(60)||Buffs(61)||Buffs(62)||Buffs(63)||Buffs(64)||Buffs(65)||Buffs(66)||Buffs(67)||Buffs(68)||Buffs(69)||Buffs(70)||Buffs(71)||Buffs(72)||Buffs(73)||Buffs(74)||Buffs(75)||Buffs(76)||Buffs(77)||Buffs(78)||Buffs(79)||Buffs(80)||Buffs(81)||Buffs(82)||Buffs(83)||Buffs(84)||Buffs(85)||Buffs(86)||Buffs(87)||Buffs(88)||Buffs(89)||Buffs(90)||Buffs(91)||Buffs(92)||Buffs(93)||Buffs(94)||Buffs(95)||Buffs(96)||Buffs(97)||Buffs(98)||Buffs(99)||Buffs(100)||Buffs(101)||Buffs(102)||Buffs(103)||Buffs(104)||Buffs(105)||Buffs(106)||Buffs(107)||Buffs(108)||Buffs(109)||Buffs(110)||Buffs(111)||Buffs(112)||Buffs(113)||Buffs(114)||Buffs(115)||Buffs(116)||Buffs(117)||Buffs(118)||Buffs(119)||Buffs(120)||Buffs(121)||Buffs(122)||Buffs(123)||Buffs(124)||Buffs(125)||Buffs(126)||Buffs(127)||Buffs(128)||Buffs(129)||Buffs(130)||Buffs(131)||Buffs(132)||Buffs(133)||Buffs(134)||Buffs(135)||Buffs(136)||Buffs(137)||Buffs(138)||Buffs(139)||Buffs(140));
 Update B Set AA=BinBuf ;
 END;
共140个数组,每个数组里面有244个字符。
 


------解决方案--------------------
建立一个数组表
把每个 Buffs(0), Buffs(1)存到表里,再在你的SQL语句里去取,这样代码长度就不长了