TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Amit Kumar Singh
401
4k
201.7k
Related to Functions
Nov 10 2020 8:36 AM
Hi Friends,
I am new to oracle database and my requirements is :
Please create a function with commented code to calculate the subtotal which is returned to the calling program.
The following particulars to help you with the task:
? The table for the data is BB_Basketitem
? Subtotal column is an aggregated calculated field (quantity * price) based on basket id that is a parameter of the function
? Define a local variable in the function to hold the subtotal calculated (hint:
SELECT……….. INTO local variable
CREATE OR REPLACE FUNCTION SUBTOTALS
RETURN number
IS
total number(8);
BEGIN
Select Quantity * Price INTO total from BB_Basketitem where idBasket = 5;
RETURN total;
END;
DECLARE
result number(8);
BEGIN
result := SUBTOTALS();
dbms_output.put_line('Total is' || result);
END;
Pls. help me in this
Reply
Answers (
1
)
Can be compiled a PKG with a Blanc space in name?
How can i to GRANT in a SCHEMA to a user