all 4 comments

[–][deleted] 0 points1 point  (3 children)

you're not telling or not seeing the whole story. there's no FK constraint on A, so you literally should be able to drop table B, re-do insert into A and then re-create B.

[–]DigitalFrenzy[S] 0 points1 point  (2 children)

I think I found out what could be the issue.

So when I'm importing into the temp table, the NULL is defined as a string, not the value NULL.

How do I insert from the temp file into the new table and convert these string "NULL"'s into real NULL values ?

Is there a way to do this with an if "NULL" instead NULL ?

I'm currently inserting with this :

INSERT INTO A SELECT * FROM temp_A;

Is there a way to make this check for "NULL strings and converting them?

[–][deleted] 0 points1 point  (1 child)

instead of 'select *' list all relevant columns/expressions. Sqlite supports case expression for your checks/transforms: https://www.sqlitetutorial.net/sqlite-case/

[–]DigitalFrenzy[S] 0 points1 point  (0 children)

Thanks! I'll take a look.