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: debugging an Oracle function??

Re: debugging an Oracle function??

From: Frank <fvanbortel_at_netscape.net>
Date: Thu, 13 Feb 2003 20:32:15 +0100
Message-ID: <3E4BF2BF.7030302@netscape.net>


Rauf Sarwar wrote:
> Frank <fvanbortel_at_netscape.net> wrote in message news:<3E4A94B9.4080801_at_netscape.net>...
>

>>select QuestionTypeForQuestionId(1) from dual;

>
>
> You cannot print dbms_output via select query. It will only print
> returned value from function but dbms_output.put_line is a procedure,
> thus, calling function must be enclosed inside begin end; block.
>
> set serverout on
> declare
> ret_ varchar2(100); -- This is for function return value
> val_ number := 1;
> begin
> ret_ := QuestionTypeForQuestionId(val_);
> end;
> /
>
> This will print all your dbms_output statements from the function.
>
> Regards
> /Rauf Sarwar

You are right - I missed the dbms_output stuff. The easiest way to test (probably _not_ debug) a function is to use it in a simple select statement.

-- 
Regards, Frank van Bortel
Received on Thu Feb 13 2003 - 13:32:15 CST

Original text of this message

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