vikash bhartia
vikash bhartia

Reputation: 65

How can we call user defined function from classic asp

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

Answers (1)

Derek
Derek

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

Related Questions