Jump to content
Changes to the Jaspersoft community edition download ×

How to test NULL values returned from SQL?


2004 IR Help

Recommended Posts

By: Stepan RYBAR - t603

How to test NULL values returned from SQL?

2005-02-22 09:31

Hello!

 

I want to declare variable "TestVariable" in Variable Expression field as:

 

($F{NAZEV} == null)?(new String("is null")):(new String("is not null"))

 

It always returns "is null", although NAZEV contains string or nothing (null). I suppose, that I have wrong test condition. How should I write it? As ($F{NAZEV} == null) or ($F{NAZEV} == "null") or ($F{NAZEV} == "") or ($F{NAZEV}.equalsIgnoreCase("null") == null) or ($F{NAZEV}.equalsIgnoreCase("") == null) or anything else?

 

Thank You in advance for Your answer.

 

Stepan

 

 

 

 

 

By: Stepan RYBAR - t603

RE: How to test NULL values returned from SQL

2005-02-22 10:32

Hmm, I do not know, where I made an error, but it looks like it behaves as axpected using

 

($F{PRIJMENI} == null)?(new String("is null")):(new String("is not null"))

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...