on 09-13-2011 2:20 PM
Hi,
I have an object which is based on a prompt value.
I need a second object which takes the results of 1st object including the where condition and does some calculation
ex:
1) LOV object = country_id values
2) object1
select country.name from country
where country.name=@prompt('select country id','n','LOV Object'....)
3) Object2: If object1='India' then 'x' else 'y' end
My expected results will be something like
select case when a.name='India' then 'x' else 'y' end
from
(select country.name from country where country.country_id=1)a
Logic execution:
LOV should come from "LOV Object" and selected values should be passed to "Object 1" and based on these values we should get either 'x' or 'y'
But if i mention @select(object1) it is taking only the select of part of this object definition but not the where condition
Hi,
You have to remember that you are writing SQL building blocks, not code...
Also when you use @select(), yes that will only pull the contents of the Select box of that object.
To get the contents of the Where box, you need @Where().
These are separate because typically you are either building a select part (normal objects) OR a where part (filters).
So think out of the box and decide how you would write it in a sql statement if you did not have a universe,
then break it in pieces that make sense.
I'm not 100% sure of what it is you are trying to achieve, but you can do something like:
case @where(object2) when TRUE then @select(object2) end
Off course writing this in one go is just as valid, you don't have to reuse, only with big chunks or @prompt() stuff it makes sense to prevent typo's
Hope this helps,
Marianne
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In object1
select country.name from country
where country.name=@prompt('select country id','n','LOV Object'....)
you have to give the object name in where clause as object
[LOV Object]
not like string.
Just try this.
Regards,
Ragoth.C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.