Saturday, January 28, 2012

Boolean column in where condition (SQL)

When we check a boolean value in condition, we can use this form.

select
* from SomeTable where true
.

Here true is a column with boolean data type. The above query will give all records which have true as the value for true column.

select * from SomeTable where not(true).

The above query will give all records in SomeTable where value for true column is false.

Most databases will accept this format.

Tuesday, January 17, 2012

Jasper schedule issue

When we schedule a report, which is using union in input control 'single select query' to show multiple values (past 3, 5, 7, etc), the value we selected while we schedule the report will be changed to first value on the next day of report scheduled.

So we have to use 'Single Select list of values' type input control and hard code the values and using dynamic query we can pass them to the report.