if i am using dml statement in function.
then i am writing select statement what was the output

Answer Posted / sandeeptiwari1111@gmail.com

We can perform DML operation in function but we can not Query that function in select statement.
But if you want to query it any how from select stmnt then you have to use Pragma_autonomous transaction .

create or replace function f2 return date as
Pragma Autonomous_Transaction;

begin

insert into Tab values(sysdate);
commit;
return sysdate-1;


end ;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is merge in oracle?

572


How would you begin to troubleshoot an ORA-3113 error?

1610


What are named parameters?

620


Can u please explain me the Discussion on Except ,using cast like type cast. Question in the context of difference between two tables

1590


How to lock and unlock a user account in oracle?

624






What is the difference between truncate & delete command?

625


Explain the use of indexes option in imp command.

572


Please explain compound trigger in oracle?

607


Compare and contrast between sql and sql server and explain its various functions?

544


What are the different editions of oracle?

601


What is BBED in Oracle?

693


How can I introduce multiple conditions in like operator?

562


interview questions with answer for cts

2092


How to use fetch statement in a loop?

568


Explain the use of consistent option in exp command.

556