2012-01-05 3 views
0
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 if condition:::'+bwvalue); 
    end if; 
    update TBLMLEASEDLINECUSTOMER set BANDWIDTH=bwvalue where CUSTOMERID = (select CUSTOMERID from TBLMCUSTOMER where accountnumber=crs_bandwidth.customerno); 
    end loop; 
    commit; 
end; 

오류 명령 라인 36에서 시작 :숫자 또는 값 오류 : 숫자 변환 오류 문자

exec prdBandwidth 

오류 보고서 :

ORA-06502: PL/SQL: numeric or value error: character to number conversion error 
ORA-06512: at "JISPBILCORBILLINWOM501.PRDBANDWIDTH", line 14 
ORA-06512: at line 1 
06502. 00000 - "PL/SQL: numeric or value error%s" 
*Cause:  
*Action: 

이 코드

답변

7

에에게 있습니다 DBMS_OUTPUT.PUT_LINE 문을 사용하려면 '||' '+'가 아닌 연결 연산자로 사용됩니다.

+0

+1 DBMS_OUTPUT을 사용하여 코드를 디버깅하지 않는 이유 목록에이 내용을 추가하겠습니다. – APC

+5

@APC : DBMS_OUTPUT을 사용하지 않는 데에는 여러 가지 이유가 있지만이 오류는 이들과 아무런 관련이 없으며 잘못된 연산자를 사용하여 발생합니다. PL/SQL 작업에서 구문 또는 의미 오류가 발생하거나 SQL 문 또는 다른 언어 – symcbean

관련 문제