Cant get this simple SP to work!!!
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.