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
Will truncate release space?
How do I create a memory optimized filegroup?
What is set serveroutput on?
What is the purpose of the primary key?
How run sql*plus commands that are stored in a local file?
What are stored procedures in mysql?
What are different types of sql?
What is difference between rank () row_number () and dense_rank () in sql?
What is normalisation in sql?
Explain commit, rollback and savepoint.
What does subquery mean in sql?
What is difference between sql and excel?
Describe types of sql statements?
i have 2 table table one 4 columns respective values a1 7,a2 6,a3 8 ,a4 12 & table two 4 colums respective values a1 7,a2 6,a3 8,a4 15.if table one & table two 3 colums same then 4th column values 1)Qes diff >5 then print 5 * diff value 2)Que diff <5 print 5
What are different types of triggers?