AGG Software Forums

Online Help Center => Data loggers and plug-ins => Topic started by: jamesant on October 11, 2013, 10:12:19 AM

Title: SQL DB plug-in not write NULL value
Post by: jamesant on October 11, 2013, 10:12:19 AM
How can I stop the SQL database plug-in from carrying out an SQL query if any of the values it needs to write is NULL ?

For example

insert into ADatabaseT1
values (:P1,:P2,:P3)   

if the value of P1 is NULL, I want the sql query to be skipped
Title: Re: SQL DB plug-in not write NULL value
Post by: Arthur Grasin on December 09, 2024, 11:00:00 AM
You need to do it with a filter plugin.
Title: Re: SQL DB plug-in not write NULL value
Post by: jamesant on October 11, 2013, 11:35:48 AM
I tried using the deadband filter, but found it didn't do what I needed

I solved it by changing the sql query.
It deletes the record if it wrote a null value into the Temp1 column.

insert into ADatabaseT1
values (:P1,:P2,:P3)   
delete from ADatabaseT1
where Temp1 is null