Purplegoldfish
Purplegoldfish

Reputation: 5284

MySql Stored Procedure Help

I'm writing some procedures in MySql rather than MS SQL, and I'm having a bit of a problem with syntax.

CREATE PROCEDURE spAddUser
(
   IN pUsername Varchar(20),
   IN pPassword Varchar(16),
   IN pFirstname Varchar(20),
   IN pSurname Varchar(20),
   IN pEmail Varchar(50),
   IN pWebsite Varchar(50)
)
BEGIN
   INSERT INTO 
    users
    (Username, Password, Firstname, Surname, Email, Website)
   VALUES
    (pUsername, pPassword pFirstname, pSurname, pEmail, pWebsite);  
END;

This is the code I have come up with so far, just a basic add user proc, but I keep getting this 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 'pFirstname, pSurname, pEmail, pWebsite)' at line 15

Any ideas what I'm doing wrong?

Upvotes: 0

Views: 89

Answers (1)

Luke Woodward
Luke Woodward

Reputation: 64949

You're missing a comma between pPassword and pFirstname in the line after VALUES.

Upvotes: 2

Related Questions