Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Create a user defined function
Laurenz Albe schrieb:
> DA Morgan <damorgan_at_psoug.org> wrote:
> >> CREATE OR REPLACE FUNCTION "UF_EMPLIST"
> >> (
> >> id in int,
> >> delim in VARCHAR2 default ';'
> >> )
> >>
> >> return VARCHAR2
> >> is
> >> /* declare select for cursor */
> >> cursor empCursor is
> >>
> >> str_return VARCHAR2(32767);
> >> str_val VARCHAR2(255);
> >>
> >> begin
> >>
> >> /* open empCursor */
> >> open empCursor;
> >>
> >> loop
[lost of conditions]
> >> end UF_EMPLIST_ORDER;
> >
> > Solved it perhaps but with horribly inefficient code. There is
> > almost no place in Oracle (9i or above) where a cursor loop is
> > a good idea.
> >
> > Take a look at array processing instead. You will find examples
> > in Morgan's Library at www.psoug.org. Click on Bulk Binding.
>
thanks you both for your response,
okay i'll give the array solution a try, since performance is an issue
Best regards,
Alex
Received on Mon Mar 13 2006 - 08:32:57 CST