What is Pragma Autonomous transaction. It's Real time
Example

Answers were Sorted based on User's Feedback



What is Pragma Autonomous transaction. It's Real time Example..

Answer / maruthi

Pragma Autonomous Transaction is which is executed in the
execution of another transaction known as parent
transaction which is independent of it
or
the whole transaction splits in to two parts known as
parent& child will be independent of both but have the same
relationship

Is This Answer Correct ?    36 Yes 6 No

What is Pragma Autonomous transaction. It's Real time Example..

Answer / mohan reddy

Autonomous Transactions
Autonomous transactions allow you to leave the context of
the calling transaction, perform an independant transaction,
and return to the calling transaction without affecting it's
state. The autonomous transaction has no link to the calling
transaction, so only commited data can be shared by both
transactions.
The following types of PL/SQL blocks can be defined as
autonomous transactions:
• Stored procedures and functions.
• Local procedures and functions defined in a PL/SQL
declaration block.
• Packaged procedures and functions.
• Type methods.
• Top-level anonymous blocks.
The easiest way to understand autonomous transactions is to
see them in action. To do this, we create a test table and
populate it with two rows. Notice that the data is not commited.
CREATE TABLE at_test (
id NUMBER NOT NULL,
description VARCHAR2(50) NOT NULL
);

INSERT INTO at_test (id, description) VALUES (1,
'Description for 1');
INSERT INTO at_test (id, description) VALUES (2,
'Description for 2');

SELECT * FROM at_test;

ID DESCRIPTION
---------- --------------------------------------------------
1 Description for 1
2 Description for 2

2 rows selected.

SQL>
Next, we insert another 8 rows using an anonymous block
declared as an autonomous transaction, which contains a
commit statement.
DECLARE
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
FOR i IN 3 .. 10 LOOP
INSERT INTO at_test (id, description)
VALUES (i, 'Description for ' || i);
END LOOP;
COMMIT;
END;
/

PL/SQL procedure successfully completed.

SELECT * FROM at_test;

ID DESCRIPTION
---------- --------------------------------------------------
1 Description for 1
2 Description for 2
3 Description for 3
4 Description for 4
5 Description for 5
6 Description for 6
7 Description for 7
8 Description for 8
9 Description for 9
10 Description for 10

10 rows selected.

SQL>
As expected, we now have 10 rows in the table. If we now
issue a rollback statement we get the following result.
ROLLBACK;
SELECT * FROM at_test;

ID DESCRIPTION
---------- --------------------------------------------------
3 Description for 3
4 Description for 4
5 Description for 5
6 Description for 6
7 Description for 7
8 Description for 8
9 Description for 9
10 Description for 10

8 rows selected.

SQL>
The 2 rows inserted by our current session (transaction)
have been rolled back, while the rows inserted by the
autonomous transactions remain. The presence of the PRAGMA
AUTONOMOUS_TRANSACTION compiler directive made the anonymous
block run in its own transaction, so the internal commit
statement did not affect the calling session. As a result
rollback was still able to affect the DML issued by the
current statement.

Is This Answer Correct ?    20 Yes 1 No

What is Pragma Autonomous transaction. It's Real time Example..

Answer / neelbhotra

in Pragma Autonomous transaction
one(parents) transaction execute another transaction(child)
n the parent transaction suspend temporaly, wait till the
child transaction get complete (commited) n then parent is
resume.

ex.
it is used in interface pogram to hold the error datas in
error table & commited there, and from interface table the
inserted data is rollback.

Is This Answer Correct ?    21 Yes 8 No

What is Pragma Autonomous transaction. It's Real time Example..

Answer / venkatesh

Pragma autonomous transaction is independent transaction
and mainly we can use this transaction in databsae triggers
to write TcL statments like commit,rollback.

Is This Answer Correct ?    3 Yes 7 No

Post New Answer

More Oracle Apps Technical Interview Questions

what is the difference between request group and request security group in oracle apps?

2 Answers   BirlaSoft,


diff between key and descriptive flexfield.

4 Answers   Convergys,


Which oracle apps version you are very confident in?

0 Answers  


do i need to declare bind parameter before using in the query?

2 Answers   Satyam,


what is back order in OM

4 Answers   IBM, Oracle,






how many layout sections are tehre in layout editor?

1 Answers  


Do you know what is applysys in oracle application database schema, what is apps?

0 Answers  


How to make Parameter as Mandatory?

2 Answers  


what is the difference between %_all and %_f tables

1 Answers  


While running the concurrent program we will get the status, we have to change the status. How it will be done.

2 Answers   Zensar,


1—how we can create multi reports in xml publishers Ans: 2—how to print multi currency,multi language in xml 3—what are the validations in sql*loader 4—where u can get data file 5—where u r putting control file and where the bad file discard file generated 6—how to print external date in xmlp 7—in data file fields terminated by different sybals how you can write code in ctrl file 8—how to use date function in sql*loader 9—which path u have used in sql*loader 10—what are utl file triggers 11—where u can find errorbuf ret code 12 how we can know weather procedure is successfully executed from backend 13—data file contains how many levels 14—what kind of errors u got in discard file 15—how you can skip the records in thr middle of data file and end of data file 16—invoice created and send to the gl but we don’t know the invoice number how we can know 17—where u devlop interface program local syst or server system 18—how we can know how many receipts are created for a po 19—after completion of po interface into base table how we can see etair line header info in single table. 20—how to save a workflow in database in short cut? Can we delete workflow how 21—what are the common errors in workflow 22—strong cursor and weak cursor 23—what is external table where we will use 24—we have 50 record while printing in rdf report we have print 10 records per page how u can do 25—what is the difference between workflow and oracle alert 26—hot to implement muli org in interface approach 27—while loading records if the records no>=10 then all the records should be discarder,then error message populated how you can achieve 28—while picking the sales aorder qty is there in shipping there is no qty then what u will you will do 29—what is the next step after back order 30—if we do any modification in po_headers_v is it effects the base tables 31—what is tca architecture 32—where we can see the invoice payment 33—when selection existing customer in om what you will do 34—how to pass the values for the variables in api. 35—can we use look up values instead of profile options. 35—how to create ldt lct files? 36—how to tranfor on file from one instance to another instance?

1 Answers   IBM,


how many sections are there in report?

1 Answers  


Categories
  • Oracle Apps Technical Interview Questions Oracle Apps Technical (547)
  • Oracle Apps Financial Interview Questions Oracle Apps Financial (793)
  • Oracle Apps Manufacturing Interview Questions Oracle Apps Manufacturing (53)
  • Oracle Apps HRMS Interview Questions Oracle Apps HRMS (169)
  • Oracle Apps CRM Interview Questions Oracle Apps CRM (9)
  • Oracle Apps SCM Interview Questions Oracle Apps SCM (141)
  • Oracle Install Base Interview Questions Oracle Install Base (62)
  • Oracle Service Contracts Interview Questions Oracle Service Contracts (101)
  • Oracle Apps AllOther Interview Questions Oracle Apps AllOther (114)