Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL Question

Re: PL/SQL Question

From: James Lorenzen <james_lorenzen_at_allianzlife.com>
Date: Fri, 05 Nov 1999 21:15:13 GMT
Message-ID: <7vvhct$9fa$1@nnrp1.deja.com>


The "FOR record IN cursor LOOP" logic performs the OEPN, FETCH, CLOSE for you. The CLOSE and OPEN statements are not needed the way your program is written.

HTH
    James

In article <7vve2i$6pg$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 - 15:15:13 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US