can i use dbms_output.put_line in a function u are telling
as return statement
Answers were Sorted based on User's Feedback
Answer / hamdy
Yes we can use dbms_output.put_line in a function,
Function is a subprogram used for do some business process
or some calculations and return value.
DBMS_output.put_line used for Print something to the screen
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / babu
Functions are always called by a program and its duty is to
return a value to the calling program, on the other hand,
dbms_output is used to print something to the screen and it
would not be of any significance here.
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / shail
The significance of using dbms_output can be while
debugging any plsql unit and nothing more.
| Is This Answer Correct ? | 4 Yes | 0 No |
this statement is only used for print nothing more.
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / a.jyothsna
instead of return we can't use document_output......
But for general we can use
| Is This Answer Correct ? | 3 Yes | 2 No |
Answer / 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 |
Answer / manoj
I agree with Babu with that there is no significance of
dbms_output...in the function..
| Is This Answer Correct ? | 0 Yes | 0 No |
types of exceptions and what is meant by pragma autonomous_transaction ?what is the use.
What is the difference between row level and statement level trigger?
Who developed sql?
What will be the output for the below Query Select 'High' from dual where null = null;
write the Sql query for creating database backup?
what are different types of keys in sql?
declare v_count number(8,3); v_sal scott.emp.sal%type := '&P_sal'; cursor cur_name is select sal from scott.emp where sal between (v_sal-100) and (v_sal +1000); begin v_count :=nvl(sql%rowcount ,0); if v_count = 0 then dbms_output.put_line('no records are fetch in the given sal range'); else dbms_output.put_line('There is/are '||to_char(v_count)|| ' salaries are selected in the given range '); end if; end; in the above programm .....for any sal range ....always it shows the following message.. no records are fetch in the given sal range please find the mistake and share with me...with thansk and regards..sarao....
what are the different types of joins?
What are its different types of dbms?
How do I remove duplicates in two columns?
What is denormalization in a database?
Is and as keyword in pl sql?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)