Jump to content
Changes to the Jaspersoft community edition download ×

Newbie Parameter question


ktrinad

Recommended Posts

By: Rick Coad - rickim

Newbie Parameter question

2003-05-21 10:26

I am trying out iReport and am trying to pass a parameter into a report using the iReport Compiler Tool. When I write the query like this:

SELECT

* FROM

DB2ADMIN.EMPLINFO WHERE DB2ADMIN.EMPLINFO.EMPL_COMPID = 1

I get my correct information.

But, if I write the query with my parameter

SELECT

* FROM

DB2ADMIN.EMPLINFO WHERE DB2ADMIN.EMPLINFO.EMPL_COMPID =

$P{COMPID}

I get the following error:

 

Executing query SELECT

 

* FROM

 

DB2ADMIN.EMPLINFO WHERE DB2ADMIN.EMPLINFO.EMPL_COMPID = $P{COMPID}

 

COM.ibm.db2.jdbc.DB2Exception: [iBM][CLI Driver] CLI0118E Invalid SQL syntax. SQLSTATE=37000

 

at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:241)

 

at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:186)

 

at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(SQLExceptionGenerator.java:419)

 

at COM.ibm.db2.jdbc.app.DB2Statement.execute2(DB2Statement.java:411)

 

at COM.ibm.db2.jdbc.app.DB2Statement.executeQuery(DB2Statement.java:333)

 

at IReportCompiler.main(IReportCompiler.java:145)

 

 

 

Abnormal termination!

 

Could you please instruct me as to what I am doing wrong? Thanks in advance.

 

 

 

 

By: Giulio Toffoli - gt78

RE: Newbie Parameter question

2003-05-21 11:03

At design time (alias using iReport) you have not a way to specify values for parameters (if you don't give to parameters a default value). For this reason you can specify a "test" query in the compiler form (for default is poposed the report query). If you want that jasperreport use the query setted for the report, ant not the query given manually troght the compiler form, leave the query field in the compiler form blank.

 

Giulio

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...