Oracle Error Codes 2112
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 2 of 2 Thread: Oracle 2112 error Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 10-26-2000,11:35 AM #1 anandg View Profile View Forum Posts Junior Member Join Date Oct 2000 Posts 1 Hi, I am getting SQL 2112 error when executing the Pro*C++ code. The problem is random, even when there is only one matching row for the query , this error is reported sometimes i find ORA 1306 occuring just before this error. we are using oracle 7.3.4.4 on HP UX 10.20. I would like to Know that this issue is OS Specific or Database specific. Any patches need to be installed. Could you guys can throw some light. Regards, Anand.G Reply With Quote 10-27-2000,02:41 PM #2 mber View Profile View Forum Posts Member Join Date Oct 2000 Posts 123 The error is because in SELECT ... INTO returns too many rows. Cause: A SELECT ... INTO statement returned more rows than can be stored in the host variable provided. Action: There are three possible solutions: Use the precompiler option SELECT_ERROR=NO. Declare a host variable with a larger array dimension. Declare a cursor or cursor variable for the select statement. Reply With Quote Quick Navigation Forum Archives Top Site Areas Settings Private Messages Subscriptions Who's Online Search Forums Forums Home Forums Oracle Forums Oracle Database Administration Oracle Applications DBA Oracle Development Oracle Certification Oracle : How To Oracle Careers Oracle Positions Available Oracle Job Wanted Archives Forum Archives Other Feedback and Questions regarding the forums Obfuscation Unlimited « Previous Thread | Next Thread » Posting Permissions You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is Off Smilies are Off [IMG] code is Off [VIDEO] code is Off HTML code is Off Forum Rules Contact Us DBAsupport.com Home Page Top Click Here to Expand Forum to Full Width All times are GMT -4. The time now is 01:20 PM.
many rows) Three error codes, which all mean the same thing: a query which syntactically must return a single row returns multiple rows.In a 3GL program, a SELECT ... INTO ... must return just one row. If a PL/SQL routine returns multiple rows, a 1422 is returned. The 2112 is returned from a precompilier program. The 1427 is returned when a subquery must return one row, and it does not. For example: SELECT .... WHERE column_name = (some subquery).This error is easy to verify: just run the query. If it returns more than one row there is nothing more to investigate. One situation where it may be tricky to http://www.dbasupport.com/forums/showthread.php?3608-Oracle-2112-error identfy is a PL/SQL program with this construct: SELECT ... INTO ... FROM ... WHERE column_name = variable_nameand the column_name and the variable_name are identical. For example: DECLARE this_column number; BEGIN SELECT COUNT(*) INTO KOUNT FROM SOME_TABLE WHERE this_column = this_column;This is ambiguous: does the right hand side represent SOME_TABLE.THIS_COLUMN,or the variable? PL/SQL takes it as the column name, and all rows get returned.The 1427 can also arise in an UPDATE statement:UPDATE .... SET column_name = (some http://blogs.orecreeksystems.com/2008/01/ora-1422-1427-2112-query-returns-two.html subquery)If the subquery returns two or more rows, a 1427 results.What to do:Knowing what is wrong is easy; fixing is another matter. In theory, you have misstated your query; just add additional predicates to make it return a single row. Problems arise when there is bad data (the query should return just one row, but it doesn't) or when you expect multiple rows, but really don't care. The first case is simple: just delete the duplicate data and add enough constraints to the application so that it can't happen again. Where the designer decided to have the application enforce constraints (because it is too much work for the poor database to enforce uniqueness) this may be difficult, and things may devolve into the second case.In the second case, you really can get multiple rows back; you just thought (possibly because of incomplete test cases) that you would just get one row back. As an example, you are given an e-mail address, and need to decide whether to go to the new account screen, or bring up an existing account. Normally, there is just one account, but a few people may have multiple accounts. If you need to know every account you have no choice but to replace the singleton select with a cursor. But, you may only need to know if there are multiple accounts; you do one thing if the
vid Type in oracle error text* *e.g.username (at least 3 characters long) ora amd aud dbv drg epc exp img imp kup lcd lfi lpx lrm lsx mod ncr nid nmp nnc nnf nnl nno npl nze o2f o2i o2u pcb pcc pcf pls qsm rman sql sql*loader tns vid Error type information..... Search tips..... Oracle Support Copyright © Ora-error 2004-2012, all rights reserved.