Hi,
My job uses query in a parameter.
Eg: select * from personnel is #query#
Now I want to put a condition.
select * from personnel where id in ('1','2')
I want to put ('1','2') in a parameter #condition#
so I want
select * from personnel where id in #condition# to be in #query#.
But when I put a parameter inside a parameter it doesnot read the second parameter #condition# and I get an error saying "missing expression".
How can I handle this?
Parameter
Moderators: chulett, rschirm, roy
Re: Parameter
Try this
select * from personnel where id in ('#condition1#','#condition2#')
when you want to put parameters in SQL, use the single quotes in SQL level but not in parameter
so in parameter level
condition1=1 (do not put quotes here)
condition2=2 (do not put quotes here)
select * from personnel where id in ('#condition1#','#condition2#')
when you want to put parameters in SQL, use the single quotes in SQL level but not in parameter
so in parameter level
condition1=1 (do not put quotes here)
condition2=2 (do not put quotes here)
dsconultant wrote:Hi,
My job uses query in a parameter.
Eg: select * from personnel is #query#
Now I want to put a condition.
select * from personnel where id in ('1','2')
I want to put ('1','2') in a parameter #condition#
so I want
select * from personnel where id in #condition# to be in #query#.
But when I put a parameter inside a parameter it doesnot read the second parameter #condition# and I get an error saying "missing expression".
How can I handle this?
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Re: Parameter
Are you using the whole query in a Parameter, Can you tell what is your business requirement to have a query in PARAMETER?dsconultant wrote:Hi,
My job uses query in a parameter.
Eg: select * from personnel is #query#
Now I want to put a condition.
select * from personnel where id in ('1','2')
I want to put ('1','2') in a parameter #condition#
so I want
select * from personnel where id in #condition# to be in #query#.
But when I put a parameter inside a parameter it doesnot read the second parameter #condition# and I get an error saying "missing expression".
How can I handle this?
RAJ
Earlier I have suggested some workaround for such scenario.
Hope this will help for you.
viewtopic.php?t=131761&highlight=
Hope this will help for you.
viewtopic.php?t=131761&highlight=
Rgrds,
Abhi
Abhi