Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

avoid hard coding

296586Sep 3 2007 — edited Sep 3 2007
I am looking at an example in my oracle press PL/SQL book. The example is as follows:

DECLARE
V_DISCOUNT NUMBER(3,2);
V_PRICE NUMBER(3);
PROCEDURE GET_DISCOUNTED_PRICE(P_PRICE NUMBER) IS
BEGIN
V_PRICE := (P_PRICE * V_DISCOUNT);
END;
BEGIN
V_PRICE := 249.99;
V_DISCOUNT :=.10;
GET_DISCOUNTED_PRICE(V_PRICE);
DBMS_OUTPUT.PUT_LINE('THE DISCOUNTED PRICE IS '||V_PRICE);
END;

How can I get the results without hard coding V_PRICE:=249.99 or v_discount:=10. I know to use bind variables but would it be to add another procedure that select the values from the table for v_price and passing the v_discount in as a parameter?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 1 2007
Added on Sep 3 2007
4 comments
366 views