Jump to content
Changes to the Jaspersoft community edition download ×

using $F{textField} in SQL query


2004 IR Help

Recommended Posts

By: Hopoz - hopoz

using $F{textField} in SQL query

2004-03-21 23:46

Hi, I'm new to jasper and ireports and am trying to create a query string based on a value in a textField. In a similar fashion to using paramaters, I am trying to use it like: SELECT ... WHERE columnName=$F{reg_code};

 

I get an error "parse error at or near "{"...

 

Any help is greatly appreciated

 

thankyou.

 

Hopoz.

 

 

 

 

By: andreas zeiner - andreaszeiner

RE: using $F{textField} in SQL query

2004-03-22 00:12

hi

 

you should use $P{parametername} instead of $F{}. $F indicates a field which you retrieve from the query.

 

greetinx

 

andy

 

 

 

 

By: Rick Millar - rmillar

RE: using $F{textField} in SQL query

2004-03-22 08:22

Also, unless things have changed, when you are referencing parameters in a SQL statement, you need to put an exlamation point in the reference (e.g. $P!{parametername}

 

Rick

 

 

 

 

By: Hopoz - hopoz

RE: using $F{textField} in SQL query

2004-03-22 14:49

Thankyou for the help,

 

I was actually trying to use the value in the text field as a parameter for another sql query.

e.g. two queries with 1 report. I have used this forum to discover is not possible.

Anyone else trying this might want to try using sub-reports or rewriting their sql query to return all the required fields (if possible).

 

Scott

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