WHERE idbasketpbasket EXCEPTION WHEN NODATAFOUND THEN

Where idbasketpbasket exception when nodatafound then

This preview shows page 3 - 16 out of 27 pages.

WHERE idbasket=p_basket;EXCEPTIONWHEN NO_DATA_FOUND THENDBMS_OUTPUT.PUT_LINE('Invalid basket id');END basket_info_pp;END;
Background image
Background image
Assignment 7-2: Using Program Units in a PackageCREATE OR REPLACE PACKAGE order_info_pkg ISFUNCTION ship_name_pf (p_basket IN NUMBER)RETURN VARCHAR2;PROCEDURE basket_info_pp(p_basket IN NUMBER,p_shop OUT NUMBER,p_date OUT DATE);END;/CREATE OR REPLACE PACKAGE BODY order_info_pkg ISFUNCTION ship_name_pf (p_basket IN NUMBER)RETURN VARCHAR2IS
Background image
lv_name_txt VARCHAR2(25);BEGINSELECT shipfirstname||' '||shiplastnameINTO lv_name_txtFROM bb_basketWHERE idBasket=p_basket;RETURN lv_name_txt;EXCEPTIONWHEN NO_DATA_FOUND THENDBMS_OUTPUT.PUT_LINE('Invalid basket id');END ship_name_pf;PROCEDURE basket_info_pp(p_basket IN NUMBER,p_shop OUT NUMBER,p_date OUT DATE)ISBEGINSELECT idshopper, dtorderedINTO p_shop, p_dateFROM bb_basketWHERE idbasket=p_basket;EXCEPTIONWHEN NO_DATA_FOUND THENDBMS_OUTPUT.PUT_LINE('Invalid basket id');END basket_info_pp;END;/
Background image
Testing the procedure
Background image
Background image
Assignment 7-3: Creating a Package with Private Program UnitsCasteel, Joan. Oracle 11g: PL/SQL Programming (Page 282). Cengage Textbook. Kindle Edition.
Background image
Testing the procedure with id 6
Background image
Assignment 7-4: Using Packaged VariablesCasteel, Joan. Oracle 11g: PL/SQL Programming (Page 282). Cengage Textbook. Kindle Edition.
Background image
Testing host variable to see what returns
Background image
Making it a package
Background image
Background image
Assignment 7-5: Overloading Packaged ProceduresCasteel, Joan. Oracle 11g: PL/SQL Programming (Page 283). Cengage Textbook. Kindle Edition.
Background image
Image of page 16

You've reached the end of your free preview.

Want to read all 27 pages?

  • Spring '19
  • MYSQL , Cengage Textbook

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture