Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bobby5892/1b914dcb8f9685c0b0c124a08677e981 to your computer and use it in GitHub Desktop.
Save bobby5892/1b914dcb8f9685c0b0c124a08677e981 to your computer and use it in GitHub Desktop.
wk8-inclass-mon
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