Home > exact fetch > oracle sql error 1422

Oracle Sql Error 1422

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 the number specified in exact fetch is less than the rows returned DELETE DISTINCT EXISTS FROM GROUP BY HAVING IN INSERT INSERT ALL INTERSECT IS NOT NULL IS NULL ora 01422 unhandled exception 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

Exact Fetch Returns More Than Requested Number Of Rows Cursor

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 in cursor for loop 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.

SQL TuningSecurityOracle UNIXOracle LinuxMonitoringRemote supportRemote plansRemote servicesApplication Server ApplicationsOracle FormsOracle PortalApp UpgradesSQL ServerOracle ConceptsSoftware SupportRemote Support Development Implementation Consulting StaffConsulting oracle too many rows PricesHelp Wanted! Oracle PostersOracle Books Oracle Scripts Ion Excel-DB

Ora-01422 Select Into

Don Burleson Blog

Trigger Raised Unhandled Exception Ora 01422

ORA-01422: exact fetch returns more than one requested number of rows tips Oracle Error Tips by Burleson Consulting Oracle docs note https://www.techonthenet.com/oracle/errors/ora01422.php this about ORA-01422: ORA-01422: exact fetch returns more than requested number of rows Cause: The number specified in exact fetch is less than the rows returned. Action: Rewrite the query or change number of rows requested You may also be interested in this community troubleshooting from Oracle Forums: Question: http://www.dba-oracle.com/sf_ora_01422_exact_fetch_returns_more_than_one_requested_number_of_rows.htm I continue to receive this ORA-01422 message whenever I get to this stage in the process: 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 Answer: There are several options to resolve ORA-01422, which take some time to figure out which option is appropriate for you. Here are some things you may want to try: This is most likely signifying that you have updated multiple rows. Because of this, Oracle throws the ORA-01422 error because it is not able to return the variables in simple variables. To remedy this, try BULK COLLECT in a table such as the below: SQL> declare 2 type num_tab is table of number; 3 empno_tab num_tab; 4 begin 5 up

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and http://stackoverflow.com/questions/21669419/ora-01422-exact-fetch-returns-more-than-requested-number-of-rows-ora-06512-at policies of this site About Us Learn more about Stack Overflow the https://www.tekstream.com/resources/ora-01422-exact-fetch-returns-more-than-requested-number-of-rows/ 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 programmers, just like you, helping each other. Join them; it only takes exact fetch 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 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 oracle sql error 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 this answer answered Feb 10 '14 at 5:02 wdosanjos 3,9701618 add a comment| Did you find this question interesting? Try our newsletter Sign up for our newsletter and get our top new questions delivered to your inbox

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 return

 

Related content

01422 error

Error table id toc tbody tr td div id toctitle Contents div ul li a href Ora- Exact Fetch Returns More Than Requested Number Of Rows Ora- a li li a href The Number Specified In Exact Fetch Is Less Than The Rows Returned a li li a href Ora- In Cursor For Loop a li li a href Trigger Raised Unhandled Exception Ora a li ul td tr tbody table p MySQL MariaDB PostgreSQL SQLite MS Office Excel Access Word Web Development HTML CSS Color Picker Languages relatedl C Language More ASCII Table Linux UNIX Java p h id

01422 error in

Error In table id toc tbody tr td div id toctitle Contents div ul li a href Ora- Exact Fetch Returns More Than Requested Number Of Rows Ora- a li li a href The Number Specified In Exact Fetch Is Less Than The Rows Returned a li li a href Ora- In Cursor For Loop a li li a href Trigger Raised Unhandled Exception Ora a li ul td tr tbody table p MySQL MariaDB PostgreSQL SQLite MS Office Excel Access Word Web Development HTML CSS Color Picker Languages C relatedl Language More ASCII Table Linux UNIX Java Clipart Techie

error ora 01422 exact fetch returns

Error Ora Exact Fetch Returns table id toc tbody tr td div id toctitle Contents div ul li a href Ora Unhandled Exception a li li a href Ora- Select Into a li li a href exact Fetch Returns More Than Requested Number Of Rows Cursor a li ul td tr tbody table p Kyte Last updated September - am UTC Category Developer Version Latest Followup You Asked Hi relatedl Tom I'm trying to execute SQL statment but the ora- exception handling result is ORA- exact fetch returns more than requested number of ora- in oracle forms rows Cause More

how to handle ora-01422 error

