1422 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 1422
Humor Advertisement Oracle Basics ALIASES AND AND & OR BETWEEN COMPARISON oracle error 1422 encountered OPERATORS DELETE DISTINCT EXISTS FROM GROUP BY HAVING IN INSERT INSERT ALL INTERSECT IS NOT NULL IS NULL
Oracle Error Codes
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 sqlcode 1422 Oracle Transactions Oracle Triggers String/Char Functions Numeric/Math Functions Date/Time Functions Conversion Functions Analytic Functions Advanced Functions Oracle / PLSQL: ORA-01422 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 tried ora-01422 in oracle forms 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
Ora-01422 Exception Handling
title. You can not post a blank message. Please type your message the number specified in exact fetch is less than the rows returned. and try again. More discussions in PL/SQL and SQL All PlacesDatabaseDatabase Application DevelopmentPL/SQL and SQL This discussion is archived
Ora 01422 Unhandled Exception
10 Replies Latest reply 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! https://www.techonthenet.com/oracle/errors/ora01422.php When my proc is getting 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! 32311Views Tags: none https://community.oracle.com/thread/364848 (add) This content has been marked as final. 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 7
here for a quick overview of the site http://stackoverflow.com/questions/19779483/pl-sql-ora-01422-exact-fetch-returns-more-than-requested-number-of-rows Help Center Detailed answers to any questions you might http://stackoverflow.com/questions/18477741/pl-sql-group-by-ora-01422-exact-fetch-returns-more-than-requested-number-of-r 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 in oracle Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up PL/SQL ORA-01422: exact fetch returns more than requested number of rows up 1422 error in vote 10 down vote favorite 4 I get keep getting this error I can't figure out what is wrong. "DECLARE * ERROR at line 1: ORA-01422: exact fetch returns more than requested number of rows ORA-06512: at line 11" Here is my code. DECLARE rec_EMPID EMPLOYEE.EMPID%TYPE; rec_ENAME EMPLOYEE.ENAME%TYPE; rec_JOB EMPLOYEE.DESIGNATION%TYPE; rec_SAL EMPLOYEE.SALARY%TYPE; rec_DEP DEPARTMENT.DEPT_NAME%TYPE; BEGIN SELECT EMPLOYEE.EMPID, EMPLOYEE.ENAME, EMPLOYEE.DESIGNATION, EMPLOYEE.SALARY, DEPARTMENT.DEPT_NAME INTO rec_EMPID, rec_ENAME, rec_JOB, rec_SAL, rec_DEP FROM EMPLOYEE, DEPARTMENT WHERE EMPLOYEE.SALARY > 3000; DBMS_OUTPUT.PUT_LINE ('Employee Nnumber: ' || rec_EMPID); DBMS_OUTPUT.PUT_LINE ('---------------------------------------------------'); DBMS_OUTPUT.PUT_LINE ('Employee Name: ' || rec_ENAME); DBMS_OUTPUT.PUT_LINE ('---------------------------------------------------'); DBMS_OUTPUT.PUT_LINE ('Employee Designation: ' || rec_JOB); DBMS_OUTPUT.PUT_LINE ('----------------------------------------------------'); DBMS_OUTPUT.PUT_LINE ('Employee Salary: ' || rec_SAL); DBMS_OUTPUT.PUT_LINE ('----------------------------------------------------'); DBMS_OUTPUT.PUT_LINE ('Employee Department: ' || rec_DEP); END; / oracle plsql oracle11g sqlplus share|improve this question asked Nov 4 '13 at 23:46 Hiram 56114 add a comment| 1 Answer 1 activ
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 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 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up PL/SQL Group By - ORA-01422: exact fetch returns more than requested number of rows up vote 2 down vote favorite 1 I am writing the following query that I want to display car registration, car group name, model name, cost and the number of bookings for each car. I have to use an explicit cursor and I have to use an implicit cursor to calculate the number of bookings that belong to each car. My query is as follows: SET SERVEROUTPUT ON FORMAT WRAP SIZE 12000 Declare v_count number; cursor carcur IS SELECT * FROM i_car; v_car carcur%ROWTYPE; Begin Select COUNT (registration) INTO v_count from i_booking group by registration; FOR v_car IN carcur LOOP DBMS_OUTPUT.PUT_LINE('Registration:'|| ' '|| v_car.registration); DBMS_OUTPUT.PUT_LINE('Car Group:'|| ' ' ||v_car.car_group_name); DBMS_OUTPUT.PUT_LINE('Model Name:'|| ' '||v_car.model_name); DBMS_OUTPUT.PUT_LINE('Cost:'|| ' '||v_car.cost); DBMS_OUTPUT.PUT_LINE('Total Bookings:'|| ' '||v_count); DBMS_OUTPUT.NEW_LINE; END LOOP; End; The output I am getting is as follows: Declare * ERROR at line 1: ORA-01422: exact fetch returns more than requested number of rows ORA-06512: at line 7 I am sure it has something to do with the return values being put into the variable, but I have no idea how to rectify this. Any advice would be greatly appreciated. Many thanks. sql oracle plsql oracle11g oracle10g share|improve this question asked Aug 28 '13 at 0:53 Splunk 1092414 add a comment| 3 Answers 3 active oldest votes u