Question

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 ?

No correct solution

OTHER TIPS

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"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top