[#836] - Accept NULL parameters values executing SQL queries

Category:
Feature request
Priority:
Low
Status:
Assigned
Project: Severity:
Trivial
Resolution:
Unable to Reproduce
Component: Reproducibility:
Always
Assigned to:

Issue moved from:
https://sourceforge.net/tracker/index.php?func=detail&aid=1455755&group_...

Consult the original issue for any attachments.

[ 1455755 ] Accept NULL parameters values executing SQL queries

Submitted By: Sam Stephens - postmoderncore
Date Submitted: 2006-03-21 15:42
Last Updated By: gt78 - Comment added
Date Last Updated: 2006-03-21 16:02
Number of Comments: 3
Number of Attachments: 0

Assigned To: Nobody/Anonymous
Priority: 5

Summary:
Accept NULL parameters values executing SQL queries I have a report which has an integer parameter, which is passed into the Report SQL using $P{Parameter}. I want this parameter to default to null.

However, when I input the SQL into Report SQL Query and press the Read Fields button the report gives me the error "Please set a default value for the parameter 'Parameter'".

The report will run successfully with the parameter being null, so the problem appears to be the Read Fields button.

Steps to recreate this error (you'll need a database to connect to).

1. Create a new report.
2. Create a new parameter, Parameter.
3. Set it's default value to NULL.
4. Go to the Report SQL.
5. Input the Report SQL Query as "select 1 where $P{Parameter} is null"
6. Press the Read Fields button.

Comments

Date: 2006-03-21 16:02
Sender: gt78SourceForge.net SubscriberProject Admin
Logged In: YES
user_id=616744

the report is executed by JasperReports. iReport executes the query only to gather query fields. It uses a BeanShell based engine to evaluate parameters expression.

Giulio

Date: 2006-03-21 15:57
Sender: postmoderncore
Logged In: YES
user_id=1278378

But if I can run the report with a null parameter value, doesn't that mean the query can run with null values?

The report runs OK. It's only the "Read Fields button" that has the issue.

Date: 2006-03-21 15:50
Sender: gt78SourceForge.net SubscriberProject Admin
Logged In: YES
user_id=616744

If I would be able to run a query using null values, I would do not ask you for a (default) value... :-)

I'll move this submission into the requests tracker.

Thanks

Giulio

No Files Currently Attached

tcloonan's picture
1739
Joined: Dec 22 2006 - 1:13am
Last seen: 16 years 3 months ago

1 Comment:

#1
  • Resolution:Open» Unable to Reproduce
  • Assigned:nobody»
Feedback
randomness