Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: ORA-06503 Function returned without Value
On Sat, 20 Mar 1999 14:19:53 -0700, "Gerry West"
<gwest_at_skyconnect.com> wrote:
>CREATE OR REPLACE FUNCTION openConfigLogfile( i_log_handle IN OUT
>UTL_FILE.FILE_TYPE )
>RETURN UTL_FILE.FILE_TYPE IS
>BEGIN
> /* Make sure the file is closed first. */
> IF UTL_FILE.IS_OPEN(i_log_handle) THEN
> UTL_FILE.FCLOSE(i_log_handle);
> END IF;
>
> /* Open the file for writing. */
> i_log_handle := UTL_FILE.FOPEN('/usr/oracle8/install',
>'nvod_config.log', 'a');
>
>EXCEPTION
> WHEN UTL_FILE.INVALID_PATH THEN
> RAISE_APPLICATION_ERROR(-20100, 'Reset: Invalid Path');
> WHEN UTL_FILE.INVALID_MODE THEN
> RAISE_APPLICATION_ERROR(-20101, 'Reset: Invalid Mode');
> WHEN UTL_FILE.INVALID_OPERATION THEN
> RAISE_APPLICATION_ERROR(-20101, 'Reset: Invalid Operation');
>
>RETURN i_log_handle;
>END openConfigLogfile;
>/
Your RETURN command applies only to the INVALID_OPERATION exception,
not to the function's body. You should put the RETURN before the
EXCEPTION.
HTH,
Jurij Modic <jmodic_at_src.si>
Certified Oracle7 DBA (OCP)
![]() |
![]() |