can i use dbms_output.put_line in a function u are telling
as return statement

Answer Posted / gourvendra singh

Yes we can use the dbms_output.put_line in a function and
it will print the msg when we execute Function_name, it
will not display any value if we use the function to return
a value, consider the following code:
create or replace function abc_test return char is
a varchar2(20);
begin
select dname into a from dept where deptno=20;
dbms_output.put_line('the dept is ');
return a;
exception
when others then
a:='no dept';
dbms_output.put_line('the dept is ');
return a;
end;

this will work.

Is This Answer Correct ?    5 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the current version of sql?

734


how is myisam table stored? : Sql dba

782


What is cross join sql?

684


Can we call stored procedure in function?

706


what is a cursor? : Sql dba

745






What is nosql db?

712


What are %type and %rowtype for?

808


Is sql considered coding?

763


What is sql basics?

782


what is 'mysqladmin' in mysql? : Sql dba

744


how many groups of data types? : Sql dba

728


What is rename command in sql?

667


how to implement one-to-one, one-to-many and many-to-many relationships while designing tables? : Sql dba

730


How many types of triggers exist in pl/sql?

730


Can we create foreign key without primary key?

705