Jump to content
JasperReports Library 7.0 is now available ×

Error "column not found" when using parameter


2004 IR Help

Recommended Posts

By: Luciano Zanin - cianoz

Error "column not found" when using parameter

2004-04-19 03:14

I'm refering to iReport 0.2.3.1 used with MySQL 4.0.18

 

I have a simple query using a parameter, but i alway get this error:

 

Error filling print... impronta $ impronta jdbc:mysql://tsimpr/contfiere java.sql.SQLException: Column not found, message from server: "Colonna sconosciuta 'ITALIA' in 'where clause'" at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1905) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1109) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1203) at com.mysql.jdbc.Connection.execSQL(Connection.java:2090) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1496) at dori.jasper.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:454) at dori.jasper.engine.fill.JRFiller.fillReport(JRFiller.java:119) at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:219) at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:159) at it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:230) at java.lang.Thread.run(Thread.java:534)

 

 

The query is the following:

 

SELECT * FROM saie204t

WHERE stato LIKE CONCAT('%',$P!{NAZ},'%')

OR $P!{NAZ} IS NULL

ORDER BY stato, prov

 

The "NAZ" parameter is defined as java.lang.String and i set this string as default value: "ITALIA"

 

The problem occurs if i use the parameter; if i substitute the parameter call in the query --- with a query like SELECT * FROM saie204t

WHERE stato LIKE CONCAT('%','ITALIA','%') --- report is correctly executed and i get the expected results.

 

Anyone finds something incorrect in my report definition ?

Thanks in advance for any reply.

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