Home » SQL & PL/SQL » SQL & PL/SQL » Oracle form error 06502 (D2k 10G)
Oracle form error 06502 [message #614124] Sat, 17 May 2014 01:32 Go to next message
vivek6648
Messages: 3
Registered: May 2014
Location: India
Junior Member
I'm having an error 06502 when i'm running my oracle form on local network.
Code is mentioned below:
Error when-validate trigger raised underhanded exception

DECLARE
v_dummy NUMBER;
v_value VARCHAR2(1);
BEGIN
v_value := SUBSTR(:BB_MM_INFRA_CHECKLIST.CHECKLIST_DESCRIPTION,1,1);
IF NOT ((ASCII(v_value) >= 65 AND ASCII(v_value) <= 122))
THEN
v_dummy := func_alert('Required_Alert', '#soochanaa', 'pahlaa akshar sankhyaa naheeM ho sakataa.');

RAISE Form_Trigger_Failure;
END IF;
END;

[EDITED by LF: fixed topic title typo; was "forum error"]

[Updated on: Sun, 18 May 2014 10:15] by Moderator

Report message to a moderator

Re: Oracle forum error 06502 [message #614125 is a reply to message #614124] Sat, 17 May 2014 01:35 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

ORA-06502: PL/SQL: numeric or value error%s
 *Cause: An arithmetic, numeric, string, conversion, or constraint error
         occurred. For example, this error occurs if an attempt is made to
         assign the value NULL to a variable declared NOT NULL, or if an
         attempt is made to assign an integer larger than 99 to a variable
         declared NUMBER(2).
 *Action: Change the data, how it is manipulated, or how it is declared so
          that values do not violate constraints.
Re: Oracle forum error 06502 [message #614126 is a reply to message #614125] Sat, 17 May 2014 01:53 Go to previous messageGo to next message
vivek6648
Messages: 3
Registered: May 2014
Location: India
Junior Member
Michel Cadot ,
I'm Still not able to find my error.
I'm posting my trigger code. Please Help

DECLARE
v_dummy NUMBER;
v_value VARCHAR2(1);
BEGIN
v_value := SUBSTR(:BB_MM_INFRA_CHECKLIST.CHECKLIST_DESCRIPTION,1,1);
IF NOT ((ASCII(v_value) >= 65 AND ASCII(v_value) <= 122))
THEN
v_dummy := func_alert('Required_Alert', '#soochanaa', 'pahlaa akshar sankhyaa naheeM ho sakataa.');

RAISE Form_Trigger_Failure;
END IF;
END;
Re: Oracle forum error 06502 [message #614127 is a reply to message #614126] Sat, 17 May 2014 02:33 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

You repeat the same thing without adding any information why do you think the answer will be different?
At which line is the error?
Are you sure the error come from this code?

Re: Oracle forum error 06502 [message #614130 is a reply to message #614126] Sat, 17 May 2014 03:10 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
You cannot expect someone else to debug the code just by looking at it. Execute the code in SQL*Plus, copy and paste the entire session details alongwith the error and line number etc. Remove any exception block, it will point to a correct line number. You can proceed further with debugging.

And please use code tags to make the code readable. The sticky is at the top of this forum.
Re: Oracle forum error 06502 [message #614134 is a reply to message #614124] Sat, 17 May 2014 04:21 Go to previous messageGo to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Quote:
ORA-06502: PL/SQL: numeric or value error%s
*Cause: An arithmetic, numeric, string, conversion, or constraint error
occurred. For example, this error occurs if an attempt is made to
assign the value NULL to a variable declared NOT NULL, or if an
attempt is made to assign an integer larger than 99 to a variable
declared NUMBER(2).
*Action: Change the data, how it is manipulated, or how it is declared so
that values do not violate constraints.

As per Michel Cadot post check you and increase data type value in the commented line
DECLARE
    v_dummy NUMBER;
    v_value VARCHAR2(1); -->Check This 
BEGIN
    v_value := Substr(:BB_MM_INFRA_CHECKLIST.checklist_description, 1, 1);

    IF NOT (( Ascii(v_value) >= 65 AND Ascii(v_value) <= 122 )) THEN
      v_dummy := Func_alert('Required_Alert', '#soochanaa','pahlaa akshar sankhyaa naheeM ho sakataa.');

      RAISE form_trigger_failure;
    END IF;
END;  
Re: Oracle forum error 06502 [message #614136 is a reply to message #614134] Sat, 17 May 2014 04:37 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

I doubt the error comes from this declaration (if the posted code is the real one) as v_value is only assign to Substr(..., 1, 1) which is at most 1 character.

However, it is possible if the database character set is a multi-byte one (like AL32UTF8) and nls_length_semantic is set to BYTE (which is then a big error in the database configuration) and the selected character unluckily has a code point on more than one byte.

Re: Oracle forum error 06502 [message #614197 is a reply to message #614126] Sun, 18 May 2014 09:25 Go to previous message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
vivek6648 wrote on Sat, 17 May 2014 12:23

v_dummy := func_alert('Required_Alert', '#soochanaa', 'pahlaa akshar sankhyaa naheeM ho sakataa.');


What is the return type and value of the function func_alert?

Also, as Michel suggested, I see a potential issue with characterset. Most of you might not underatand this :
Quote:

#soochanaa', 'pahlaa akshar sankhyaa naheeM ho sakataa.');


It is hindi language(written in english alphabets), which means "Mesaage, first character cannot be a number". The application might be in Hindi language and thus an issue with characterset and language settings.

[Updated on: Sun, 18 May 2014 09:33]

Report message to a moderator

Previous Topic: UTL_HTTP error
Next Topic: ORA-01031: insufficient privileges
Goto Forum:
  


Current Time: Fri Apr 19 10:57:27 CDT 2024