Reputation: 65
I have a query like this
select distinct mydb.getprodsizecolor(idProduct,'%color%') as icolor from products
I am calling this from my asp page and its working fine,
I have to store '%color' in a variable like
desc = '%color%'
But when i execute query like this, it errors out
select distinct mydb.getprodsizecolor(idProduct,desc) as icolor from products
can any one help ?
Upvotes: 0
Views: 119
Reputation: 480
Your query should be in a string format
query = "select distinct mydb.getprodsizecolor(idProduct,'%color%') as icolor from products"
So when you are assigning the value in a variable you can try it this way
desc = "'%color%'"
query = "select distinct mydb.getprodsizecolor(idProduct,"&desc&") as icolor from products"
Upvotes: 1