Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-01422 Error

764655Aug 30 2010 — edited Aug 31 2010
I keep receiving ORA-01422: exact fetch returns more than requested number of rows. I threw in an exception handler just to see if it was possibly something else.

I'm not exactly sure why I'm receiving this error....

well I just found out that my organization had to cut all of their consultants and I just became the new report writer!..........one of the benefits of working for a charitable organization :)


Also, I became the report write because I have limited experience with SQL but no experience in PL/SQL


Any ideas on why I am receiving this error? Is there a work around??



System info:

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
"CORE 10.2.0.4.0 Production"
TNS for 64-bit Windows: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production



Declare
V_A Number := 63 ;
v_Comment VARCHAR2(55);
BEGIN
Select
geo_val Into
V_A
From
Ci_Prem_Geo;
If V_A > 90 Then
V_Comment := 'Invalid Sub Number';
Elsif V_A > 100 Then
v_Comment := 'Cross Reference CIS Number';
Else
v_Comment := 'Please Contact Operations';
End If;
End;






Declare
V_A Number := 63 ;
v_Comment VARCHAR2(55);
BEGIN
Select
geo_val Into
V_A
From
Ci_Prem_Geo;
If V_A > 90 Then
V_Comment := 'Invalid Sub Number';
Elsif V_A > 100 Then
v_Comment := 'Cross Reference CIS Number';
Else
v_Comment := 'Please Contact Operations';
End If;
exception
When Others Then
DBMS_OUTPUT.PUT_LINE('An error occurred.');
End;

Edited by: user9232299 on Aug 30, 2010 10:10 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 28 2010
Added on Aug 30 2010
4 comments
1,134 views