Posts

Showing posts from November, 2018

What is types/collections in Pl/SQL?

Collection Types in PL/SQL Types : Type is nothing but user_defined datatype. In oracle we can create our own datatype. We can create user_defined datatype by using type keyword.There are various types of collection in Pl/SQL following lines. 1)PL/SQL record 2) index by table (or) pl/sql table (or) associative array 3) nested table 4) Varray 5)ref cursor* (will be in next) Note: where index by table ,nested table and Varray are also known as collections. Index by table: It is a type. Which stores number of values into a single unit. It improves application performance because it stored in RAM MEMORY AREA.Index by table has key-value pair. Where key behaves like a primary key. which stores index. Key doesn't have any duplicate value in it. Where value is actual data. To improve performance of the index by table oracle provided binary_integer datatype for key field. Index by table,nested table, Varray are also called as collections. Oracle provided predefi...
What is trigger? TRIGGER : -->  SQL Trigger is an event-driven action or database callback function which is invoked automatically when an INSERT, UPDATE, and DELETE statement is performed on a specified table. The main tasks of triggers are like enforcing business rules, validating input data, and keeping an audit trail. Usage of Triggers: 1. Triggers are used for enforcing business rules. 2. Validating input data. 3.Generating a unique value for a newly-inserted row in a different file. 4.Write to other files for audit trail purposes. 5. Query from other files for cross-referencing purposes. 6. Used to access system functions. 7. Replicate data to different files to achieve data consistency. Advantages of using triggers Triggers make the application development faster. Because the database stores triggers, you do not have to code the trigger actions into each database application. Define a trigger once and you can reuse it for many applications that use...