Home » RDBMS Server » Server Administration » What's wrong with this procedure
What's wrong with this procedure [message #371815] Sun, 10 December 2000 01:15 Go to next message
asma
Messages: 12
Registered: December 2000
Junior Member
* What's wrong with this procedure!!!!

create or replace
1 procedure Findroom2(
2 p_name IN VARCHAR2,
3 p_phone IN NUMBER,
4 p_country IN VARCHAR2,
5 p_city IN VARCHAR2,
6 p_address IN VARCHAR2,
7 p_email IN VARCHAR2 DEFAULT null,
8 p_CriditType IN VARCHAR2,
9 p_CriditNo IN NUMBER,
10 p_CriditExp IN DATE,
11 p_nameoncard IN VARCHAR2,
12 p_Arrivaldate IN DATE,
13 p_Arrivaltime IN VARCHAR2,
14 p_am_pm IN VARCHAR2,
15 p_Checkout IN DATE,
16 p_numadult IN NUMBER,
17 p_numchildren IN NUMBER,
18 p_Roomtype IN VARCHAR2)
19 is
20 begin
21 declare
22 newconfirmation# custlist.confirmation#%type;
23 new2confirmation# rreservation.custconfirmation#%type;
24 cursor check_availability is
25 select custconfirmation#,confirmation#
26 from room , rreservation , custlist
27 where (Room.roomno = rreservation.custroomno and Room.roomtype = p_roomtype and rreservation.checkout > p_arrivaldate )
28 or (custlist.roomtype = p_roomtype and custlist.checkout > p_arrivaldate);
29 begin
30 open check_availability;
31 loop
32 fetch check_availability into newconfirmation#, new2confirmation#;
33 exit when check_availability%NOTFOUND;
34 end loop;
35 if check_availability%rowcount < 100 and (p_roomtype ='single' or p_roomtype ='twin/doubl')
36 then
37 insert into custlist (name,phone,country,city,address,email,cridittype,criditno,
38 criditexp,nameoncard,arrivaldate,arrivaltime,am_pm,checkout,numadult,numchildren,roomtype,confirmation#)
39 values (p_name,p_phone,p_country,p_city,p_address,p_email,
40 p_cridittype,p_criditno,p_criditexp,p_nameoncard,
41 p_arrivaldate,p_arrivaltime,p_am_pm,p_checkout,p_numadult,
42 p_numchildren,p_roomtype,conf#.nextval);
43 elseif check_availability%rowcount < 30 and
44 p_roomtype ='excutive suite' then
45 insert into custlist (name,phone,country,city,address,email,cridittype,criditno,
46 criditexp,nameoncard,arrivaldate,arrivaltime,am_pm,checkout,numadult,numchildren,roomtype,confirmation#)
47 values (p_name,p_phone,p_country,p_city,p_address,p_email,
48 p_cridittype,p_criditno,p_criditexp,p_nameoncard,
49 p_arrivaldate,p_arrivaltime,p_am_pm,p_checkout,p_numadult,
50 p_numchildren,p_roomtype,conf#.nextval);
51 elseif check_availability%rowcount < 10 and p_roomtype =
52 'delux suite'
53 then
54 insert into custlist (name,phone,country,city,address,email,cridittype,criditno,
55 criditexp,nameoncard,arrivaldate,arrivaltime,am_pm,checkout,numadult,numchildren,roomtype,confirmation#)
56 values (p_name,p_phone,p_country,p_city,p_address,p_email,
57 p_cridittype,p_criditno,p_criditexp,p_nameoncard,
58 p_arrivaldate,p_arrivaltime,p_am_pm,p_checkout,p_numadult,
59 p_numchildren,p_roomtype,conf#.nextval);
60 else
61 htp.p('There is not available room from this type');
62 end if;
63 end;
64
65 end;

***** The Errors ....

line/column
43/9 PLS-00103: Encountered the symbol "CHECK_AVAILABILITY" when expecting one of the following: := . ( @ % ; The symbol ":=" was substituted for "CHECK_AVAILABILITY" to continue.
44/40 PLS-00103: Encountered the symbol "THEN" when expecting one of the following: . ( * @ % & - + ; / mod rem an exponent (**) and or ||
51/8 PLS-00103: Encountered the symbol "CHECK_AVAILABILITY" when expecting one of the following: := . ( @ % ; The symbol ":=" was substituted for "CHECK_AVAILABILITY" to continue.
53/1 PLS-00103: Encountered the symbol "THEN" when expecting one of the following: . ( * @ % & - + ; / mod rem an exponent (**) and or ||
63/1 PLS-00103: Encountered the symbol "END
Re: What's wrong with this procedure [message #371818 is a reply to message #371815] Mon, 11 December 2000 00:50 Go to previous messageGo to next message
Prem
Messages: 79
Registered: August 1998
Member
Asma,

43 elseif check_availability%rowcount < 30 and

It should be elsif. You have typed it as elseif.

hth

Prem :)
Re: What's wrong with this procedure [message #371820 is a reply to message #371815] Mon, 11 December 2000 02:10 Go to previous message
Madhavi
Messages: 23
Registered: November 1999
Junior Member
hello,
the syntax of the if else is wrong just check with the syntax and u have to use the then statement in the line 53 in the same line.
u have made some minor mistakes thats all
Previous Topic: Create table with auto increment column - HELP
Next Topic: Urgent help needed. Make a quick 50 bucks
Goto Forum:
  


Current Time: Thu May 02 07:10:52 CDT 2024