# Insert default value a table by a procedure

**URL:** <https://forum.codewithmosh.com/t/insert-default-value-a-table-by-a-procedure/17224>\
**Category:** SQL\
**Created:** [December 25, 2022, 7:26pm UTC](https://forum.codewithmosh.com/t/insert-default-value-a-table-by-a-procedure/17224 "2022-12-25T19:26:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackoak](https://avatars.discourse-cdn.com/v4/letter/j/8c91f0/32.png) [@jackoak](https://forum.codewithmosh.com/u/jackoak)\
**Post date:** [December 25, 2022, 7:26pm UTC](https://forum.codewithmosh.com/t/insert-default-value-a-table-by-a-procedure/17224/1 "2022-12-25T19:26:11Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/0/00d1ff358109cfa309d00a2c1a5737f349d9383d.png)

---

<div class="post-metadata">

**Author:** ![SAM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/sam/32/167_2.png) [@SAM](https://forum.codewithmosh.com/u/SAM)\
**Post date:** [December 25, 2022, 8:48pm UTC](https://forum.codewithmosh.com/t/insert-default-value-a-table-by-a-procedure/17224/2 "2022-12-25T20:48:54Z")

</div>

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.
