How to insert an initial value in column of longtext type in mysql command

225 views Asked by At

This is the default of the table:

desc extender_device; 
+-------------------------+--------------+------+-----+---------+-------+
| Field                   | Type         | Null | Key | Default | Extra |
+-------------------------+--------------+------+-----+---------+-------+
| sn                      | varchar(16)  | NO   | PRI | NULL    |       |
| syncing_stage           | longtext     | NO   |     | NULL    |       |
| created_at              | datetime(6)  | NO   |     | NULL    |       |
| updated_at              | datetime(6)  | NO   |     | NULL    |       |
+-------------------------+--------------+------+-----+---------+-------+

If I was to insert an entry on that table on sql command where the syncing_stage is of blank text, What is the sql looks like. here is the one I have tried and failed:

insert into extender_device ( sn, syncing_stage) values ( 'AX123', '{}');

as I am using the wrong data for the "syncing_stage" column.

Thanks,

Jack

0

There are 0 answers