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
What is the difference between nvl function, ifnull function, and isnull function?
Can we create table inside stored procedure?
How do I find duplicates in sql?
What is cte sql?
Differences between Oracle 9i and 10g (Probably in terms of SQL and PL/SQL)?
What is pragma in pl sql?
Explain the purpose of %type and %rowtype data types with the example?
Why do we use joins in sql?
Can I learn sql in a week?
List different type of expressions with the example.
Enlist the advantages of sql.
What is trigger point?
What are sql ddl commands?
what is primary key? : Sql dba
How to use boolean type in select statement?