Stored Procedure

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all

Can someone help me with the syntax to my stored procedure? Every time
I try to run it I receive the error code 1064. I checked my syntax
against the documentation on and it seems to be correct, but
of course I could be wrong. Here's my SP:

delimiter |

CREATE PROCEDURE `Universal`.`InsertCustomer`
    (IN _Name varchar, IN _Address varchar,
    IN _Username varchar, IN _Password varchar,
    IN _Email varchar, IN _Telephone int,
    IN _Newsletter tinyint, IN _PersonalData tinyint,
    IN _Profession varchar, IN _LanguageID int,
    IN _DateOfBirth date, IN _City varchar,
    IN _CountryID int, IN _FiscalNumber varchar)

    INSERT INTO Customers ( Name, Address,
            PostalCode, Username,
            Password, Email,
            Telephone, Newsletter,
            PersonalData, Profession,
            LanguageID, CreationDate,
            DateOfBirth, City,
            CountryID, FiscalNumber)

    VALUES        (_Name, _Address,
            _PostalCode, _Username,
            _Password, _Email,
            _Telephone, _Newsletter,
            _PersonalData, _Profession,
            _LanguageID, CURDATE(),
            _DateOfBirth, _City,
            _CountryID, _FiscalNumber)


This is my error:
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 ' IN
_Address varchar,
    IN _Username varchar, IN _Password varchar,
    IN _Email ' at line 2
(16 ms taken)

Re: Stored Procedure

Hieronimus wrote:
Quoted text here. Click to load it

You have to specify a length with VARCHAR.
For example, VARCHAR(30).

Bill K.

Site Timeline