1403 Error Code Oracle
Contents |
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 oracle error 1403 java.sql.sqlexception ora-01403
ORA-01403: oracle sqlcode 1403 no data found tips Oracle Error Tips by Burleson Consulting Oracle docs note this about ORA-01403: ora 01403 error in oracle ORA-01403 no data found Cause: In a host language program, all records have been fetched. The return code from the fetch was +4, indicating that all records have been returned from ora-01403 no data found in oracle apps the SQL query. Action: Terminate processing for the SELECT statement Many people experience ORA-01403 in association with the SELECT INTO clause. SELECT INTO clauses are standard SQL queries which pull a row or set of columns from a database, and put the retrieved data into variables which have been predefined. If the SELECT INTO statement doesn't return at least on e row, ORA-01403 isOra-01403 No Data Found Ora-06512
thrown. Here is an example: SQL> declare 2 v_authName author.author_last_name%type; 3 begin 4 select 5 author_last_name into v_authName 6 from 7 author 8 where 9 author_state = 'FL'; 10 dbms_output.put_line('Name: '||v_authName); 11 end; 12 / declare * ERROR at line 1: ORA-01403: no data found ORA-06512: at line 4 Because the query is looking to retrieve authors in Florida and there are none, the ORA-01403 error is thrown. To avoid ORA-01403, the PL/SQL has to contain exceptions , otherwise the query will offer to values to the defined variable. If the exceptions are not defined properly, you will encounter ORA-01403, and your situation may worsen each time you attempt to access the particular variable. Creating an exception in which only one row can be retrieved would allow the code to appropriately handle the exception without receiving the ORA-01403 error. To create this SELECT INTO query that will avoid the ORA-01403 error, and handle the appropriate exceptions, here is an example: SQL> create or replace function auth_Name 2 ( v_auth_state IN author.author_state%type) 3 return varchar2 4 as 5 v_authName author.author_last_name%type; 6 begin 7 select 8 author_last_name into v_authName 9 from 10
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack
Ora-01403 No Data Found In Package
Overflow the company Business Learn more about hiring developers or posting ads with us Stack ora-01403 no data found select into Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community ora 01403 no data found ora 06512 in oracle of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Why is no_data_found ORA-01403 an exception in Oracle? up vote 12 down vote favorite 2 If the http://www.dba-oracle.com/sf_ora_01403_no_data_found.htm SELECT INTO statement doesn't return at least one row, ORA-01403 is thrown. For every other DBMS I know this is normal on a SELECT. Only Oracle treats a SELECT INTO like this. CREATE OR REPLACE PROCEDURE no_data_proc IS dummy dual.dummy%TYPE; BEGIN BEGIN SELECT dummy INTO dummy FROM dual WHERE dummy = 'Y'; EXCEPTION WHEN no_data_found THEN dbms_output.put_line('Why is this needed?'); END; END no_data_proc; Why? In my opinion you don't need this http://stackoverflow.com/questions/3940522/why-is-no-data-found-ora-01403-an-exception-in-oracle exception really. It is too much overhead. Sometimes it is handy but you have to write a whole BEGIN, EXCEPTION, WHEN, END Block. Are there any essential reasons I don't see? oracle exception exception-handling plsql ora-01403 share|improve this question edited Feb 12 '11 at 1:33 OMG Ponies 198k36356415 asked Oct 15 '10 at 8:12 Stephan Schielke 1,10551734 4 Don't forget to catch TOO_MANY_ROWS when the select returns more than one row. –Rene Oct 15 '10 at 13:19 add a comment| 6 Answers 6 active oldest votes up vote 15 down vote accepted The exception block is not needed, you might use it or not, depending on the context. Here you are actively ignoring the exception (the procedure will return successfully) but most of the time if you're doing a SELECT INTO you want it to fail if it doesn't return a row, consider: PROCEDURE update_employee_salary (p_empno) IS l_salary NUMBER; BEGIN SELECT sal INTO l_salary FROM emp WHERE empno = p_empno FOR UPDATE; /* do something with emp data */ END; Here I want my function to fail if it is called with an empno that doesn't exist in the EMP table. I might catch the exception to raise a meaningful error message (with raise_application_error) but most of the time I'm happy wit
them. SQLSTATE Codes Code Condition Oracle Error 00000 successful completion ORA-00000 01000 warning 01001 cursor operation conflict 01002 disconnect error 01003 null value eliminated in set https://docs.oracle.com/cd/E15817_01/appdev.111/b31228/appd.htm function 01004 string data - right truncation 01005 insufficient item descriptor areas 01006 privilege not revoked 01007 privilege not granted 01008 implicit zero-bit padding 01009 search condition too long for info schema 0100A query expression too long for info schema 02000 no data ORA-01095 ORA-01403 07000 dynamic SQL error 07001 using clause does not match parameter no data specs 07002 using clause does not match target specs 07003 cursor specification cannot be executed 07004 using clause required for dynamic parameters 07005 prepared statement not a cursor specification 07006 restricted datatype attribute violation 07007 using clause required for result fields 07008 invalid descriptor count SQL-02126 07009 invalid descriptor index 08000 connection exception 08001 SQL client unable no data found to establish SQL connection 08002 connection name in use 08003 connection does not exist SQL-02121 08004 SQL server rejected SQL connection 08006 connection failure 08007 transaction resolution unknown 0A000 feature not supported ORA-03000 .. 03099 0A001 multiple server transactions 21000 cardinality violation ORA-01427 SQL-02112 22000 data exception 22001 string data - right truncation ORA-01401 ORA-01406 22002 null value - no indicator parameter ORA-01405 SQL-02124 22003 numeric value out of range ORA-01426 ORA-01438 ORA-01455 ORA-01457 22005 error in assignment 22007 invalid date-time format 22008 date-time field overflow ORA-01800 .. 01899 22009 invalid time zone displacement value 22011 substring error 22012 division by zero ORA-01476 22015 interval field overflow 22018 invalid character value for cast 22019 invalid escape character ORA-00911 ORA-01425 22021 character not in repertoire 22022 indicator overflow ORA-01411 22023 invalid parameter value ORA-01025 ORA-01488 ORA-04000 .. 04019 22024 unterminated C string ORA-01479 .. 01480 22025 invalid escape sequence ORA-01424 22026 string data - length mismatch 22027 trim error 23000 integrity constraint violation ORA-00001 ORA-02290 .. 02299 24000 invalid cursor state ORA-01001 .. 01003 ORA-01410 ORA-08006 SQL-02114 SQL-02117 SQL-02118 SQL-021