OK, I'm now trying to get to grips ith PL/SQL functions for Exam 2 Program Units - I believe I understand the syntax yet they always seem to compile with errors.
This example is taken from the book yet I have similar problems with others too,
CREATE OR REPLACE FUNCTION FUNC_COUNT_GUESTS
(p_cruise_id number)
Return Number
IS
v_count number(10)
BEGIN
SELECT COUNT(g.guest_id)
INTO v_count
FROM Guests g,
Guest_bookings gb
WHERE G.Guest_id = GB.Guest_Booking_id
AND GB.Cruise_id = p_cruise_id;
RETURN V_count;
END;
/
I've created all the objects and populated them with some data.
Have I overlooked something simple ?
This example is taken from the book yet I have similar problems with others too,
CREATE OR REPLACE FUNCTION FUNC_COUNT_GUESTS
(p_cruise_id number)
Return Number
IS
v_count number(10)
BEGIN
SELECT COUNT(g.guest_id)
INTO v_count
FROM Guests g,
Guest_bookings gb
WHERE G.Guest_id = GB.Guest_Booking_id
AND GB.Cruise_id = p_cruise_id;
RETURN V_count;
END;
/
I've created all the objects and populated them with some data.
Have I overlooked something simple ?