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-01403: no data found when displaying a value from an array

745303Jan 8 2010 — edited Jan 9 2010
I have a very simple pl/sql procedure like below which gives an error

SQL> exec p_ks2;
BEGIN p_ks2; END;

*
ERROR at line 1:
ORA-01403: no data found
ORA-06512: at "KINASE.P_KS2", line 21
ORA-06512: at line 1

if i uncomment the for loop the procedure works ... the loop has nothing to do with my array or what i am doing after it..

could anyone help me to understand why i need a loop like that or what i am doing wrong when i am not having the loop there.

---- procedure
CREATE OR REPLACE
PROCEDURE p_ks2 as

TYPE mdata IS TABLE OF number INDEX BY BINARY_INTEGER;
data1 mdata;
k integer;
m number;

begin
data1(1) := 10;
data1(2) := 20;
data1(3) := 30;
data1(4) := 40;
data1(5) := 50;

k :=3;
--for mm in 10..11
--loop
-- m := mm;
--end loop;

dbms_output.put_line('value of data(' || k || '): ' || data1(k));

end;
/
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 6 2010
Added on Jan 8 2010
10 comments
2,175 views