Stored Procedure

Stored Procedure

am 24.04.2006 13:44:05 von rui.pacheco

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 mysql.com 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)
BEGIN

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)

END|
;


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

am 24.04.2006 21:16:26 von Bill Karwin

Hieronimus wrote:
> CREATE PROCEDURE `Universal`.`InsertCustomer`
> (IN _Name varchar, IN _Address varchar,
....
> 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,

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

Regards,
Bill K.