1

Topic: No_Data_Found In the cursor

I write here such cursor:

declare
Cursor c1 (cur NUMBER) Is
select distinct p.profile_id
from system_c b
join profile p
on b.client_id=p.client_id
where b.system_cid=1234
Type oper_value Is Table Of c1%ROWTYPE;
oper_row oper_value;
cur NUMBER;
rows PLS_INTEGER: = 10000;
i PLS_INTEGER;
n_ProfileId number;
begin
Open c1 (cur);
Loop
Fetch c1 Bulk Collect
Into oper_row Limit rows;
Exit When oper_row. COUNT = 0;
Forall i In 1. oper_row. COUNT
select oper_row (i).profile_id
into n_ProfileId
from dual;
DBMS_OUTPUT.PUT_LINE (i);
End loop;
Close c1;
oper_row.delete;
end;

And at line Forall i In - there is error No_Data_Found
Why it is interesting so, after all in select produces records

2

Re: No_Data_Found In the cursor

RMagistr2015;
You about forall esteem at first

3

Re: No_Data_Found In the cursor

RTFM FORALL Statement: dml_statement (FAQ)

4

Re: No_Data_Found In the cursor

Alex __ kK;
Yes, I will go I will have a sleep

5

Re: No_Data_Found In the cursor

RMagistr2015;
In the first rectify errors in the code))
It can is just necessary for you?

for i in (select distinct p.profile_id
from system_c b
join profile p
on b.client_id=p.client_id
where b.system_cid=1234)
loop
 happens
end loop;
select oper_row (i).profile_id
into n_ProfileId
from dual;

- what for it to do?

DBMS_OUTPUT.PUT_LINE (i);

- that you wanted to deduce it?
Again , without reading of the documentation and without understanding of bases.

6

Re: No_Data_Found In the cursor

saxarock;
It is an example

7

Re: No_Data_Found In the cursor

RMagistr2015;
No, with  took.

8

Re: No_Data_Found In the cursor

RMagistr2015;
Example in which you are not clear that do also the most important thing what for) from one butt pour in another, thus still using a fork - so it looks.

9

Re: No_Data_Found In the cursor

saxarock;

for i in (select distinct p.profile_id
from system_c b
join profile p
on b.client_id=p.client_id
where b.system_cid=1234)
loop
 happens
end loop;

And as to me here to save value of i th field profile_id
In a variable?

10

Re: No_Data_Found In the cursor

saxarock;
Found, thanks

11

Re: No_Data_Found In the cursor

RMagistr2015;

saxarock wrote:

it can is just necessary for you?

- here I wrote it to the first.

RMagistr2015 wrote:

And as me here to save value of i th field profile_id
In a variable?

peremennaya: = oper_row (/*naprimer*/1).profile_id; - but it is not mandatory that it is the first element of a collection

12

Re: No_Data_Found In the cursor

saxarock;
Yes, perfectly fulfilled, thanks)