문제

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 ?

올바른 솔루션이 없습니다

다른 팁

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"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top