f



Mysql Stored Procedure error 1064

I'm very new to mysql, trying to create a Stored procedure using the
following syntax:

DROP PROCEDURE IF EXISTS add_new_user;
DELIMITER |
CREATE PROCEDURE add_new_user
        (firstname VARCHAR,
         lastname VARCHAR,
         sal VARCHAR,
         address VARCHAR,
         city VARCHAR,
         2dstate VARCHAR,
         zc INT,
         em VARCHAR,
         party INT,
         phone VARCHAR)
BEGIN

insert into end_user
(first_name,last_name,salutation,street_address,city,idref_state_fip,zip,email,party,phone)
values (firstname,lastname,sal,address,city,
2dstate,zc,em,party,phone);

END;
|

DELIMITER ;


Which generated the following error messages when executed:

mysql> source /home/bonk/add_new_user.sql
Database changed
Query OK, 0 rows affected, 1 warning (0.00 sec)

ERROR 1064 (42000): 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 '
	 lastname VARCHAR,
	 sal VARCHAR,
	 address VARCHAR,
	 city VARCHAR,
	 2dst' at line 2

Any ideas what I'm doing wrong? I'm running 5.0.67 mysql on ubuntu
9.04. All the posting I see on the web seem to indicate that a
reserved word is bing used in the statement, however I cannot find
one.

0
5/6/2009 10:41:04 PM
comp.databases.mysql 6944 articles. 1 followers. laredotornado (869) is leader. Post Follow

1 Replies
491 Views

Similar Articles

[PageSpeed] 29

In article <7442ca04-70c6-46ec-af80-5cab5108c24b@s21g2000vbb.googlegroups.com>,
Bonk  <bonk.brennan@gmail.com> wrote:
>I'm very new to mysql, trying to create a Stored procedure using the
>following syntax:
>
>DROP PROCEDURE IF EXISTS add_new_user;
>DELIMITER |
>CREATE PROCEDURE add_new_user
>        (firstname VARCHAR,

VARCHAR takes a length.  For example:
	(firstname VARCHAR(20),

>         lastname VARCHAR,
>         sal VARCHAR,
>         address VARCHAR,
>         city VARCHAR,
>         2dstate VARCHAR,
>         zc INT,
0
5/7/2009 12:03:21 AM
Reply: