Re:Forms pl/sql

Re:Forms pl/sql

 

  



Well, kelly...
IN FORMS you SHOUld CREATE AN ALERT MESSAGE OR SIMPLY A MESSAGE AS

Message(''Not enough items in stock');
Raise form_trigger_failure;
Or if you create an alert named message_box which pops up then
Message_box(''Not enough items in stock');
Raise form_trigger_failure;

raise_application_error will not work in forms.. .. It will work only if
you covert the forms procedure to back-end and call the procedure in forms.
Regards,
Prashanth.r

-----Original Message-----
From: kellyjackie
[mailto:oracledba-ezmlmshield-x82090658.[Email address protected]
Sent: Wednesday, April 30, 2008 3:38 PM
To: LazyDBA Discussion
Subject: Forms PL/SQL

I have the following pl/sql for a save button on an orders form: i am trying
to check the amount entered for the order against the quantity in stock in
the item table. then update the amount in the item table accordingly and
commit the form, otherwise display an error.


im getting an error:raise application error must be declared.

Declare

V_orderqty orders.order_qty %TYPE;


Begin

Select ITEM.QTY_IN_STOCK into v_orderqty
>From ITEM
Where ITEM.ITEM_ID=:orders.ITEM_NO;

If :orders.ORDER_QTY<=v_orderqty
Then Update item i
Set i.QTY_IN_STOCK=(i.QTY_IN_STOCK - :orders.ORDER_QTY) Where
i.ITEM_ID=:orders.ITEM_NO;

Commit ;

Else
Raise_application_error(-20201,'Not enough items in stock');

End IF;

End;






Also how do you enter values in field on a form using pl/sql example:

Declare

V_items item%ROWTYPE;

Begin

Select * into V_item
>From ITEM
Where itemno=:orders.ITEM_NO;

/*Populate the item fields with this row of values*/

End;



-----------------------------------------------------------------
Find the home of your dreams with eircom net property Sign up for email
alerts now http://www.eircom.net/propertyalerts




---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a dba
job: http://jobs.lazydba.com To Subscribe : http://www.LazyDBA.com To
unsubscribe: http://www.lazydba.com/unsubscribe.html





Oracle LazyDBA home page