LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the equivalent Database Connectivity VI of the SQL Toolkit 'Set SQL Parameter to Null' VI ?

I am using the database connectivity (ADO based) tool and I want to be able to insert a null values.
I have included a simple VI that demonstrates how this works with SQL toolkit .
Null values are very useful and occur frequently in dealing with data. I wish that LabVIEW handled them much better - (e.g. there is not datatype in LabVIEW corresponding to a Null value).
0 Kudos
Message 1 of 3
(2,393 Views)
The VI was not attached but I'm going to answer with what I have here.
- Currently, the Database Toolset converts NULLs to the default value for LabVIEW data types (ie, False for Boolean, empty strings, zero for numbers, empty arrays, etc). In the user manual there is an example that shows database records containing NULL values being first converted to a string, empty strings (the NULLs) are then converted to NaNs instead of the usual zero value. This method requires you to know what data types each field contains and that they know what to look for and how to convert the data.
You can go to this following link to suggest that a null datatype be implemented:
https://sine.ni.com/apps/we/nicc.call_me?p_country=&p_lang_id=US&p_form_id=58

-Also you cannot leave par
ameters values empty because there is a big difference between executing an SQL statement and doing a Parameterized Query, especially when looking at the low-level ADO layer.When doing Parameterized Queries, you MUST specify all parameter values - leaving them empty results in ADO trapping errors rather than using a default value.

Regards,
Cyril Bouton
Applications Engineer
National Instruments
Cyril Bouton
Active LabVIEW Developper
Message 2 of 3
(2,393 Views)
Cyril,
I have attached the VI that was missing from the first question. What I am looking for is the ADO equivalent of the 'Set SQL Parameter to Null.VI' which is the VI wired with parameter # 2. In this VI I am concerned with putting Null values into the database and not handling Null values that are retrieved from the database.
Thanks for the help,
John
0 Kudos
Message 3 of 3
(2,393 Views)