Home » Developer & Programmer » Forms » error while getting more than values
error while getting more than values [message #675520] Wed, 03 April 2019 05:46 Go to next message
compuscience
Messages: 97
Registered: September 2012
Member
i need to make loop to get column from select statment

by the following code if i have one record the code run okay
if i have more than one i get error ora-01422
PROCEDURE hide IS
  name_v varchar2(50);
BEGIN
  select name 
  into name_v 
  from maxit
  where tag_no = :global.tag_no;

  if name_in ('system.cursor_item') = name_v then
     next_item;
  end if;

  set_item_property(name_v,visible,property_false);
END;

[EDITED by LF: reformatted, applied [code] tags]

[Updated on: Wed, 03 April 2019 15:31] by Moderator

Report message to a moderator

Re: error while getting more than values [message #675522 is a reply to message #675520] Wed, 03 April 2019 06:07 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
Yes select into throws too_many_rows if there's more than one that matches the where clause. That's by design.
Maybe you want to use a for loop?
Re: error while getting more than values [message #675523 is a reply to message #675520] Wed, 03 April 2019 06:12 Go to previous messageGo to next message
compuscience
Messages: 97
Registered: September 2012
Member
may you help me in this case with for statment


this is a procedure in oracle forms 6i
Re: error while getting more than values [message #675524 is a reply to message #675523] Wed, 03 April 2019 06:18 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
You don't know how to write a for loop?
Go read a book on PL/SQL or go on a training course.

If you do know how to write a for loop then you need to be more specific as to what the actual problem is.

Re: error while getting more than values [message #675525 is a reply to message #675524] Wed, 03 April 2019 06:20 Go to previous messageGo to next message
compuscience
Messages: 97
Registered: September 2012
Member
no i don't say that
i don't know how to made it at this procedure
may you help me
Re: error while getting more than values [message #675529 is a reply to message #675525] Wed, 03 April 2019 08:32 Go to previous message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
Well I've no idea what you actually want that procedure to do.
It's hard to work out what someone wanted some code to do when the only thing you've got to work with is some code that doesn't do what they wanted.

Explain in words what you want the code to do.
Previous Topic: FRM-50026 date must be entered in a format like DD-MON-YYYY
Next Topic: how can i get first item in tab page
Goto Forum:
  


Current Time: Thu Mar 28 10:28:09 CDT 2024