テーブルの列名を変更したため、関数を変更する必要がありました。ということで機能を変更。しかし、それはまだ古い機能を実行します! それは私に与えます:
"Error Code: 1054 Unknown column 'avDoctorID' in 'where clause'"
関数自体が表示された場合、それは新しい関数であるため、関数を変更したと確信しています! どうすればいいの?
私はmysqlワークベンチでこれを行いました.他のプログラムで関数を見ると、新しい関数が表示されますが、実行しようとすると同じエラーが発生します.
これはそれを実行するためのクエリです
select FNC_CreateAppointment(8,1,"2012-08-06","15:30:00","something");
そして、これは関数自体です:
DELIMITER $$
CREATE DEFINER=`root`@`%` FUNCTION `fnc_CreateAppointment`(clid int,calid int,appdate date,apptime time,commentaar varchar(3000)) RETURNS tinyint(1)
BEGIN
declare succeeded boolean;
declare id2 int;
declare id int;
declare dagweek int;
Declare afwezig int;
set afwezig = 0;
set dagweek = Dayofweek(appdate);
set id =0;
set id2 = 0;
set succeeded = false;
select availableID into id from tbl_available where AVdays = dagweek and AVHours = apptime and avCalendarID = calid
;
if id > 0
then
select appointmentID into id2 from tbl_appointment where appointmentDate = appdate and appointmentTime = apptime and CalendarID = calid;
if id2 = 0
then
select AbsentID into afwezig from tbl_absent where abHoliday = appdate and abAbsent = apptime and abCalendarID = calid;
if afwezig = 0 then
insert into tbl_appointment(clientId,Calendarid,appointmentDate,appointmenttime,remark)
Values
(clid,calid,appdate,apptime,commentaar);
set succeeded = true;
end if;
end if;
end if;
return succeeded;
END
返されるエラーは次のとおりです。
call db_demo.FNC_CreateAppointment(8,1,"2012-08-06","15:30:00","something") Error Code: 1054 Unknown column 'avDoctorID' in 'where clause'
「avDoctorID」は古い列です