sql query
how to pass dynamic values in sql query activity in runtime lets suppose in the following query Select * From DB.TABLE where condition , i want to pass dynamic condition which i want to pass either through dropdown or through textbox, please help
0
-
Hi Raghav,
First you need to define the list of parameters in “Parameters” section something like:
Name: p_my_id
Direction: In
Type: Int32 (obviously this depends on your scenario)
Value: var_name (this is a workflow variable)
Second, define your command. Something like:
Select * From DB.TABLE where id = :p_my_id
You’ll need to pay particular attention that Parameter name is exactly the same in Parameter and command sections. Add : before the parameter name in command section.
I hope this helps0 -
Hi Francesca
I did samething but it is not working whereas it is working if I hardcode the SQL Query .Here I am attaching the screenshots for the reference:
_img_ alt="argument declaration" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=907f2000000k9fA&feoid=Body&refid=0EMf2000000fxYi" _/_img_
above image is for doing sql query using argument
_img_ alt="ParamaterDeclaration" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=907f2000000k9fA&feoid=Body&refid=0EMf2000000fxYn" _/_img_
above image is for ParamaterDeclaration in SQL Query Acttivity
_img_ alt="error caught in exception" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=907f2000000k9fA&feoid=Body&refid=0EMf2000000fxYx" _/_img_
above image is of error caught in exception
_img_ alt="hardcoded query" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=907f2000000k9fA&feoid=Body&refid=0EMf2000000fxZ2" _/_img_
above image is of hardcoded query
_img_ alt="result for hardcoded" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=907f2000000k9fA&feoid=Body&refid=0EMf2000000fxZ7" _/_img_
above image is of result for hardcoded query.
I am not getting what wrong i am doing.0 -
Finally It is working : wont work in my case @ works 0
Please sign in to leave a comment.
Comments
3 comments