Forms PL/SQL
432898Apr 23 2008 — edited Apr 30 2008Im having a little difficulty with PL/SQL in forms its different to the pl/sql for sql*plus.
I have an orders form. it has the following fields:
Order Id
Employee ID
Order Quantity
Order Date
Customer Id
Item No
Order Price
It has a subforms which shows the items for the order when a query is run.
I have a button new record with the following PL/SQL:
begin
clear_form;
select ord_id.nextval
into :orders.ORDER_ID
from dual;
select sysdate
into :orders.ORDER_DATE
from dual;
end;
when i enter a value for item no and quantity i want the sub form to display the record entered. i want the quantity be be checked to see if the value is less than the quantity in stock and if so take away that value. should this be done 'POST CHANGE' of the fields? or should it be done when the user clicks the save button. What is the PL/SQL to do this?