Ora-01422 Error In Oracle
Contents |
MySQL MariaDB PostgreSQL SQLite MS Office Excel Access Word Web Development HTML CSS Color Picker Languages C Language More ASCII Table Linux UNIX Java Clipart Techie ora-01422 exception handling Humor Advertisement Oracle Basics ALIASES AND AND & OR BETWEEN COMPARISON OPERATORS
Ora 01422 Unhandled Exception
DELETE DISTINCT EXISTS FROM GROUP BY HAVING IN INSERT INSERT ALL INTERSECT IS NOT NULL IS NULL
The Number Specified In Exact Fetch Is Less Than The Rows Returned
JOIN LIKE MINUS NOT OR ORDER BY PIVOT REGEXP_LIKE SELECT SUBQUERY TRUNCATE UNION UNION ALL UPDATE WHERE Oracle Advanced Oracle Cursors Oracle Exception Handling Oracle Foreign Keys Oracle Loops/Conditionals Oracle
Ora-01422 In Cursor For Loop
Transactions Oracle Triggers String/Char Functions Numeric/Math Functions Date/Time Functions Conversion Functions Analytic Functions Advanced Functions Oracle / PLSQL: ORA-01422 Error Message Learn the cause and how to resolve the ORA-01422 error message in Oracle. Description When you encounter an ORA-01422 error, the following error message will appear: ORA-01422: exact fetch returns more than requested number of rows Cause You ora-01422 select into tried to execute a SELECT INTO statement and more than one row was returned. Resolution The option(s) to resolve this Oracle error are: Option #1 Rewrite your SELECT INTO statement so that only one row is returned. Option #2 Replace your SELECT INTO statement with a cursor. For example, if you tried to execute the following SQL statement: SELECT supplier_id INTO cnumber FROM suppliers WHERE supplier_name = 'IBM'; And there was more than one record in the suppliers table with the supplier_name of IBM, you would receive the ORA-01422 error message. In this case, it might be more prudent to create a cursor and retrieve each row if you are unsure of how many records you might retrieve. Share this page: Advertisement Back to top Home | About Us | Contact Us | Testimonials | Donate While using this site, you agree to have read and accepted our Terms of Service and Privacy Policy. We use advertisements to support this website and fund the development of new content. Copyright © 2003-2016 TechOnTheNet.com. All rights reserved.
CommunityOracle User Group CommunityTopliners CommunityOTN Speaker BureauJava CommunityError: You don't have JavaScript enabled. This tool uses JavaScript and much of it will not work correctly without it enabled. Please turn JavaScript back on and reload this page. Please enter a title. You can trigger raised unhandled exception ora 01422 not post a blank message. Please type your message and try again. oracle too many rows More discussions in PL/SQL and SQL All PlacesDatabaseDatabase Application DevelopmentPL/SQL and SQL This discussion is archived 10 Replies Latest reply frm-40735 post-query trigger raised unhandled exception ora-01422 on Feb 15, 2006 6:39 PM by 12826 ORA-01422: exact fetch returns more than requested number of rows 475922 Feb 15, 2006 3:48 PM Good Morning Everyone! When my proc is getting https://www.techonthenet.com/oracle/errors/ora01422.php to this startment its giving me the error below: UPDATE TT_FERMS SET assigned_system_id = 2 WHERE ferm_bank = 3 RETURNING ( SPAC_ASSIGN_FERMS.xfer_seq + 1 ), SPAC_ASSIGN_FERMS.xfer_seq + 1 INTO SPAC_ASSIGN_FERMS.xfer_seq, SPAC_ASSIGN_FERMS.xfer_seq; ERROR:ERROR at line 1: ORA-01422: exact fetch returns more than requested number of rows ORA-06512: at "BREW_SCHED.SPAC_ASSIGN_FERMS", line 959 Please help! Thanks much! 33863Views Tags: none (add) This content has been marked as final. https://community.oracle.com/thread/364848 Show 10 replies 1. Re: ORA-01422: exact fetch returns more than requested number of rows 12826 Feb 15, 2006 4:17 PM (in response to 475922) What are the datatypes for the RETURNING columns; can they accept more than one row/record Like Show 0 Likes(0) Actions 2. Re: ORA-01422: exact fetch returns more than requested number of rows Tony Andrews Feb 15, 2006 4:17 PM (in response to 475922) It means you updated more than one row, so Oracle can't return the values into simple variables. You can use BULK COLLECT and tables like this: SQL> declare 2 type num_tab is table of number; 3 empno_tab num_tab; 4 begin 5 update emp set ename = ename 6 returning empno bulk collect into empno_tab; 7 for i in 1..empno_tab.count loop 8 dbms_output.put_line('updated empno '||empno_tab(i)); 9 end loop; 10 end; 11 / updated empno 7839 updated empno 7698 updated empno 7782 updated empno 7566 updated empno 7788 updated empno 7902 updated empno 7369 updated empno 7499 updated empno 7521 updated empno 7654 updated empno 7844 updated empno 7876 updated empno 7900 updated empno 7934 PL/SQL procedure successful
here for a quick overview of the site Help Center Detailed answers to any questions you might http://stackoverflow.com/questions/21669419/ora-01422-exact-fetch-returns-more-than-requested-number-of-rows-ora-06512-at have Meta Discuss the workings and policies of this site About https://www.tekstream.com/resources/ora-01422-exact-fetch-returns-more-than-requested-number-of-rows/ 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 million unhandled exception programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ORA-01422: exact fetch returns more than requested number of rows ORA-06512: at line 5 up vote 0 down vote favorite set serveroutput on; set verify off; set autoprint on; variable b_employee_id employees.employee_id%type; declare v_last_name employees.last_name%type; v_emp_id employees.employee_id%type; begin select employee_id trigger raised unhandled into :b_employee_id from employees where last_name='&v_last_name'; end; / oracle-sqldeveloper procedural-programming share|improve this question edited Feb 10 '14 at 5:02 Bishan 5,2723198173 asked Feb 10 '14 at 5:00 user3291451 14113 add a comment| 2 Answers 2 active oldest votes up vote 3 down vote The error message is self explanatory. Your select statement returned more than one row. When you use the INTO clause the select cannot return more than one row. From the documentation: By default, a SELECT INTO statement must return only one row. Otherwise, PL/SQL raises the predefined exception TOO_MANY_ROWS and the values of the variables in the INTO clause are undefined. Make sure your WHERE clause is specific enough to only match one row If no rows are returned, PL/SQL raises NO_DATA_FOUND. You can guard against this exception by selecting the result of an aggregate function, such as COUNT(*) or AVG(), where practical. These functions are guaranteed to return a single value, even if no rows match the condition. share|improve thi
Digital Records Management Enterprise Content Management Strategy Digital Asset Management Oracle Imaging & Process Management Web Content Management Oracle WebCenter Portal Enterprise Portal Support Enterprise Portal Strategy Enterprise Portal Upgrade Oracle WebCenter Sites Sourcing Staffing & Recruiting Recruiting Managed Services Candidate Registration Technical Focus Client Opportunities Support Solutions Training Legacy to Oracle WebCenter Oracle Documents Cloud Service Next Generation AP Automation & Dynamic Discounting Oracle WebCenter Contract Lifecycle Management (CLM) Search ORA-01422: fetch returns more than requested number of rowsYou are here: Home / Resources / ORA-01422: fetch returns more than requested number of rows ORA-01422 A vast majority of Oracle errors can be broken down into two categories: memory & network problems and issues arising from improper use of syntax & phrasing. Many of the former errors involve interacting with a network administrator to determine where faulty connections and misaligned partitioning of memory are stemming from. The latter, which the ORA-01422 can most aptly identify with, concerns a user-initiated mistake resulting from either a typo or a misunderstanding of how Oracle functions may work. So what syntax mistakes are causing the ORA-01422 error? Why are they a problem? And most importantly, how can we fix it? Well, let’s start at the beginning and talk briefly about just what exactly an ORA-01422 really is. The Problem Oracle describes the ORA-01422 error as the “exact fetch” returning “more than requested number of rows”. The type of vague contextual clue that Oracle attaches to this message concerning the error’s origins can be quite infuriating initially. The basics of the problem derive from a failed SELECT INTO statement. This statement pulls data from one or more database tables and subsequently assigns the information to specified variables. In its default setting, the SELECT INTO statement will return one or more columns from a single specified row. This is where the error is being thrown. When an ORA-01422 is triggered, your SELECT INTO statement is retrieving multiple rows of data or none at all. If it is returning multiple, the predefined exception TOO_MANY_ROWS will be raised, and for no returns the PL/SQL will raise NO_DATA_FOUND. Because the SELECT INTO statement in its default setting is designed to retrieve only one row, the system responds with an error at either one. The Solution Ther