Forum

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

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


Rahul U
Posts: 1
 Rahul U
Topic starter
(@Rahul U)
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.

Please check the attachment for additional information.

4 Replies
Sambit S
Posts: 47
 Sambit S
(@Sambit S)
Joined: 1 year 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
Rahul Updhyay
Posts: 17
(@rahul)
Active Member
Joined: 1 year ago

sir getting this error while compiling.

Reply
2 Replies
Harsh B Raj
(@harshbraj)
Joined: 3 weeks ago

New Member
Posts: 2

@rahul on stock should come after insert or update

Reply
Harsh B Raj
(@harshbraj)
Joined: 3 weeks 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
Share: