Jump to content

Assign values to variable using SQL...


ronedog

Recommended Posts

How can I assign a value to a variable, then use that variable throught the report.  For example, I tried:

Inside the variable expression I put "$V{cat_id} = SELECT cat_id FROM category WHERE category_name = "bob"

But this gives me a syntax error.

I want to use the variable $V{cat_id} in the report in the SQL part....or simply throughout parts of the report...Is this even possible?

Thanks.

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

yes, it's possible but I think you're in mistake in defining your variable...

can you be more clear?

in your variable expression you must set:

"SELECT cat_id FROM category WHERE category_name = 'bob'   "

but this don't mean that $V{cat_id}  is a result value of the query... but it's only equals to the string "SELECT cat_id FROM...  "

you must create a query , select your cat_id and you have its value in a Field... and the assign it to a variable if it can solve something.

 

____________________________________
if it works... give me KARMA points please!    : ) 
____________________________________
 



Post Edited by slow at 05/03/2010 07:32
Link to comment
Share on other sites

  • 3 years later...

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