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 Questions

Re: PL/SQL Questions

From: Patrick Lanphier <planphier_at_psu.edu>
Date: Tue, 03 Nov 1998 03:44:30 +0000
Message-ID: <363E7C1E.C70C0519@psu.edu>


Ed Wallace wrote:
>
> Two questions - 1st - knowing that I'm not supposed to use an exit to
> terminate a cursor FOR loop, what is the best way to get a single 'row' of
> data? Is a cursor even the best way? One example of where I am doing this
> is I am selecting and ordering data. I am fetching into a list of
> variables the first ordered occurrence of this data. These variables are
> then written to an output file. Then I exit my cursor. Any better way to
> do this?

why not something like there nothing wrong with it.

cursorc is select * from table

begin
open c;
fetch c into recinfo;
if (c%notfound) then

	close c;
	blah blah blah;

end if ;
close c;

>
> 2nd - Another problem I've come across is when I am fetching data from a
> cursor to make up a fixed width output file, one of the fields may contain
> tabs or carriage returns, which messes up the fixed-width file as they are
> interpreted. What is the best way to get rid of them or ignore them? Do I
> need to scan the string and do a replace or something?

Use a replace
>
> Thanks in advance
>
> Ed
Received on Mon Nov 02 1998 - 21:44:30 CST

Original text of this message

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