Posts by Jagadeeswaran Balu

Delete duplicate records in different ways

How to delete duplicate records in different ways in SQL. for example: Consider the combination of EMPNO & ENAME columns in EMP table is having duplicate records as below, SELECT…

Read More

CREATE TABLE AS STATEMENT (by copying from existing table)

Use SQL CREATE TABLE AS statement to create a table from an existing table by copying the existing table’s columns. What happens to the METADATA and DATA when creating a…

Read More

oracle compound trigger to avoid mutating trigger

— Trigger to check if the sal greater than 100000, if yes, log the error message, else update sucessfully create or replace trigger trig_validate_sal before update of sal on emp_t…

Read More

PLSQL Stored Procedure to calculate number of particular day between two input dates.

CREATE OR REPLACE PROCEDURE PR_TOT_DAYS ( P_START_DATE IN DATE, P_END_DATE IN DATE, P_DAY IN VARCHAR2, P_TOT_DAYS OUT NUMBER ) IS LV_LOOP NUMBER; LV_DATE DATE; LV_TOT_DAYS NUMBER := 0; BEGIN LV_LOOP…

Read More