mysql: altered function but stays old function -


i changed column name in table, , needed change function it. changed function. still runs old function! gives me :

"error code: 1054 unknown column 'avdoctorid' in 'where clause'"  

and i'm sure changed function because if see function new one! how can be?

i did in mysql workbench, , if see function in other program show new function, gives same error when try run it.

this query run it

select fnc_createappointment(8,1,"2012-08-06","15:30:00","something"); 

and function itself:

 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 id tbl_available avdays = dagweek , avhours = apptime , avcalendarid = calid   ; if id > 0  select appointmentid id2 tbl_appointment  appointmentdate = appdate , appointmenttime = apptime , calendarid = calid;  if id2 = 0  select absentid afwezig tbl_absent abholiday = appdate , ababsent = apptime , abcalendarid = calid; if afwezig = 0  insert 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 

the error returned is:

call db_demo.fnc_createappointment(8,1,"2012-08-06","15:30:00","something") error code: 1054 unknown column 'avdoctorid' in 'where clause' 

'avdoctorid' old column

you might need drop function first , run create statement again.

drop function if exists `<function_name>` 

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -