Section | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Note the string {customerId}. This is an example of how to pass data from your form fields into your SQL statements. For example, if your form field named customerId contains the value 1234 than the select statement would return the record for customer 1234.
Support for NULL or Blank
...
Database columns
By default, optional/empty form fields will send/return an empty string. This is controlled by the emit Null column attribute. When this attribute is enabled, the DB connector does the database connector will not return any xml value or json value for the empty database columns.
You can disable the default behavior for the whole db connector or at the queryset/query level.
There are two ways to change the behavior of the emit Null column attribute:
...
Add the dbconnector.emitNullColumns=true property to the dbconnector properties file for your installation.
...
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 setemitNullColumns in several locations:
dbconnector properties in the Standalone bundle.
- frevvo-config.properties in the frevvo-tomcat bundle.
- Configuration.xml in any of the elements: <dbconnector>, <queryset>, or <query>.
Here are several configuration.xml examples.
Code Block |
---|
<dbconnector version="2.5" emitNullColumns="true"> |
To change it at the queryset level, add the attribute to the queryset in configuration.xml
Code Block |
---|
queryset name="BIRT" emitNullColumns="true"> |
To disable it at the query level, add the attribute to the query in configuration.xml
Code Block |
---|
<query name="lkadgroupmembers2" emitNullColumns="true"> |
Here is a dbconnector-properties or frevvo-config.properties example
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.
...