MySQL Forums
Forum List  »  Stored Procedures

Cant get this simple SP to work!!!
Posted by: Aaran Gravestock
Date: January 10, 2006 04:26AM

I'm new to mySQL, and I'm trying to create a very simple Stored Procedure...

CREATE PROCEDURE SPSaveEnquiry
(
IN title CHAR(10),
IN forename CHAR(50),
IN surname CHAR(50),
IN dob DATE,
IN postcode CHAR(7),
IN work_phone CHAR(10),
IN mobile_phone CHAR(10),
IN home_phone CHAR(10),
IN email CHAR(50),
IN income DECIMAL(6,2),
IN emp_status CHAR(50),
IN repayment_method CHAR(50),
IN loan_term CHAR(50),
IN bankrupt ENUM('yes','no'),
IN curr_mort_amt DECIMAL(6,2),
IN curr_mort_pay DECIMAL(6,2),
IN endowment ENUM('yes','no'),
IN mortgage_provider CHAR(50)
)
BEGIN
INSERT INTO lead_collector.tbl_enquiry (en_title, en_forename, en_surname, en_dob, en_postcode, en_workphone, en_mobilephone, en_homephone, en_email, en_income, en_empstatus, en_repaymethod, en_loanterm, en_bankrupt, en_currmortgage, en_currpayment, en_endowment, en_endowwith)
VALUES (title, forename, surname, dob, postcode, work_phone, mobile_phone, home_phone, email, income, emp_status, repayment_method, loan_term, bankrupt, curr_mort_amt, curr_mort_pay, endowment, mortgage_provider);
END;

I get the error:
#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 'INSERT INTO lead_collector.tbl_enquiry (en_title, en_forename, en_surname, en_do' at line 23

Can anyone suggest why this doesn't work! I presume it's my syntax!



Edited 1 time(s). Last edit at 01/10/2006 04:28AM by Aaran Gravestock.

Options: ReplyQuote


Subject
Views
Written By
Posted
Cant get this simple SP to work!!!
2067
January 10, 2006 04:26AM


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.