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 6756017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:28:22+00:00 2026-05-26T13:28:22+00:00

I created a procedure that is supposed to do some operation but every time

  • 0

I created a procedure that is supposed to do some operation but every time I call it, mysql comes out with an error, which I have not clue what it means. I have tried to understand it in vain, here ‘s the table structure which the stored procedure where made to do an operation on it:

CREATE  TABLE `recruitment`.`job_seeker` (
    `user_id` INT Null ,
    `fname` VARCHAR(45) Null ,
    `lname` VARCHAR(45) Null ,
    `mname` VARCHAR(45) Null ,
    `gender` VARCHAR(10) Null ,
    `dob` DATE Null ,
    `marital_status` VARCHAR(45) Null ,
    `address` VARCHAR(45) Null ,
    `city` VARCHAR(45) Null ,
    `nationality` VARCHAR(45) Null ,
    `phone` VARCHAR(45) Null ,
    `mobile` VARCHAR(45) Null ,
    `degree_id` INT Null ,
    `education` VARCHAR(100) Null ,
    `experience` VARCHAR(250) Null ,
    `other` VARCHAR(250) Null ,
    `job_target` VARCHAR(250) Null ,
    PRIMARY KEY (`user_id`) ,
    INDEX `user_id` (`user_id` ASC) ,
    INDEX `degree_id` (`degree_id` ASC) ,
    CONSTRAINT `user_id`
    FOREIGN KEY (`user_id` )
    REFERENCES `recruitment`.`user_authentication` (`user_id` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
    CONSTRAINT `degree_id`
    FOREIGN KEY (`degree_id` )
    REFERENCES `recruitment`.`degree` (`degree_id` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION
);

Here’s the stored procedure:

DELIMITER $$

CREATE DEFINER=`root`@`localhost` PROCEDURE `createSeekerProfile`(in userName varchar(45),
    in fn varchar(45),in mn varchar(45), in ln varchar(45),
    in gender varchar(6),in nationality varchar(45),
    in ad varchar(45),in city varchar(45),in phone varchar(15),in mob varchar(15),

    in   maritalStatus varchar(45), in degId int, in educ varchar(100),
    in exper varchar(250), in other   varchar(250),
    in dob date,in jtarg varchar(250))
    begin
    declare returned_ID int;
    set @dyn_que = CONCAT('select user_id into @returned_ID
    from user_authentication where user_name =  ? ');
    prepare s1 from @dyn_que ;
set @usn = userName;
execute s1 using @usn ;

set @dyn_update =CONCAT('update job_seeker set fname =',fn,', lname = ',ln,' ,mname = ',mn,' ,
nationality =',nationality,',address =',ad,',city =',city,',phone=',phone,',
mobile =',mob,', gender = ',gender,',other =',other,',
degree_id =',degId,', job_target=',jtarg,', dob =',dob,', education =',educ,',
experience=',exper,', marital_status=',maritalStatus,' where user_id =@returned_ID');
prepare s2 from @dyn_update;
execute s2;
end

Whenever I call the procedure through:

call createSeekerProfile('realsilhouette','robert','marie','david','male'
,'earthal','an address here','capital of earth','012178152',
'1111111111','single',2,'engineering','looking forward','determined',
'2008-7-04','Oracle CEO')

I get an awful error which is:

Error Code: 1064
You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near 'address here,
city =capital of earth,phone=012178152,
mobile =1111111111, gender' at line 2

However when I try execute the update statement manually which is inside stored procedure, it works out so well.

new Post :
thanks god,finally I fixed the problem up, The problem came down to the order, all I did was just make the parameters in order, though update statement does not care about the order, as far as I know, I’m not sure, But what i am sure of is the stored procedure got created beautifully, here’s the new code :

DELIMITER $$

CREATE DEFINER=`root`@`localhost` PROCEDURE `createSeekerProfile`(
in un varchar(45),
in fn varchar(45),
in ln varchar(45), 
in mn varchar(45),
in g varchar(10),
in dateOfBirth date,
in ms varchar(45),
in ad varchar(45),
in city varchar(45),
in nat varchar(45),
in ph varchar(45),
in mob varchar(45),
in degid int,
in educ varchar(100),
in exp varchar(250),
in other varchar(250),
in jtarg varchar(250))
begin

declare returned_ID int(11);

 set @dyn_que = CONCAT('select user_id into @returned_ID from user_authentication
 where user_name =  ? ');
 prepare s1 from @dyn_que ;
 set @usn = un;
 execute s1 using @usn ;


 set @dyn_update =CONCAT('update job_seeker set fname  
 ="',fn,'",lname="',ln,'",mname="',mn,'",lname ="',ln,'",
 gender ="',g,'",dob="',dateOfBirth,'",marital_status="',ms,'",
 address="',ad,'",city="',city,'",
 nationality="',nat,'",phone="',ph,'",mobile="',mob,'",degree_id="',
 degid,'",education="',educ,'",
 experience="',exp,'",other="',other,'",job_target="',jtarg,'" 
 where user_id = @returned_ID');
 prepare stm from @dyn_update;
 execute stm;
 end $$

many thanks

  • 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-05-26T13:28:22+00:00Added an answer on May 26, 2026 at 1:28 pm

    Your forgot about quoting string values.

    for example:

    concat('update yourTable
    set address ="',  @address, '" 
    where id = 1');
    

    or use function quote

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's assume, we create a stored procedure that is supposed to retrieve customer details
I've created a package that contains a stored procedure that I plan to invoke
I have a modal dialog that is created with the following: procedure TFormCompose.createParams(var Params:
I've got a mySql stored procedure that looks like this-- delimiter | create procedure
i am writing stored procedures in MySQL that return values; CREATE PROCEDURE getCustomerById (id
I would like to create a stored procedure in MySQL that took a list
I need a some stored procedure that called like: search('foo bar') makes a search
I have created a simple CLR procedure that creates a Folder. The problem is
I've created some classes that will be used to provide data to stored procedures
Suppose I have a stored procedure that manages its own transaction CREATE PROCEDURE theProc

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.