Home » SQL & PL/SQL » SQL & PL/SQL » Setting SELECT Count(*) Value Into Output Variable (Oracle Developer 11g)
Setting SELECT Count(*) Value Into Output Variable [message #503060] |
Tue, 12 April 2011 11:05  |
 |
BennyBoy76
Messages: 4 Registered: March 2011 Location: UK
|
Junior Member |
|
|
I'm trying to return the number of records in my link table that contains the excursion_id I pass in by counting them. It doesn't seem to like the select count(*) into my output variable. Has anyone got any ideas?
Thanks.............Ben
create or replace
PROCEDURE BOOK_PASSENGER(
EXCURSION_ID IN excursion_booking.excursion_id%TYPE,
PASSENGER_ID IN excursion_booking.passenger_id%TYPE,
NUMBER_BOOKED OUT NUMBER)
AS
BEGIN
INSERT INTO EXCURSION_BOOKING VALUES(EXCURSION_ID, PASSENGER_ID, NULL);
SELECT COUNT(*) INTO NUMBER_BOOKED FROM EXCURSION_BOOKING WHERE EXCURSION_ID = EXCURSION_ID;
END BOOK_PASSENGER;
[Updated on: Tue, 12 April 2011 11:10] Report message to a moderator
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Thu Jun 05 21:20:39 CDT 2025
|