dbTalk Databases Forums  

Stored Procedure

mailing.database.mysql mailing.database.mysql


Discuss Stored Procedure in the mailing.database.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Hieronimus
 
Posts: n/a

Default Stored Procedure - 04-24-2006 , 06:44 AM






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)


Reply With Quote
  #2  
Old   
Bill Karwin
 
Posts: n/a

Default Re: Stored Procedure - 04-24-2006 , 02:16 PM






Hieronimus wrote:
Quote:
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.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.