PL/SQL 游标 报错 ORA-06502: PL/SQL: numeric or value error

walkman154 2014-01-06 04:48:11
每天需要跑一个存过,备份一个表。但是经常跑失败,报错
报错信息为:ORA-06502: PL/SQL: numeric or value error。
在测试环境调试的时候打开游标也老是报这个错。

其中表中的一个字段是long字段,里面存的是一大串XML报文。
结构为以下。

c_send_packet LONG
=========里面存的内容为=========
<?xml version="1.0" encoding="GBK"?>
<PACKET type="RESPONSE">
<HEAD>
。。。。。。。。。。。。。。。。
</HEAD>
<BODY>
。。。。。。。。
</packet>

=========存过的内容为=============
for p in (select *
from t_table
where t_tm < add_months(sysdate,-1))loop

insert into table (content)values(p.content);
commit;



end loop;
...全文
484 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
walkman154 2014-01-08
  • 打赏
  • 举报
回复
继续求解继续求解
westqueen 2014-01-07
  • 打赏
  • 举报
回复
我也遇到这个问题,楼主有办法了吗?
大话EPM 2014-01-06
  • 打赏
  • 举报
回复
没看你内容,表字段不要用long字段,用clob有什么不好呢 long只是用来后兼容的,问题一大堆 ref: The use of LONG values is subject to these restrictions: A table can contain only one LONG column. You cannot create an object type with a LONG attribute. LONG columns cannot appear in WHERE clauses or in integrity constraints (except that they can appear in NULL and NOT NULL constraints). LONG columns cannot be indexed. LONG data cannot be specified in regular expressions. A stored function cannot return a LONG value. You can declare a variable or argument of a PL/SQL program unit using the LONG data type. However, you cannot then call the program unit from SQL. Within a single SQL statement, all LONG columns, updated tables, and locked tables must be located on the same database. LONG and LONG RAW columns cannot be used in distributed SQL statements and cannot be replicated. If a table has both LONG and LOB columns, then you cannot bind more than 4000 bytes of data to both the LONG and LOB columns in the same SQL statement. However, you can bind more than 4000 bytes of data to either the LONG or the LOB column. In addition, LONG columns cannot appear in these parts of SQL statements: GROUP BY clauses, ORDER BY clauses, or CONNECT BY clauses or with the DISTINCT operator in SELECT statements The UNIQUE operator of a SELECT statement The column list of a CREATE CLUSTER statement The CLUSTER clause of a CREATE MATERIALIZED VIEW statement SQL built-in functions, expressions, or conditions SELECT lists of queries containing GROUP BY clauses SELECT lists of subqueries or queries combined by the UNION, INTERSECT, or MINUS set operators SELECT lists of CREATE TABLE ... AS SELECT statements ALTER TABLE ... MOVE statements SELECT lists in subqueries in INSERT statements Triggers can use the LONG data type in the following manner: A SQL statement within a trigger can insert data into a LONG column. If data from a LONG column can be converted to a constrained data type (such as CHAR and VARCHAR2), then a LONG column can be referenced in a SQL statement within a trigger. Variables in triggers cannot be declared using the LONG data type. :NEW and :OLD cannot be used with LONG columns

17,090

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