Which codes executes successfully?
A. CREATE PACKAGE pkg ASTYPE rec_typ IS RECORD (price NUMBER, inc_pct
NUMBER);PROCEDURE calc_price (price_rec IN OUT rec_typ);END pkg;/CREATE
PACAKGE BODY pkg ASPROCEDURE calc_price (price_rec IN OUT rec_typ)
ASBEGINprice_rec.price := price_rec.price + (price_rec.price * price_rec.inc_pct)/100;END
calc_price;END pkg;/DECLARE1_rec pkg. rec_typ;BEGIN1_rec_price :=100;1_rec.inc_pct
:=50;EXECUTE IMMEDIATE ‘BEGIN pkg. calc_price (:rec); END;’ USING IN OUT
1_rec;END;
B. CREATE PACKAGE pkg ASTYPE rec_typ IS RECORD (price NUMBER, inc_pct
NUMBER);END pkg;/CREATE PROCEDURE calc_price (price_rec IN OUT pkg. rec_typ)
ASBEGINprice_rec.price := price_rec.price + (price_rec.price *
price_rec.inc_pct)/100;END/DECLARE1_rec pkg.rec_typ;BEGINEXECUTE IMMEDIATE
‘BEGIN calc_price (:rec); END;’ USING IN OUT 1_rec (100, 50);END;
C. CREATE PACKAGE pkg ASTYPE rec_typ IS RECORD (price NUMBER, inc_pct
NUMBER);END pkg;/CREATE PROCEDURE calc_price (price_rec IN OUT pkg. rec_typ)
ASBEGINprice_rec.price := price_rec.price + (price_rec.price * price_rec.inc_pct)/100;END
;/DECLARE1_rec pkg. rec_typ;BEGIN1_rec_price :=100;1_rec.inc_pct :=50;EXECUTE
IMMEDIATE ‘BEGIN calc_price (1_rec); END;’;END;
D. DECLARETYPE rec_typ IS RECORD (price NUMBER, inc_pct NUMBER);1_rec rectyp;
PROCEDURE calc_price (price_rec IN OUT rec_typ) ASBEGINprice_rec.price := pricerec.
price+ (price_rec.price * price_rec.inc_pct)/100;END;BEGIN1_rec_price
:=100;1_rec.inc_pct :=50;EXECUTE IMMEDIATE ‘BEGIN calc_price (:rec); END;’ USING
IN OUT 1_rec;END;
Answer: B