LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Handling NULL values with database connectivity toolkit

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 

0 Kudos
Message 1 of 5
(4,077 Views)

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

0 Kudos
Message 2 of 5
(4,008 Views)

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.

0 Kudos
Message 3 of 5
(3,977 Views)

Set it to -1

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 5
(3,957 Views)

There is a VI "DB Tools NULL.vi" try this VI.

0 Kudos
Message 5 of 5
(3,665 Views)