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

Is the primary key an index?

594


how do you control the max size of a heap table? : Sql dba

534


How can you view the errors encountered in a trigger?

547


What is data type in sql?

554


What is a natural join sql?

511






What are character functions?

628


Is pl sql different from sql?

528


How does rowid help in running a query faster?

964


What is pl sql in dbms?

503


What is pl sql script?

560


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

1152


what are the advantages a stored procedure? : Sql dba

543


What are the types of join and explain each?

577


How to write html code in pl sql?

579


Explain locks? : Transact sql

569