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
Is not null in sql?
Why we use triggers in mysql?
What is the purpose of the sql select top clause?
What is sql in oracle?
How do I view a sql trace file?
How many parts of a pl sql block are optional?
What is the most restrictive isolation level? : Transact sql
Why plvtab is considered as the easiest way to access the pl/sql table?
what are all different types of collation sensitivity? : Sql dba
How many databases can sql express handle?
How do I get sql certification?
Can we use the cursor's to create the collection in PL/SQL?
what is data control language? : Sql dba
What is sql*plus?
Is sql port 1433 encrypted?