Home » RDBMS Server » Server Administration » help us quickly please .........
help us quickly please ......... [message #371788] Wed, 06 December 2000 05:59 Go to next message
asma
Messages: 12
Registered: December 2000
Junior Member
We have a project about hotel reservation .. we wrote procedure to reserve a room for new customer .When new customer reserve room by fill form we insert it after check for availabilty in wait list .. we don't insert it in hotel database untill he arrive ...

****we wrote the following procedure that give us execution error

create or replace
procedure findroom(
p_name IN VARCHAR2,
p_phone IN NUMBER,
p_country IN VARCHAR2,
p_city IN VARCHAR2,
p_address IN VARCHAR2,
p_email IN VARCHAR2,
p_cridittype IN VARCHAR2,
p_criditno IN NUMBER,
p_criditexp IN DATE,
p_nameoncard IN VARCHAR2,
p_arrivaldate IN DATE,
p_arrivaltime IN VARCHAR2,
p_am_pm IN VARCHAR2,
p_checkout IN DATE,
p_numadult IN NUMBER,
p_numchildren IN NUMBER,
p_confirmation# IN NUMBER,
p_roomtype IN VARCHAR2)
is
begin
declare
newconfirmation# custlist.confirmation#%type;
new2confirmation# rreservation.custconfirmation#%type;
cursor check_availability is
select custconfirmation#,confirmation#
from room , rreservation , custlist
where (Room.roomno = rreservation.custroomno and Room.roomtype = p_roomtype and rreservation.checkout > p_arrivaldate )
or (custlist.roomtype = p_roomtype and custlist.checkout > p_arrivaldate);
begin
open check_availability;
loop
fetch check_availability into newconfirmation#, new2confirmation#;
exit when check_availability%NOTFOUND;
end loop;
if check_availability%rowcount < 100 and (p_roomtype ='single' or p_roomtype ='twin/doubl')
then
insert into custlist (name,phone,country,city,address,email,cridittype,criditno,
criditexp,nameoncard,arrivaldate,arrivaltime,am_pm,checkout,numadult,numchildren,roomtype,confirmation#)
values (p_name,p_phone,p_country,p_city,p_address,p_email,
p_cridittype,p_criditno,p_criditexp,p_nameoncard,
p_arrivaldate,p_arrivaltime,p_am_pm,p_checkout,p_numadult,
p_numchildren,p_roomtype,'1111110');
end if;
if check_availability%rowcount < 30 and p_roomtype ='excutive suite'
then
insert into custlist (name,phone,country,city,address,email,cridittype,criditno,
criditexp,nameoncard,arrivaldate,arrivaltime,am_pm,checkout,numadult,numchildren,roomtype,confirmation#)
values (p_name,p_phone,p_country,p_city,p_address,p_email,
p_cridittype,p_criditno,p_criditexp,p_nameoncard,
p_arrivaldate,p_arrivaltime,p_am_pm,p_checkout,p_numadult,
p_numchildren,p_roomtype,'1111110');
end if;
if check_availability%rowcount < 10 and p_roomtype =
'delux suite'
then
insert into custlist (name,phone,country,city,address,email,cridittype,criditno,
criditexp,nameoncard,arrivaldate,arrivaltime,am_pm,checkout,numadult,numchildren,roomtype,confirmation#)
values (p_name,p_phone,p_country,p_city,p_address,p_email,
p_cridittype,p_criditno,p_criditexp,p_nameoncard,
p_arrivaldate,p_arrivaltime,p_am_pm,p_checkout,p_numadult,
p_numchildren,p_roomtype,'1111110');
end if;
end;
end;/

**** the error ***
Error Executing Cursor

SQL:
begin
"SCOTT"."FINDROOM" ( P_NAME => 'miral', P_ARRIVALDATE => '11-dec-00', P_CHECKOUT => '2-jan-01', P_CONFIRMATION# => 1111119, P_ROOMTYPE => 'single');
end;

ORA-01001: invalid cursor

*** please help us to know what is the error in this code we haven't enough time.

Thanx....
Re: help us quickly please ......... [message #371789 is a reply to message #371788] Wed, 06 December 2000 06:14 Go to previous message
Babu Paul
Messages: 38
Registered: November 2000
Member
Hi
I don't think there is any problem in the code.
The error does not seem to be valid(invalid cursor). Try compiling and running it again. Probably it may be executing the earlier version of code.

Good Luck!
Babu
Previous Topic: data dictionary
Next Topic: Paging through a resultset
Goto Forum:
  


Current Time: Sun Dec 22 19:30:20 CST 2024