Home » SQL & PL/SQL » SQL & PL/SQL » Associative array - no data found
Associative array - no data found [message #573463] Fri, 28 December 2012 23:55 Go to next message
satajju
Messages: 1
Registered: December 2012
Location: India
Junior Member
I am also facing the same issue, Please find the sample of code which is giving me the same error.Please let me know whts wrong with below piece of code.

Programe
declare
cursor c1 is select * from x1;
l_x1 type1;
l_x2 type2;
l_num number :=0;
begin
for r1 in c1 loop
l_x1(l_num) := r1.x1;
l_x2(l_num) := r1.x2;
l_num := l_num +1;
if l_num >= 60 then
proc1(l_num,l_x1,l_x2);
l_num := 0;
end if;
end loop
end;

procedure proc1(l_num un ,l_x1 in type1,l_x2 in type2) as
s1 table.c1%type;
s2 table.c1%type;
begin
for Arrayelement in 1..l_num loop
s1 := l_x1(Arrayelement);
s2 := l_x2(Arrayelement);
---
---
end loop
---
end proc1;

[Messages split from this topic by LF]

[Updated on: Sat, 29 December 2012 02:38] by Moderator

Report message to a moderator

Re: Associative Array help - no data found [message #573466 is a reply to message #573463] Sat, 29 December 2012 00:38 Go to previous messageGo to next message
BlackSwan
Messages: 22839
Registered: January 2009
Senior Member
ERROR? What Error?
How can we reproduce what you claim?


Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/
Re: Associative Array help - no data found [message #573469 is a reply to message #573463] Sat, 29 December 2012 01:51 Go to previous messageGo to next message
Michel Cadot
Messages: 59279
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.

Use SQL*Plus and copy and paste your session, the WHOLE session.

Regards
Michel
Re: Associative array - no data found [message #573481 is a reply to message #573463] Sat, 29 December 2012 07:33 Go to previous message
flyboy
Messages: 1771
Registered: November 2006
Senior Member
satajju wrote on Sat, 29 December 2012 06:55
Please find the sample of code which is giving me the same error.Please let me know whts wrong with below piece of code.

Is it a quiz questions? OK, here are some ones for you:
Concentrate on the first iteration of the LOOP (L_NUM=0 in the start).
What is the value of L_NUM when filling the associative arrays?
What is the value of L_NUM when calling the procedure?
Does the member with latter L_NUM index exist in associative arrays?
Could just change of line order (e.g. incrementing L_NUM before the assignment) assure that both values will be the same (and so the element with its index will exist in the associative arrays)?
Are you really unable to follow the code flow (=understand steps, which your code does)?
Previous Topic: How we can run pl/sql procedure in parallel
Next Topic: Please help me on how to pass date condition Dynamically.
Goto Forum:
  


Current Time: Tue Sep 30 15:44:04 CDT 2014

Total time taken to generate the page: 0.10479 seconds