Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8069605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:06:19+00:00 2026-06-05T13:06:19+00:00

I changed a column name in a table, and i needed to change a

  • 0

I changed a column name in a table, and i needed to change a function for it. So i changed the function. But it still runs the old function! it gives me :

"Error Code: 1054 Unknown column 'avDoctorID' in 'where clause'" 

and i’m sure i changed the function because if i see the function itself it is the new one! how can this be?

i did this in mysql workbench, and if i see the function in any other program it show the new function, but gives the same error when i try to run it.

This is the query to run it

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

And this it the 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 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

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’ is the old column

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T13:06:21+00:00Added an answer on June 5, 2026 at 1:06 pm

    You might need to drop the function first and then run the CREATE statement again.

    DROP FUNCTION IF EXISTS `<function_name>`
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have changed a column name in a table in my SQL Server 2005
A fellow developer changed all the values in the userid column of table map
How to change column order in a table using SQL query in SQL Server
I need to change the type of my primary key column on a table
How do I change the default value of an existing column in a table
Here is an example of my tables <table name=user> <column name=name type=varchar size=255 required=true
Two classes: <class name=SpreadsheetImportTemplate table=spreadsheetimport_template> <id name=id type=int column=id unsaved-value=0> <generator class=native /> </id>
Probably easy one. How can i change rows or column heigh? xlApp = new
What column does DISTINCT work with in JPA and is it possible to change
How to change header text in DatagridView and how to add or remove column

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.