cancel
Showing results for 
Search instead for 
Did you mean: 

ireport: "SQLServerException: An object or column name is missing or empty. For SELECT INTO ..."

Former Member
0 Kudos
  • ireport 5.6.0 (have also tried version 4.0.4, because that's the version of the jasperreports jar I see in my hybris installation, but I had issues trying to get the MS-SQLServer driver set up in it);

  • hybris 5.4.0.9;

  • SQLServer 2012 running in VMWare Fusion (because on a Mac but need to implement report-queries involving date-functions, which are database-specific, and the project uses SQLServer)

  • on a Mac running El Capitain (10.11.2)

  • within ireport, create a new jrxml-file

  • therein create a table using even a simple query such as "select {name} from {customer}"

  • upon selecting the fields from the query to be used in the table, I get the following error in hybris' log:

  • "[ReflectiveCommand] Unexpected invocation target exception: com.microsoft.sqlserver.jdbc.SQLServerException: An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Change the alias to a valid name."

  • note that my query is not a "SELECT INTO" query

  • the query works in the hac (so does my compex group-by query, which causes the same error in ireport)

  • it actually worked previously and somehow seems to still work in a previous jrxml-file; so, I suspected a jrxml format-issue

  • I've experimented with the "Compatibility" option in ireport, though I did that in order to deal with the "uuid" output-format issue I'd encountered; I don't know if that could somehow be relevant; I did meanwhile notice that changing that output-format version did not remove the offending "uuid" attributes that hybris 5.4.0.9's reportcockpit isn't compatible with; I removed them with a regex-replace instead.

  • back before I first saw this error, I wasn't seeing results, though the hac showed such; then, I found a property one needs to set at the top-level "when no results" (or the like"); otherwise, processing seems to get short-circuited; so, I set that as directed and did see the expected result; a few days later, upon re-starting ireport to revise that report, I first saw this SQLServerException

Former Member
0 Kudos

NOTE: I also tried jasperreports studio (latest version). However, during the creation of a table, the metadata-request errored, referring to an unrecognized type of some sort (type 9 ?). I don't have it installed anymore, so I don't have those details at hand. I also tried using "flexiblesearch" instead of "sql" in the jdbc-url in the config of the database-connection, but that didn't help.

Accepted Solutions (0)

Answers (0)