ORA-06531: Reference to uninitialized collection PLSQL

ORA-06531: Reference to uninitialized collection Error Description:Reference to uninitialized collection Error Cause:An element or member function of a nested table or varray was referenced (where an initialized collection is needed) without the collection having been initialized. Action:Initialize the collection with an appropriate... Read more

PLSQL Collection Data Deletion

PLSQL collection data deletion CREATE OR REPLACE TYPE l_rec_type IS OBJECT (id NUMBER, name VARCHAR2 (1111)); / CREATE OR REPLACE TYPE l_tab_type IS TABLE OF l_rec_type; / Read more

Row level, statement level Trigger

Create two tables based on the query: insert into product values ('ashish',sysdate); / update product set message = 'Ashish Sahay' where current_date = sysdate; / Read more

Create user in Oracle 12 C

Create user 12C: connect system/manager as sysdba alter session set "_ORACLE_SCRIPT"=true; / create user lime identified by limeoracle; / grant dba to lime; / connect lime/limeoracle / create table test(lime number); Read more

Oracle Functions

Read more

Use of Merge Statement

Sometimes whenever we want to insert records into table with the conditions For existing records (if found then) Update, For Non Existing records (If not found) then insert Step 1 : Create table a_merge as select empno , ename from... Read more

Refresh a materialized view

To refresh a Materialized view we need DBMS_SNAPSHOT.REFRESH procedure. Steps. CREATE TABLE demo_m ( id NUMBER (10) primary key, name VARCHAR2 (400) ); / INSERT INTO DEMO_M ( ID, NAME) VALUES (1001, 'VIKAS' ); / SELECT * FROM demo_m; One... Read more

Get Current Schema and DB name

Some times we do not know about our schema exist in which db and which is our schema hare is the method to find db and schema name. Result Schema Name:ASH_SCHEMA My DB Name:ORCL Read more

RANK and DENSE_RANK

RANK() : function always returns sequential order for each record.DENSE_RANK() : It returns continuous order for each record. Read more

Handle trigger Mutating Error

Many times we have faced the problem of trigger Mutating error. error ORA-04091: table TEST1.TEST_MUTATING is mutating, trigger/function may not see it let see how it comes and resolve CREATE TABLE test_mutating ( id NUMBER, name VARCHAR2(400 byte) ); INSERT... Read more