Oracle Error Code 06502
SQL TuningSecurityOracle UNIXOracle LinuxMonitoringRemote supportRemote plansRemote servicesApplication Server ApplicationsOracle FormsOracle PortalApp UpgradesSQL ServerOracle ConceptsSoftware SupportRemote Support Development Implementation Consulting StaffConsulting PricesHelp Wanted! Oracle PostersOracle Books Oracle Scripts Ion Excel-DB Don Burleson Blog
ORA-06502: PL/SQL: numeric or value error Oracle Database Tips by Burleson Consulting Question on error "ORA-06502: PL/SQL: numeric or value error": I created the function p_test but when I try to run it I get the following error: ERROR at line 1: ORA-06502: PL/SQL: numeric or value error ORA-06512: at "SYS.OWA_UTIL", line 323 ORA-06512: at "JUAN.TEST_IP", line 6 ORA-06512: at line 1. Answer: The docs note this on the ORA-06502 error: ORA-06502: PL/SQL: numeric or value error string 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. Answer by Edward Stoever: does owa_util exist and do you have access to it? You can find out by describing owa_util SQL> desc sys.owa_util But it looks like you do have access to it, because you are getting an error on a specific line of that package, which means that you entered it. The OWA_UTIL.get_cgi_env function is made for web browser accessing dynamic web content served up through an web server. I don't think it will work with 6i forms. That is why I suggested you look at THIS web page. There is a java bean package created to get the IP address of the browser that is accessing a 6i form through a browser there. It says: Get Client Information interacts with the client machine to get the username, hostname and IP address. (ReadMe) I have never used it, I don't even know how it works. But it is worth reading about to decide if you cana PL/SQL block. This error mainly results from programmer error or invalid data input. An example: SQL> DECLARE 2 i NUMBER; 3 BEGIN 4 i:= ' '; 5 END; 6 / DECLARE * ERROR at line 1: ORA-06502: PL/SQL: numeric or value error: character to number conversion error ORA-06512: at line 4 Other examples: An attempt is http://www.dba-oracle.com/t_ora_06502_pl_sql_numeric_value_error.htm made to assign the value NULL to a variable declared NOT NULL An attempt is made to assign an integer larger than 999 to a variable declared NUMBER(3) An attempt is made to assign more than 5 characters to a VARCHAR2(5) variable How to http://www.orafaq.com/wiki/ORA-06502 fix it[edit] Change the data, how it is manipulated, or how it is declared so that values do not violate the declared data type definitions. You can also capture these errors with the predefined VALUE_ERROR exception. Example: DECLARE i NUMBER; BEGIN i:= ' '; EXCEPTION when VALUE_ERROR then dbms_output.put_line('VALUE_ERROR exception raised'); END; / Retrieved from "http://www.orafaq.com/wiki/index.php?title=ORA-06502&oldid=14818" Category: Errors Navigation menu Views Page Discussion Edit History Personal tools Log in / create account Site Navigation Wiki Home Forum Home Blogger Home Site highlights Blog Aggregator FAQ's Mailing Lists Usenet News RSS Feeds Wiki Navigation Categories Recent changes Random page Help Search Tools What links here Related changes Special pages Printable version Permanent link Page information This page was last modified on 23 May 2013, at 17:17. Privacy policy About Oracle Wiki Disclaimers
here for a quick overview of the site Help Center Detailed answers to any questions you might http://stackoverflow.com/questions/8538516/getting-pl-sql-numeric-or-value-error-character-to-number-conversion-error have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 oracle error million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Getting PL/SQL: numeric or value error: character to number conversion error up vote 1 down vote favorite I'm getting this error: ORA-06502: PL/SQL: numeric or value error: character to number conversion error ORA-06512: at line 146 06502. 00000 oracle error code - "PL/SQL: numeric or value error%s" And here's my code: SET SERVEROUTPUT ON; DECLARE SearchId NUMBER := 0; SearchMethod VARCHAR2(100) := ''; CritExpression VARCHAR2(100) := ''; SubstringStartPosition NUMBER := 0; SubstringLength NUMBER := 0; CritDescription VARCHAR2(100) := ''; CriteriaSequenceId NUMBER := 1; CriteriaId NUMBER := 0; CritCount NUMBER := 0; FUNCTION InsertSrchCriteria ( SearchMethod IN VARCHAR2, CritExpression IN VARCHAR2, SubstringStartPosition IN NUMBER, SubstringLength IN NUMBER, CritDescription IN VARCHAR2, CriteriaSequenceId IN NUMBER, SearchId IN NUMBER ) RETURN NUMBER IS C_Id NUMBER := 0; BEGIN SELECT COUNT (*) INTO CritCount FROM criteria_table WHERE search_id = SearchId AND criteria_sequence_id = CriteriaSequenceId; IF CritCount = 0 THEN INSERT INTO criteria_table ( criteria_sequence_id, search_id, search_method, expression, substring_start_position, substring_length, description ) VALUES ( CriteriaSequenceId, SearchId, SearchMethod, CritExpression, SubstringStartPosition, SubstringLength, CritDescription ) RETURNING criteria_id INTO C_Id; IF C_Id > 0 THEN DBMS_OUTPUT.PUT_LINE ('Inserted ' || 'SearchId: ' || SearchId || ' @' || CriteriaSequenceId || ' successfully'); ELSE DBMS_OUTPUT.PUT_LINE ('Not Inserted ' || 'SearchId: ' || SearchId ||