Skip to toolbar

Forum

Create a PL/SQL Pac...
 
Notifications
Clear all

Create a PL/SQL Package with Procedure in it. Procedure will take designation and incentive as input and update the employee salary by adding the incentive for the given designation. Display the number of employee records that have got updated, e.g....  


Rahul Updhyay
Posts: 17
(@rahul)
Active Member
Joined: 2 months ago

Create a PL/SQL Package with Procedure in it.  

2 Replies
VK
Posts: 7
 VK
Guest
(@VK)
Joined: 2 months ago

Create a PL/SQL Package with Procedure in it. Procedure will take designation and incentive as input and update the employee salary by adding the incentive for the given designation. Display the number of employee records that have got updated, e.g....

CREATE OR REPLACE PACKAGE EMP_Designation AS
PROCEDURE EMP_Details
(
psr_design Employee.Designation%TYPE
, psr_Incentive NUMBER
);
END emp_designation;
/

CREATE OR REPLACE PACKAGE BODY EMP_Designation AS
PROCEDURE EMP_Details
(
psr_design employee.designation%TYPE
, psr_Incentive NUMBER
)
IS
BEGIN
UPDATE employee SET Employee.Salary = Employee.Salary + psr_Incentive
WHERE Designation = psr_design;
dbms_output.put_line(SQL%ROWCOUNT || ' employee(s) are updated');
END EMP_Details;
END;
/

try this and let me know. Any other approach is welcome. 

Reply
vinodkrsetty
Posts: 15
Admin
(@vinodkrsetty)
Member
Joined: 1 year ago

Create a PL/SQL Trigger to display the message "Re-Order Level reached for the item-item name", whenever an item quantity reaches 10 and below while updating for inserting an item.

For this, we can write a below query. 

CREATE TRIGGER QuantityAlert
ON ItemTable
AFTER UPDATE
AS
BEGIN
INSERT INTO AlertItemTable
SELECT ProductID, ProductName, 'Low Stock',
'Re-Order Level Reached For the Item' + ProductName + ' left'
FROM inserted
WHERE Quantity = 10
END
GO

Let me know In case of any queries. 

Reply

Leave a reply

Author Name

Author Email

Title *

Maximum allowed file size is 10MB

 
Preview 0 Revisions Saved
Share: