Jump to content

BIRT Developer Center
Download


Photo
- - - - -

Parameters without quotes


  • Please log in to reply
1 reply to this topic

#1 the.root

the.root

    Member

  • Members
  • PipPip
  • 17 posts

Posted 27 February 2012 - 12:04 PM

Hello, I'm trying to pass an alias.column_name off through a view-time parameter used in my query, however whenever I do I get empty results. I imagine this is because the Birt Spreadsheet Designer is encapsulating my parameters with single or double quotes and since i'm referring direcetly to a column name and not a value mysql isn't returning anything.. I had the same problem with birt/eclipse but I got around it by just creating a javascript before the dataset was queried and replaced the values in the query w/out quotes. EX: RP_property ,is my parameter. SELECT * FROM property_info AS pi WHERE pi.propertyid = :RP_property .... Now if I set RP_property to a valid entry say 001 it works no problem; but if I set it to pi.propertyid ,it returns nothing. It should return the entire table. I don't know if there's a way to show the generated query somehow after all parameters and what not get filled in at run time, so i'm just guessing it's because of some quotes being added. I'm sure there's an easy work around with the spreadsheet designer/java api i don't know about yet. I'm still rather new in the realm. Please let me know if you have any suggestions or thoughts!

#2 the.root

the.root

    Member

  • Members
  • PipPip
  • 17 posts

Posted 29 February 2012 - 07:29 AM

FYI, I ended up just making a sproc and built a dynamic sql statement based on the parameters, rather then just try to pass off column names as variables. It worked for me, although I'd still be curious if there's a way to do this in spreadsheet designer.