Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.
CREATE OR REPLACE FUNCTION get_total(customer_num IN customer.CustomerID%TYPE) RETURN NUMBER IS v_price MotelRoom.PRICE%TYPE; v_nights INTEGER; total_price NUMBER; BEGIN SELECT mr.price, TO_DATE(checkout, 'dd') - TO_DATE(checkin, 'dd') INTO v_price, v_nights FROM MotelRoom mr JOIN BookedRoom b ON mr.roomID = b.roomID WHERE b.customerID = customer_num; total_price := v_price * v_nights; RETURN total_price; EXCEPTION WHEN OTHERS THEN RAISE_APPLICATION_ERROR(-20001, 'There was an error when get_total function was run. ' || SQLCODE || ', ' || SUBSTR(SQLERRM, 1, 200)); END; /
|Oracle Query - Remove one of 2 duplicate rows||7||53|
|NMAP shows service 1521 is closed||13||68|
|Request assistance granting user permission to execute a sys function from within a package||2||55|
|Create Oracle User to only have ability to create tables, triggers, functions etc in one tablespace||4||39|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
21 Experts available now in Live!