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 the primary key an index?
how do you control the max size of a heap table? : Sql dba
How can you view the errors encountered in a trigger?
What is data type in sql?
What is a natural join sql?
What are character functions?
Is pl sql different from sql?
How does rowid help in running a query faster?
What is pl sql in dbms?
What is pl sql script?
1) Synonyms 2) Co-related Subquery 3) Different Jobs in Plsql 4) Explain Plan 5) Wrap 6) Query Optimization Technique 7) Bulk Collect 8) Types of index 9) IF primary key is created then the index created ? 10) Foreign Key 11) Exception Handling 12) Difference Between Delete and Trunc 13) Procedure Overloading 14) Grant Revoke 15) Procedure Argument types. 16) Functions. 17) Joins
what are the advantages a stored procedure? : Sql dba
What are the types of join and explain each?
How to write html code in pl sql?
Explain locks? : Transact sql