Insert default value a table by a procedure

I create a procedure for input costomers info as following. But it failed.

I call the procedure and input values. The “default” in line 16 does not work.

I’d expect DEFAULT to insert a columns default value and that wouldn’t make much sense for a primary key column.

Try an INSERT with column names (INSERT INTO customers (first_name, ...).

I believe in MySQL you can use NULL as the column value for the auto increment column in an INSERT statement but I’d prefer the named insert.

1 Like