what is pragma:
Example of Autonomous transactions
Suppose you are updating value from table and you don't have update trigger on that table
but still you want to maintain a log entry for this update in separate table.
You can write a procedure and call that procedure to do this .
But you can not use "COMMIT" in this called procedure because it will save the entire transaction.
To avoid this you can declare this procedure as autonomous transaction procedure
so that the execution of this procedure will be treated as totally diff.
transaction and you can issue commit in called procedure without affecting the main transaction.
Different types of Pragama are
* EXCEPTION_INIT
* RESTRICT_REFERENCES
* SERIALLY_REUSABLE
What Is a Collection?
A collection is an ordered group of elements, all of the same type.
It is a general concept that encompasses lists, arrays, and other familiar datatypes.
Each element has a unique subscript that determines its position in the collection.
PL/SQL offers these collection types:
Index-by tables, also known as associative arrays, let you look up elements using arbitrary numbers and strings for subscript values.
(They are similar to hash tables in other programming languages.)
Nested tables hold an arbitrary number of elements. They use sequential numbers as subscripts. You can define equivalent SQL types,
allowing nested tables to be stored in database tables and manipulated through SQL.
Varrays (short for variable-size arrays) hold a fixed number of elements (although you can change the number of elements at runtime). They use sequential numbers as subscripts. You can define equivalent SQL types, allowing varrays to be stored in database tables. They can be stored and retrieved through SQL, but with less flexibility than nested tables.
Example of Autonomous transactions
Suppose you are updating value from table and you don't have update trigger on that table
but still you want to maintain a log entry for this update in separate table.
You can write a procedure and call that procedure to do this .
But you can not use "COMMIT" in this called procedure because it will save the entire transaction.
To avoid this you can declare this procedure as autonomous transaction procedure
so that the execution of this procedure will be treated as totally diff.
transaction and you can issue commit in called procedure without affecting the main transaction.
Different types of Pragama are
* EXCEPTION_INIT
* RESTRICT_REFERENCES
* SERIALLY_REUSABLE
What Is a Collection?
A collection is an ordered group of elements, all of the same type.
It is a general concept that encompasses lists, arrays, and other familiar datatypes.
Each element has a unique subscript that determines its position in the collection.
PL/SQL offers these collection types:
Index-by tables, also known as associative arrays, let you look up elements using arbitrary numbers and strings for subscript values.
(They are similar to hash tables in other programming languages.)
Nested tables hold an arbitrary number of elements. They use sequential numbers as subscripts. You can define equivalent SQL types,
allowing nested tables to be stored in database tables and manipulated through SQL.
Varrays (short for variable-size arrays) hold a fixed number of elements (although you can change the number of elements at runtime). They use sequential numbers as subscripts. You can define equivalent SQL types, allowing varrays to be stored in database tables. They can be stored and retrieved through SQL, but with less flexibility than nested tables.
No comments:
Post a Comment