Created
May 24, 2019 00:08
-
-
Save bobby5892/1b914dcb8f9685c0b0c124a08677e981 to your computer and use it in GitHub Desktop.
wk8-inclass-mon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION getPrice (Product_ID IN VARCHAR2) | |
RETURN NUMBER | |
IS price NUMBER(7,2); | |
CURSOR cur_products IS SELECT PRODUCT_PRICE INTO price FROM product WHERE PRODUCT_ID=Product_ID; | |
BEGIN | |
open cur_products; | |
FETCH cur_products INTO price; | |
return price; | |
END; | |
SET SERVEROUTPUT ON; | |
BEGIN | |
dbms_output.put_line(getPrice(100)); | |
END; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment