Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

cursor for loop check last row to fetched

user560737Sep 27 2019 — edited Sep 30 2019

Hello to all

Ho can check in a cursor for loop, the last row that I am get, that is,

FOR R_SDO_A0 IN (SELECT ALL a||b||c  as REC_A0  )

loop

LINE_BUFF := TO_CHAR (R_SDO_A0.REC_A0) ;

if <NOT lastrow then>

    LINE_BUFF := LINE_BUFF   ||chr(10);

end if;

UTL_FILE.PUT( FILEID ,LINE_BUFF);

end loop

UTL_FILE.FCLOSE(FILEID);

because  I have to create a file without chr(10) on last row + 1, otherwiese I get it after I write lastrow in the file,

thanks in advance

Comments
Post Details
Added on Sep 27 2019
18 comments
3,746 views