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

Home -> Community -> Usenet -> c.d.o.server -> Q :

Q :

From: Srini Narayanan <Narayana.Srinivas_at_alliedsignal.com>
Date: 1997/07/24
Message-ID: <33D7C73D.6220@alliedsignal.com>#1/1

Hi,

I want to write a function repeat which i would be using in select statments.

My question is this : How do i give an exception

create or replace function repeat(str varchar, n number ) return varchar as

ostr     varchar(2000) := NULL;
i       number(3) := 1;

str_err exception ;
begin

    while i <= n loop

        ostr := ostr||str ;
        if( length(ostr) >= 10 ) then
            raise str_err ;
        end if;
        i := i + 1 ;

    end loop ;
    return ostr ;
exception
      dbms_output.put_line('The field is greater tha MAX') ;         
          

end ; Received on Thu Jul 24 1997 - 00:00:00 CDT

Original text of this message

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