How To Handle Ora- Error table id toc tbody tr td div id toctitle Contents div ul li a href Ora- Exception Handling a li li a href Ora- In Oracle Forms a li li a href Ora Unhandled Exception a li ul td tr tbody table p Kyte Last updated September - am UTC Category Developer Version Latest Followup You Asked Hi Tom I'm trying to execute SQL statment but the result is ORA- exact fetch returns relatedl more than requested number of rows Cause More rows were returned ora- exact fetch returns from an exact fetch than specified

ora-01422 error handling

Ora- Error Handling table id toc tbody tr td div id toctitle Contents div ul li a href Ora- Select Into a li li a href Trigger Raised Unhandled Exception Ora a li li a href Frm- Ora- a li ul td tr tbody table p the flexible error trapping and error handling you can use in your PL SQL programs For more information on error-handling and exceptions in PL SQL see PL SQL Error relatedl Handling in Oracle Database PL SQL Language Reference See the end ora- exact fetch returns of this chapter for TimesTen-specific considerations The following topics

oracle error #1422 in the target program

Oracle Error In The Target Program table id toc tbody tr td div id toctitle Contents div ul li a href Ora- Exception Handling a li li a href Ora Unhandled Exception a li li a href Exact Fetch Returns More Than Requested Number Of Rows Cursor a li li a href Frm- Post-query Trigger Raised Unhandled Exception Ora- a li ul td tr tbody table p p p p p p

oracle error 1422 encountered

Oracle Error Encountered table id toc tbody tr td div id toctitle Contents div ul li a href Ora- Exception Handling a li li a href Ora Unhandled Exception a li li a href Oracle Too Many Rows a li li a href Ora- Select Into a li ul td tr tbody table p MySQL MariaDB PostgreSQL SQLite MS Office Excel Access Word Web Development HTML CSS Color Picker Languages C relatedl Language More ASCII Table Linux UNIX Java Clipart Techie ora exact fetch returns more than requested number of rows oracle Humor Advertisement Oracle Basics ALIASES AND AND OR

oracle error 1422

Oracle Error table id toc tbody tr td div id toctitle Contents div ul li a href Ora- Exception Handling a li li a href Oracle Too Many Rows a li li a href Ora- In Cursor For Loop a li li a href Ora- Select Into a li ul td tr tbody table p MySQL MariaDB PostgreSQL SQLite MS Office Excel Access Word Web Development HTML CSS Color Picker Languages C relatedl Language More ASCII Table Linux UNIX Java Clipart Techie p h id Ora- Exception Handling p Humor Advertisement Oracle Basics ALIASES AND AND OR BETWEEN COMPARISON OPERATORS

oracle error code 1422

Oracle Error Code table id toc tbody tr td div id toctitle Contents div ul li a href Ora- Exception Handling a li li a href Exact Fetch Returns More Than Requested Number Of Rows Cursor a li li a href Ora- In Cursor For Loop a li li a href Ora- Select Into a li ul td tr tbody table p 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 relatedl back on and reload this page

oracle error codes ora-01422

Oracle Error Codes Ora- table id toc tbody tr td div id toctitle Contents div ul li a href The Number Specified In Exact Fetch Is Less Than The Rows Returned a li li a href Trigger Raised Unhandled Exception Ora a li li a href Oracle Too Many Rows a li ul td tr tbody table p MySQL MariaDB PostgreSQL SQLite MS Office Excel Access Word Web Development HTML CSS Color Picker Languages C relatedl Language More ASCII Table Linux UNIX Java Clipart Techie ora- exact fetch returns more than requested number of rows ora- Humor Advertisement Oracle Basics

oracle error message ora-01422

Oracle Error Message Ora- table id toc tbody tr td div id toctitle Contents div ul li a href Ora- In Cursor For Loop a li li a href Ora- Select Into a li ul td tr tbody table p Kyte Last updated September - am UTC Category Developer Version Whilst you are here check out some content from the AskTom team Planning relatedl for trouble comments on my latest Oracle Magazine article Latest ora- exact fetch returns more than requested number of rows ora- Followup You Asked Hi Tom I'm trying to execute SQL statment but the result is

provider error ora-01422

Provider Error Ora- table id toc tbody tr td div id toctitle Contents div ul li a href Ora- Exact Fetch Returns More Than Requested Number Of Rows Ora- a li li a href Ora Unhandled Exception a li li a href Ora- In Cursor For Loop a li li a href Frm- Post-query Trigger Raised Unhandled Exception Ora- a li ul td tr tbody table p MySQL MariaDB PostgreSQL SQLite MS Office Excel Access Word Web Development HTML CSS Color relatedl Picker Languages C Language More ASCII Table Linux p h id Ora- Exact Fetch Returns More Than Requested