Question: DATABASE PROGRAMMING CREATE TABLE dept ( deptno NUMBER(2,0), dname VARCHAR2(14), loc VARCHAR2(13), CONSTRAINT n_pk_dept PRIMARY KEY (deptno) ); CREATE TABLE emp( empno NUMBER(4,0), ename VARCHAR2(10),

DATABASE PROGRAMMING

CREATE TABLE dept ( deptno NUMBER(2,0), dname VARCHAR2(14), loc VARCHAR2(13), CONSTRAINT n_pk_dept PRIMARY KEY (deptno) ); CREATE TABLE emp( empno NUMBER(4,0), ename VARCHAR2(10), job VARCHAR2(9), mgr NUMBER(4,0), hiredate DATE, sal NUMBER(7,2), comm NUMBER(7,2), deptno NUMBER(2,0),

A new rule requires that the minimal salary will be equal to or greater than $2,199. Write and run a PL/SQL block to go over each employee in the company. If the salary is equal to or greater than $2,199, then it is fine; if the program finds any violation against this rule, it will raise an exception that is defined as Sal_low. In this exception handler, program will print out a message with the employee ID and his/her current salary amount. In the exception section, you should also set up another handler of OTHERS, that will catch any unexpected error, and use SQLCODE and SQLERRM functions to catch the error number and error message, print out these information.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!