Cannot add stored procedure with parameterized query

I'm fairly new to this so hopefully it is a dumb mistake...

I need to create a simple stored procedure along the lines of:

delimiter //
CREATE DEFINER='root' [at] 'localhost' PROCEDURE Insertuser()
BEGIN
insert into user (firstname,lastname) values ( [at] fn, [at] ln);
END;
//

that I can then use with the code:

MySqlConnection oConn = new
MySqlConnection(ConfigurationManager.AppSettings["MySqlConn" ].ToString());
oConn.Open();
MySqlCommand oCommand = oConn.CreateCommand();
oCommand.CommandType = CommandType.Text;
oCommand.CommandText = "INSERT into user (firstname,lastname)
VALUES ( [at] fn, [at] ln)";

MySqlParameter p0 = new MySqlParameter(" [at] fn", TextBox2.Text);
oCommand.Parameters.Add(p0);
MySqlParameter p1 = new MySqlParameter(" [at] ln", TextBox3.Text);
oCommand.Parameters.Add(p1);

oCommand.ExecuteNonQuery();
oConn.Close();

However running this sproc and code with MySQL just puts in a blank
record into the table :-(

So...I read that with MySQL you need to use the ? character in place of
the [at] character for parameterized queries.
I did this replacement and the code ran fine but ONLY if I had the
query set up as CommandType text (as in the example above).

The PROBLEM is that when I try to create the sproc using the MySQL
command line tool with:

delimiter //
CREATE DEFINER='root' [at] 'localhost' PROCEDURE Insertuser()
BEGIN
insert into user (firstname,lastname) values (?fn, ?ln);
END;
//

It gives me a syntax error - presumably due to the ? characters!

Any advice on where I am going wrong gladly received!
JP2006 [ Mi, 26 Juli 2006 22:42 ] [ ID #1405611 ]
Datenbanken » mailing.database.mysql » Cannot add stored procedure with parameterized query

Vorheriges Thema: Using MS Access to get data in/out of a MySQL database
Nächstes Thema: Help with Performance Tuning