AGG Software Forums

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



Title: SQL DB plug-in not write NULL value
Post by: jamesant on October 11, 2013, 01:12:19 PM
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 October 11, 2013, 01:42:43 PM
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, 02:35:48 PM
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