2013-12-21 2 views
1

APEX 나는 테이블 (기본 키 ID와 유통 테이블), 내가오라클 APEX 오류

이 수 다음과 같은 오류를 얻을에 데이터를 삽입 할 때 대화 형 보고서를 사용하여 4.1

PL/SQL :하지 GLOBALVARS ORA-06502를 설정 숫자 또는 값 오류 : 문자를 숫자 변환 오류로 설정 GLOBALVARS라는 데이터베이스에 패키지가있다

I debugged the application and saved a log of the activity. I highlighted the error in RED. 
0.07397 0.00126 Session State: Save form items and p_arg_values 4 
0.07523 0.00109 ...Session State: Save "P47_SMAPPROVER" - saving same value: "" 4 
0.07632 0.00094 ...Session State: Save "P47_PROTOCOLNUMBER" - saving same value: "CQAB149B9999" 4 
0.07726 0.00092 ...Session State: Save "P47_ID" - saving same value: "12746" 4 
0.07818 0.00976 ...Session State: Save "P47_CTLAPPDATE" - saving same value: "" 4 
0.08794 0.00099 ...Session State: Save "P47_ORIGIN" - saving same value: "ICPR" 4 
0.08892 0.01919 ...Session State: Save "P47_ORIGIN_T" - saving same value: "" 4 
0.10811 0.00080 Processes - point: ON_SUBMIT_BEFORE_COMPUTATION 4 
0.10891 0.00138 ...Process "Set GLOBALVARS" - Type: PLSQL 4 
0.11030 0.00239 ...Execute Statement: begin begin GLOBALVARS.GUSID := :GUSID; GLOBALVARS.GUSER := :GUSER; GLOBALVARS.GROLE := :GROLE; GLOBALVARS.GUSERID := :USERID; end; end; 4 
0.11269 0.00104 Add error onto error stack 4 
0.11373 0.00095 ...Error data: 4 
0.11468 0.00093 ......message: Could not set GLOBALVARS; 4 
0.11561 0.00093 ......additional_info: ORA-06502: PL/SQL: numeric or value error: character to number conversion error 4 
0.11654 0.00096 ......display_location: ON_ERROR_PAGE 4 
0.11750 0.00099 ......is_internal_error: false 4 
0.11849 0.00093 ......ora_sqlcode: -6502 4 
0.11942 0.00094 ......ora_sqlerrm: ORA-06502: PL/SQL: numeric or value error: character to number conversion error 4 
0.12036 0.00095 ......error_backtrace: ORA-06512: at "SYS.WWV_DBMS_SQL", line 904 ORA-06512: at "APEX_040100.WWV_FLOW_DYNAMIC_EXEC", line 618 ORA-06512: at "APEX_040100.WWV_FLOW_PROCESS", line 128 4 
0.12131 0.00096 ......component.type: APEX_APPLICATION_PROCESSES 4 
0.12227 0.00111 ......component.id: 1113626474420504307 4 
0.12338 0.00124 ......component.name: Set GLOBALVARS 4 
0.12461 0.00099 ...Show Error on Error Page 4 
0.12560 0.00528 ......Performing rollback 4 
0.13088 0.00215 Processes - point: AFTER_ERROR_HEADER 4 
0.13303 0.00226 Processes - point: BEFORE_ERROR_FOOTER 4 
0.13529 - End Page Processing 

변수.

패키지의 변수

GUSID  number; 
GUSERID varchar2(20); 
GUSER  varchar2(60); 
GROLE  varchar2(30); 

되는 변수가 설정되는 세션

GUSID

같은 - (이것은 ID 임) (12,371) GUSERID - DM_USERID GUSER - USERNAME GROLE - DM

많은 GLOBALVARS를 사용할 수 없도록 설정할 수 없습니다.

이 오류를 어떻게 극복 할 수 있는지 조언 해주십시오.

+0

GUSID가 유일한 숫자로 보는 것, 거기에 넣을 값이 숫자인지 확인하십시오. ': GUSID'는 페이지 또는 응용 프로그램 변수입니까? 이것을 디버그 로그 (apex_debug.message)에 넣으십시오. 제출하기 전에 세션 정보를 확인하십시오. 그것이 숫자라면, 그것을 설정하기 전에 명백한'TO_NUMBER'를 시도하십시오. – Tom

+0

응답 해 주셔서 감사합니다. 세션 변수를 검사하여 GUSID로 전송 된 값을 확인했습니다. GUSID의 값은 & 12371입니다. 다른 환경 (테스트 및 프로덕션 환경)에서도 동일합니다. GUSID를 사용하지 않도록 설정하면 GUSID에 주석을 달아도 오류가 표시되지 않지만 많은 장소에서 참조되므로 사용을 해제 할 수 없습니다. – user1940212

+1

은 문자 그대로이 값 : & 12371.'입니까? – Tom

답변

0

문제가있는 곳을 알려줍니다. 이 작업을 "set GlobalVars"프로세스에서 실행하십시오.

begin 
    begin 
     globalvars.gusid := to_number (:gusid); 
    exception 
     when others then 
      raise_application_error (-20001, ':gusid is not a number'); 
    end; 

    if :guser != substr (:guser, 1, 60) then 
     raise_application_error (-20002, ':guser is > 60 chars'); 
    end if; 

    globalvars.guser := :guser; 

    if :grole != substr (:grole, 1, 30) then 
     raise_application_error (-20003, ':grole is > 30 chars'); 
    end if; 

    globalvars.grole := :grole; 

    if :userid != substr (:userid, 1, 20) then 
     raise_application_error (-20004, ':userid is > 20 chars'); 
    end if; 

    globalvars.guserid := :userid; 
end; 
관련 문제