11-10-2016 04:15 AM
Hi,
I read a lot of articles about problems with inserting null values into database throught labview but can´t found the best solution.
In my database sometimes I don´t have to fill all the columns with data (f.e. the person doesn´t want to allow some personal information). So in that case i have to insert Null value.
Here is a modified small part of code where i´d like to learn how to handle this problem.
Thank you for your help
11-11-2016 02:29 PM - edited 11-11-2016 02:30 PM
check your optional field items to see if any of them are empty strings... if so, replace the empty strings with the word "NULL". This should work for MS Access and SQL Server.
of course, your database table fields must also be able to accept NULL values
11-14-2016 09:30 AM
I tried the solution, but as I expected, it didn´t work. The personal identity column is set to number, so it doesn´t accept the NULL value as a string. Is there any other option? This column accept Null values.
11-15-2016 01:50 AM
Set it to -1
/Y
05-16-2017 02:02 AM
There is a VI "DB Tools NULL.vi" try this VI.