我正在尝试运行一个具有几列CLOB数据类型的查询.如果我像正常一样运行查询,那么所有这些字段都只有(CLOB)
值.
我尝试使用DBMS_LOB.substr(column
),我得到错误
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
Run Code Online (Sandbox Code Playgroud)
我如何查询CLOB列?
我正在使用Oracle SQL Developer,但是我在查看返回引用游标的包的结果时遇到了问题.以下是包装定义:
CREATE OR REPLACE package instance.lswkt_chgoff_recov
as
type rec_type is record
(
source_cd lswk_tpr.gltrans.tpr_source_cd%TYPE,
as_of_dt lswk_tpr.gltrans.tpr_as_of_dt%TYPE,
chrg_off_recov varchar2(5),
process_dt lswk_tpr.gltrans.dtgltran%TYPE,
effect_dt lswk_tpr.gltrans.dtgltran%TYPE,
account_nbr lswk_tpr.contract.lcontid%TYPE,
naics_cd lswk_tpr.udfdata.sdata%TYPE,
prod_type varchar2(20),
off_nbr lswk_tpr.schedule.sctrcdty%TYPE,
borrower_nm lswk_tpr.customer.scustnm%TYPE,
tran_type_cd lswk_tpr.gltrans.sglcd%TYPE,
tran_type_desc lswk_tpr.gltrans.sglcd%TYPE,
tran_amt lswk_tpr.gltrans.ctranamt%TYPE,
note_dt lswk_tpr.schedule.dtbk%TYPE,
accru_cd number,
non_accr_cd lswk_tpr.schedule.dtlstincsus%TYPE,
comm_sb_ind varchar2(4)
);
type cur_type is ref cursor return rec_type;
procedure sp
(
p_as_of_dt in date,
ref_cur in out cur_type
);
end;
/
Run Code Online (Sandbox Code Playgroud)
我想这个问题是可能的,如果是的话,我需要做什么.我正在使用Oracle SQL Developer 1.5.5.谢谢.
涉
这是我用来调用我的包的代码(由TOAD生成):
DECLARE
P_AS_OF_DT DATE;
REF_CUR instance.LSWKT_CHGOFF_RECOV.CUR_TYPE; …
Run Code Online (Sandbox Code Playgroud) 我们遇到了Oracle表定义(DDL)和我们的一个PL/SQL脚本中的特定问题.
问题是,有一个在表中进行更改,更改varchar(20)
到varchar(30)
,这种变化却并不因此努力体现在我们的PL/SQL脚本消费数据,这仍然是一个varchar(20)
,引起了ORA-06502: PL/SQL: numeric or value error
我们的回归测试过程中一个错误.
我想在这里向Oracle和数据库专家寻求建议,无论您是否在过去遇到过这样的情况,表DDL都有变化,并且没有反映在PL/SQL中以及如何处理这个差距.
我知道一种简单的方法是某种形式的执行或文书工作,但会不会有更美观或更优雅的解决方案,即外键的工作方式以避免插入/更新/删除异常?
谢谢!
当我尝试在BLOB字段上运行dbms_lob.substr函数时,我收到以下错误:
ORA-06502:PL/SQL:数值或值错误:原始变量长度太长
ORA-06512:第1行
我的查询:
select dbms_lob.substr(my_report, 10000, 1)
from my_table where my_table.report_id = :myid
Run Code Online (Sandbox Code Playgroud)
根据dbms_lob.substr
文档,我应该能够在第二个参数中使用一个值达32767,并且报告的大小超过200,000字节,因此它在该范围内.
在使用数字后,我发现我可以在量参数(第二个参数)中使用的subs值为substr函数.
有谁知道为什么?
我创建了一个光标来选择实际数据,然后循环输出原始值和转换为数字后的值.该应用程序偶尔会抛出无效的数字错误.下面是我的测试(不包括select语句)代码和输出.
LOOP
FETCH myCursor into v_answer;
EXIT WHEN myCursor%notfound;
DBMS_OUTPUT.PUT_LINE('Raw answer: ' || v_answer );
v_instr := INSTR(v_answer, '.',1 , 2) ;
v_number := TO_NUMBER(REPLACE(TRANSLATE (CASE v_instr
WHEN 0 THEN UPPER(v_answer)
ELSE 0
END,'ABCDEFGHIJKLMNOPQURSTWVXYZ+<>:',' '), ' ',''));
DBMS_output.put_line('As number: ' || v_number);
Run Code Online (Sandbox Code Playgroud)
这是输出:
Raw answer: 4
As number: 4
Raw answer: 3
As number: 3
Raw answer: 1.00
As number: 1
Raw answer: <3
Run Code Online (Sandbox Code Playgroud)
我收到:
PL/SQL:数字或值错误:字符到数字转换错误
......当Raw回答为"<3"时.
请注意,应用程序使用的实际代码如下所示:
AND TO_NUMBER(REPLACE(TRANSLATE ( decode( INSTR(hra_ans.answer_text, '.',1 , 2), 0 , UPPER(hra_ans.answer_text) , …
Run Code Online (Sandbox Code Playgroud) 我有一个下面的包,它给出了错误
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
Run Code Online (Sandbox Code Playgroud)
请告诉我这里出了什么问题.
CREATE OR REPLACE PACKAGE BODY PKG_H
IS
PROCEDURE PROC_SUBMIT_H
(
Pout_Rqst_Id OUT NVARCHAR2,
Pout_err_cd OUT VARCHAR2,
Pout_err_msg OUT VARCHAR2,
Pin_Rqst_Type_Id IN NUMBER,
Pin_Attachment IN NVARCHAR2,
Pin_Brand_Id IN NVARCHAR2,
Pin_Prop_Id IN NVARCHAR2,
-- Pin_Htl_Stat_Rqst_Typ_ID IN NUMBER,
Pin_Orcl_Acct_Num IN NVARCHAR2, -- NUMBER, /* Changed on 22.09.2011,as stated by FIS Team */
Pin_ORCL_User_Name IN NVARCHAR2,
Pin_Rstn_Id IN NUMBER,
Pin_Rstn_Name IN NVARCHAR2,
Pin_Rstn_Start_Date IN DATE,
Pin_Rstn_End_Date IN DATE,
-- Pin_Change_Type_Ind IN …
Run Code Online (Sandbox Code Playgroud) create or replace
procedure prdBandwidth
is
cursor c_bandwidth is select distinct mt.name bwname,b.circuitno circuitno,subapp.customerno customerno,netinfo.bandwidthtype bandwidthtype from wom.tbltsubscriberapplication subapp,wom.tbltllnetworkinfo netinfo,wom.tblmmastertype mt,(select max(applicationdate) as maxdate,circuitno,customerno from wom.TBLTSUBSCRIBERAPPLICATION,tblmaccount where nodename='End' and accountnumber=customerno group by circuitno, customerno) b where subapp.applicationdate=b.maxdate and subapp.circuitno=b.circuitno and subapp.llnetworkinfoid=netinfo.id and netinfo.bandwidthtype=mt.id;
bwtype varchar2(6);
bwtypelen number;
bwtypesublen number;
bwvalue varchar2(8);
kbpsdata number;
begin
DBMS_OUTPUT.PUT_LINE('hhahahahah');
for crs_bandwidth in c_bandwidth
loop
bwtypelen:=length(crs_bandwidth.bwname);
DBMS_OUTPUT.PUT_LINE('bwtypelen:::'+bwtypelen);
bwtype:=substr(crs_bandwidth.bwname,-4,4);
DBMS_OUTPUT.PUT_LINE('bwtype:::'+bwtype);
bwtypesublen:=length(bwtype);
DBMS_OUTPUT.PUT_LINE('bwtypesublen:::'+bwtypesublen);
bwtypesublen:=bwtypesublen-1;
DBMS_OUTPUT.PUT_LINE('bwtypesublen:::'+bwtypesublen);
bwvalue:=substr(crs_bandwidth.bwname,bwtypesublen,bwtypesublen);
DBMS_OUTPUT.PUT_LINE('bwvalue:::'+bwvalue);
if bwtype='mbps' then
DBMS_OUTPUT.PUT_LINE('bwtype in if condition:::'+bwvalue);
bwvalue:=bwvalue*1024;
DBMS_OUTPUT.PUT_LINE('bwtype in …
Run Code Online (Sandbox Code Playgroud) 我遇到错误,不知道为什么:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.STANDARD", line 394
ORA-06512: at "DOMINOS.DISTANCE", line 10
ORA-06512: at "DOMINOS.ZOEKWINKELVOORADRES", line 19
ORA-06512: at line 5
Run Code Online (Sandbox Code Playgroud)
光标应包含145行。当我执行该过程时,我在54行之后收到上面的错误消息。
create or replace procedure zoekWinkelVoorAdres
(v_postcode in postcode.postcode%type,
v_huisnr in WINKEL.HUISNR%type,
v_id out WINKEL.ID%type,
v_afstand out number)
is
type lat_array is varray(100000) of POSTCODE.LAT%type;
type lon_array is varray(100000) of POSTCODE.LON%type;
type id_array is varray(100000) of winkel.id%type;
a_lat lat_array;
a_lon lon_array;
a_id id_array;
latwin postcode.lat%type;
lonwin postcode.lon%type;
latklant postcode.lat%type;
lonklant postcode.lon%type;
vafstand number(38);
cursor …
Run Code Online (Sandbox Code Playgroud)