Operand type clash: int is incompatible with date + The INSERT statement conflicted with the FOREIGN KEY constraint

前端 未结 4 739
悲&欢浪女
悲&欢浪女 2020-12-11 00:03
create table pilot (
emp_num int,
pl_license varchar (3),
pl_ratings varchar (30),
pl_med_type int,
pl_med_date date,
pl_pt135_date date,
constraint PK_pilot primary         


        
相关标签:
4条回答
  • 2020-12-11 00:19

    I had the same problem. I tried 'yyyy-mm-dd' format i.e. '2013-26-11' and got rid of this problem...

    0 讨论(0)
  • 2020-12-11 00:40

    This expression 12-4-2005 is a calculated int and the value is -1997. You should do like this instead '2005-04-12' with the ' before and after.

    0 讨论(0)
  • 2020-12-11 00:41

    Try wrapping your dates in single quotes, like this:

    '15-6-2005'
    

    It should be able to parse the date this way.

    0 讨论(0)
  • 2020-12-11 00:44

    FYI this turned out to be an issue for me where I had two tables in a statement like the following:

    SELECT * FROM table1
    UNION ALL
    SELECT * FROM table2
    

    It worked, but then somewhere along the line the order of columns in one of the table definitions got changed. Changing the * to SELECT column1, column2 fixed the issue. No idea how that happened, but lesson learned!

    0 讨论(0)
提交回复
热议问题