Skip navigation links

MySQL Forums :: Stored Procedures :: Problem with creating a stored procedure


Advanced Search

Problem with creating a stored procedure
Posted by: Mike Markgraf ()
Date: April 13, 2012 03:08PM

I used the workbench to create a routine, but now when I run it in phpmyadmin with MySQl 5.5 it keeps giving me an error. Can someone point out what I am doing wrong, this is my first time doing procedures with MySQL. Code below


SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';

CREATE SCHEMA IF NOT EXISTS `testfinal1` DEFAULT CHARACTER SET latin1 ;
USE `testfinal1` ;

-- -----------------------------------------------------
-- procedure sp_addChild
-- -----------------------------------------------------

DELIMITER $$
USE `testfinal1`$$
CREATE PROCEDURE `testfinal1`.`sp_addChild`
(
CID int,
fname varchar(50),
lname varchar(50),
DOB DATETIME,
gender varchar(10),
goals varchar(255),
nameMeaning varchar(255),
orphaned tinyint,
family varchar(255),
eligible tinyint,
notes varchar(255)
-- May need foreign key constraint
)
BEGIN

Insert into Children
(
Child_ID,
Child_Fname,
Child_lname,
Child_DOB,
Child_gender,
Child_goals,
Child_nameMeaning,
Child_orphaned,
Child_family,
Child_eligible,
Child_notes
)
values
(
CID,
fname,
lname,
DOB,
gender,
goals,
nameMeaning,
orphaned,
family,
eligible,
notes
);
END
$$

DELIMITER ;


SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

Options: ReplyQuote


Subject Views Written By Posted
Problem with creating a stored procedure 964 Mike Markgraf 04/13/2012 03:08PM
Re: Problem with creating a stored procedure 518 Rick James 04/15/2012 11:43PM
Re: Problem with creating a stored procedure 482 Mike Markgraf 04/19/2012 04:20PM
Re: Problem with creating a stored procedure 503 Peter Brawley 04/19/2012 04:46PM
Re: Problem with creating a stored procedure 465 Mike Markgraf 04/19/2012 05:56PM
Re: Problem with creating a stored procedure 471 Barry Galbraith 04/19/2012 08:47PM
Re: Problem with creating a stored procedure 481 Mike Markgraf 04/19/2012 11:35PM
Re: Problem with creating a stored procedure 682 Mike Markgraf 04/19/2012 11:50PM
Re: Problem with creating a stored procedure 534 Barry Galbraith 04/21/2012 06:03AM
Re: Problem with creating a stored procedure 435 Mike Markgraf 04/21/2012 10:37AM
Re: Problem with creating a stored procedure 531 Rick James 04/21/2012 12:57PM
Re: Problem with creating a stored procedure 457 Mike Markgraf 04/21/2012 10:17PM
Re: Problem with creating a stored procedure 474 Rick James 04/22/2012 11:16PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.