| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Q :
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;
while i <= n loop
ostr := ostr||str ;
if( length(ostr) >= 10 ) then
raise str_err ;
end if;
i := i + 1 ;
dbms_output.put_line('The field is greater tha MAX') ;
end ; Received on Thu Jul 24 1997 - 00:00:00 CDT
![]() |
![]() |