Re: Pl/Sql help...Immediate
Date: Sun, 22 Apr 2001 14:54:36 +0200
Message-ID: <9bukbr$cuqp$1_at_as121.tel.hr>
Hi!
Your select:
select amount_due_remaining
INTO v_amount_remaining from
AR_PAYMENT_SCHEDULES_ALL
where trx_number = V_INVOICE1;
probably doesn't return any rows, and that's why you're getting "no data
found".
If you use SELECT ... INTO ... your select must return EXACTLY ONE ROW. If there are no rows you get "no data found". If there are more that ona row you get "too many rows".
Try declaring a cursor instead of using select ... into.
BTW, I think that it's much more elegant to use cursor FOR loops than using OPEN ... FETCH ... CLOSE. Dado
"Jack Dawson" <srik_at_cnet.com> wrote in message
news:9bkh3a$rao$1_at_innbox.cnet.com...
> Can someone help me out on this issue? I am trying hard since yesterday
but
> cannot make out what the mistake is...
>
> The select statments in the code has data in it.
> Is everything ok on line 11 and line 12?
>
> 1 DECLARE
> 2 v_invoice1 varchar2(30);
> 3 v_amount_applied1 number;
> 4 v_amount_remaining number;
> 5 cursor c_test is
> 6 select INVOICE1, amount_applied1 from ar_payments_interface_all
where
> record_type = 4;
> 7 begin
> 8 open c_test;
> 9 loop
> 10 fetch c_test into v_invoice1, v_amount_applied1;
> 11 select amount_due_remaining INTO v_amount_remaining from
> AR_PAYMENT_SCHEDULES_ALL
> 12 where trx_number = V_INVOICE1;
> 13 end loop;
> 14* end;
> SQL> /
> DECLARE
> *
> ERROR at line 1:
> ORA-01403: no data found
> ORA-06512: at line 11
>
> Appreciate your help
> Thanks
> Srikanth
>
>
Received on Sun Apr 22 2001 - 14:54:36 CEST