Ending transactions, PL-SQL Programming

Ending Transactions

A good quality programming practice is to commit or roll back every transaction explicitly. Whether you rollback or issue the commit in your PL/SQL program or in the host atmosphere, it depends on the flow of application logic. When you neglect to commit or roll back a transaction explicitly, the host atmosphere determines its last state.

For illustration, in the SQL Plus atmosphere, if your PL/SQL block does not involve a COMMIT or ROLLBACK statement, the final state of your transaction totally depends on what you do after running the block. When you execute the data control, data definition, or COMMIT statement or if you issue the DISCONNECT, EXIT, or QUIT command, the Oracle commits the transaction. When you execute a ROLLBACK statement or abandon the SQL Plus session, the Oracle rolls back the transaction.

In the Oracle Pre-compiler atmosphere, if your program does not expire in general, the Oracle rolls back your transaction. The program terminates generally if it explicitly commits or rolls back work and disconnects from the Oracle using the RELEASE parameter, which is as shown:

EXEC SQL COMMIT WORK RELEASE;

Posted Date: 10/4/2012 5:16:33 AM | Location : United States







Related Discussions:- Ending transactions, Assignment Help, Ask Question on Ending transactions, Get Answer, Expert's Help, Ending transactions Discussions

Write discussion on Ending transactions
Your posts are moderated
Related Questions
Keyword &Parameter Description: index_name: This is an undeclared identifier which can be referenced only within the FORALL statement and only as the collection subscript

EXCEPTION_INIT Pragma The pragma EXCEPTION_INIT relates an exception name with an Oracle error number. Which allow you to refer to any internal exception by the name and to wri

Explicit Cursors The set of rows returned by the query can include zero, one, or multiple rows, depending on how many rows meet your search criteria. Whenever a query returns

Keyword & Parameter Description: PRAGMA: These keywords signify that the statement is a pragma (i.e. compiler directive). The Pragmas are processed at the compile time, n

%ROWCOUNT When its cursor or cursor variable is opened, the %ROWCOUNT is zeroed. Before the first fetch, the %ROWCOUNT yields 0. Afterward, it yields the number of rows fetche

Query: SELECT * FROM EMPLOYEE1; Select 5 columns and all rows from one table Query: SELECT C_ID, COMPANY, BUILDING, DEPARTMENT, BRANCH FROM CONTRACT;

Read-Only Operator (+) - SQL The term read-only operator to the mathematical term function. Here I just need to add that the SQL standard reserves the term function for read-

Manipulating Objects: You can use an object type in the CREATE TABLE statement to indicate the datatype of a column. When the table is created once, you can use the SQL statem

Declaring Exceptions The Exceptions can be declared only in the declarative part of the PL/SQL subprogram, block, or package. By introducing its name, you can declare an excep

Example of Table Literal - SQL Example: A Table Literal (correct version) VALUES ('S1', 'C1', 'Anne'), ('S1', 'C2', 'Anne'), ('S2', 'C1', 'Boris'), ('S3', 'C3'