Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

By default, the database connector will not return any xml value or json value for any database column that is blank or null. If you want the database connector to return a empty string or null for such columns then set the emitNullColumns attribute to true. The emitNullColumns attribute can be set emitNullColumns in several locations:

...

dbconnector properties in the Standalone bundle.

...

in these configuration.xml elements from highest to lowest precedence : <dbconnector>, <queryset>, or <query>. The outer elements take precedence over the inner elements.

 


Here are several configuration.xml examples.

 

Code Block
<dbconnector version="2.5" emitNullColumns="true">

...

Code Block
dbconnector.emitNullColumns=true

 

 

 

If you choose to turn off the emit NULL columns attribute, there is a way to insert a conditional null in an insert statement if you are using a MySQL database. Refer to the Conditional NULL in MySQL Insert Statement topic for the details.If you are running with emitNullColumns=false (the default) you can still handle null and blank columns via well written business rules.Check the returned resultset as follows:

Code Block
if(x.resultSet[0].contactemailaddr) 
     vendorEmail.value = x.resultSet[0].contactemailaddr;
else
     vendorEmail.value = null;

Conditional NULL in MySQL Insert Statement

...