Load data infile default value not inserting in table

后端 未结 2 439
無奈伤痛
無奈伤痛 2021-01-21 21:09

I\'m importing a csv file using LOAD DATAINFILE

The csv columns are NAME,TYPE,STATUS

my table structure is

Name  : varchar
TYPE  : Varchar
Status: Ti         


        
2条回答
  •  被撕碎了的回忆
    2021-01-21 22:05

    After you execute the query , check for any warnings using

    show warnings
    

    Default value is 0 for numeric data types and '' for strings.

    So you should have set default value 1 while creating the table

    create table tableName
    (
    name nvarchar(100) not null,
    type nvarchar(100) not null,
    status smallint default 1
    );
    

提交回复
热议问题