Home » Developer & Programmer » Forms » avoiding an ora-01422 error
avoiding an ora-01422 error [message #81687] Tue, 11 March 2003 11:33 Go to next message
Lionel
Messages: 3
Registered: May 2002
Junior Member
Hi,

Using the following sql/pl lines, to put a value in the var_A variable, I get an ORA-01422 error message...do you know how I could avoid this ?

declare
var_A varchar2(50);
begin
select fieldA into var_A from customers;
end;

This should be part of a longer script, with a fetch giving me a value that I will use in :
select fieldA into var_A from customers where fieldA = fetch_variableA;

Anyone can help ?
Re: avoiding an ora-01422 error [message #81689 is a reply to message #81687] Tue, 11 March 2003 12:07 Go to previous message
magnetic
Messages: 324
Registered: January 2003
Senior Member
ORA-01422 means exact fetch returns more than requested number of rows
so you should try to get 1 row back to put in the variable
add and rownum=1 to your code and get the first of the many rows to examine...
Previous Topic: block based on two tables
Next Topic: Re: Developer 6i Memory Leak (BUG)
Goto Forum:
  


Current Time: Wed Apr 24 19:41:00 CDT 2024