Category: PL/SQL Programs

PL/SQL Package to find Factorial and Armstrong Number 0

PL/SQL Package to find Factorial and Armstrong Number

Follow me PL/SQL Package to find Factorial and Armstrong Number: /** CREATING PACKAGE **/ create or replace package fact_arm is function factorial(n in number) return number; procedure armstr(no in number); end; /** CREATING PACKAGE...

PL/SQL Trigger to Allow User to Make Changes Between 8am to 5pm 0

PL/SQL Trigger to Allow User to Make Changes Between 8am to 5pm

Follow me PL/SQL Trigger to Allow User to Make Changes Between 8am to 5pm: create or replace trigger time2 before update or delete or insert on stud for each row declare hour number; vari...

PL/SQL Trigger to Restrict User to Make Changes After 5pm 0

PL/SQL Trigger to Restrict User to Make Changes After 5pm

Follow me PL/SQL Trigger to Restrict User to Make Changes After 5pm: create or replace trigger time before update or delete or insert on stud for each row declare hour number; vari char(2); begin...

PL/SQL Trigger to Restrict User to Make Changes on Sunday 0

PL/SQL Trigger to Restrict User to Make Changes on Sunday

Follow me PL/SQL Trigger to Restrict User to Make Changes on Sunday : create or replace trigger restrict before update or delete or insert on student for each row declare curr_day varchar(20); begin select...

PL/SQL Trigger to Insert Salary more than 10000 0

PL/SQL Trigger to Insert Salary more than 10000

Follow me PL/SQL Trigger to Insert Salary more than 10000: create or replace trigger vali before insert on emp for each row begin if(:new.salary < 10000)then raise_application_error(-20000,’Salary must be greater than 10000′); end if;...

PL/SQL Trigger to Insert Records in Lowercase 0

PL/SQL Trigger to Insert Records in Lowercase

Follow me PL/SQL Trigger to Insert Records in Lowercase: While Inserting in table the Name Field will always get inserted in Lowercase due to Trigger. create or replace trigger valdata before insert on student...

PL/SQL Trigger to Insert Records in Uppercase 0

PL/SQL Trigger to Insert Records in Uppercase

Follow me PL/SQL Trigger to Insert Records in Uppercase: While Inserting in table the Name Field will always get inserted in Uppercase due to Trigger. create or replace trigger valdata before insert on student...

PL/SQL Trigger to Insert Deleted Record in New Table 0

PL/SQL Trigger to Insert Deleted Record in New Table

Follow me PL/SQL Trigger to Insert Deleted Record in New Table: When any record gets deleted from STUDENT table the that RECORD directly get inserted into ST table. create or replace trigger on_del before...

PL/SQL Cursor to Find Total Salary in Department 0

PL/SQL Cursor to Find Total Salary in Department

Follow me PL/SQL Cursor to Find Total Salary in Department: declare dno number; vdno number; totsalary number; cnt number; cursor tot_sal(vdno number) is select * from emp where deptno=vdno; begin cnt:=0; totsalary:=0; vdno:=:vdno; dbms_output.put_line(‘Department...

PL/SQL Cursor to Display Names in Uppercase 0

PL/SQL Cursor to Display Names in Uppercase

Follow me PL/SQL Cursor to Display Names in Uppercase: declare cursor upr is select upper(ename)ename from emp order by empno; begin for i in upr loop dbms_output.put_line(i.ename); end loop; end; OUTPUT: SMITH ALLEN WARD...