Forum

Create a PL/SQL Tri...
 
Share:
Notifications
Clear all

Create a PL/SQL Trigger to display the message "Re-Order Level reached for the item-item name"


Posts: 1
Guest
Topic starter
(@Rahul U)
New Member
Joined: 3 years 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.

Please check the attachment for additional information.

4 Replies
Posts: 47
Guest
(@Sambit S)
Eminent Member
Joined: 3 years ago

You can try this and let me know. 

Create or replace trigger threshold
On Stock
Before insert or update
For each row
Is
V_qty number;
V_desc varchar2(30);
Begin
Select quantity, description into v_qty, v_desc
From stock
Where itemid = :new.itemid;

If v_qty < 10 then
Dbms_output.put_line(' Re-order level reached to the item: '||v_desc);

End;

Reply

Self Learning Video Tutorials - Software Course

Posts: 17
(@rahul)
Active Member
Joined: 3 years ago

sir getting this error while compiling.

Reply
2 Replies
(@harshbraj)
Joined: 2 years ago

New Member
Posts: 2

@rahul on stock should come after insert or update

Reply
(@harshbraj)
Joined: 2 years ago

New Member
Posts: 2

@rahul

create or replace trigger stock_alert
after insert or update of quantity on stock
for each row
begin
IF :new.QUANTITY <= 10 THEN
DBMS_OUTPUT.PUT_LINE ('Re-order Level reached for the item-'|| :old.description );
END IF;
END;
/

Try this one

Reply

Leave a reply

Author Name

Author Email

Title *

 
Preview 0 Revisions Saved
Share: