Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please don't laugh 1

Status
Not open for further replies.

CTO1

Technical User
Jun 17, 2003
14
0
0
GB
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 ?
 
You will need to tell us what compile errors you are getting.

There is a missing semicolon (;) after [tt]v_count number(10)[/tt]. Is that the only error?
 
Lewisp I thank you
Oracle press books are good but a single misprint like that has given me a serious headache. It recompiles fine with that extra semi-colon.
I'm cooking on gas now !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top