Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL Question
Hi.
The "FOR ... LOOP" - opens your cursor and it is
closed by PL/SQL at "END LOOP".
So you are trying to close closed cursor.
When using cursor loops OPEN and CLOSE are issued
automatically by PL/SQL. You don't use these command.
HTH. Michael.
In article <7vve1e$6p9$1_at_nnrp1.deja.com>,
amerar_at_ci.chi.il.us wrote:
>
>
> Hello,
>
> This code is giving me an invalid cursor. What is wrong with it? It
is
> going down on the CLOSE statement.......
>
> CURSOR revanal_strts_cursor IS
> select * from tx_street_sanitation;
>
> BEGIN
> UTL_FILE_HANDLE1 := UTL_FILE.FOPEN
(UTL_PATH,UTL_STRTS_FILENAME,'w');
>
> FOR v_revanal_strts_curs_rec IN revanal_strts_cursor
> LOOP
> v_strts_rec_read := v_strts_rec_read + 1;
> v_strts_batch_amt := v_strts_batch_amt +
> TO_NUMBER(NVL(v_revanal_strts_curs_rec.amt_cash,0)) +
> TO_NUMBER(NVL(v_revanal_strts_curs_rec.amt_check,0)) +
> TO_NUMBER(NVL(v_revanal_strts_curs_rec.amt_credit,0));
> END LOOP;
> UTL_FILE.PUT_LINE(UTL_FILE_HANDLE1,
> 'BH' || '99 ' ||
> TO_CHAR(sysdate,'DD') ||
> LPAD(SUBSTR(TO_CHAR(v_strts_rec_read),7,4),4,'0') ||
> LPAD(TO_CHAR(v_strts_batch_amt),10,'0') ||
> TO_CHAR(sysdate,'MMDDYY') ||
> LPAD(' ',53,' '));
>
> CLOSE revanal_strts_cursor;
> OPEN revanal_strts_cursor;
>
> FOR v_revanal_strts_curs_rec IN revanal_strts_cursor
> LOOP
> BEGIN
> .
> .
> .
> .
>
> Anyone see anything?
>
> Thanks,
>
> Arthur
> amerar_at_ci.chi.il.is
>
> ps. Please cc copy to e-mail
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Fri Nov 05 1999 - 16:14:42 CST
![]() |
![]() |