471,079 Members | 949 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,079 software developers and data experts.

call user defined sql function via classic asp

120 100+
hi guys

I have a user defined sql function in my sql server db called TenPercentDiscount but not sure how to call it via classic asp?

iv tried both
objRS(TenPercentDiscount("Double_Redleaf_Price"))
TenPercentDiscount(objRS("Double_Redleaf_Price"))

but not having any joy? Double_Redleaf_Price is an integer value and my function code is
Expand|Select|Wrap|Line Numbers
  1. CREATE FUNCTION TenPercentDiscount 
  2. (@InputVals int)
  3. RETURNS int
  4. AS
  5. BEGIN
  6. declare @convertedVal varchar(30)
  7. set @convertedVal =  Cast(@InputVals  * 0.9 as int)
  8. return  @convertedVal 
  9. end
please adivse
omar
Nov 11 '10 #1

✓ answered by jhardman

You can't call it from the asp, you need to use it IN your sql query.
Expand|Select|Wrap|Line Numbers
  1. select tenpercentdiscount(redleafprice) as newprice from mytable 
Jared

2 6071
jhardman
3,406 Expert 2GB
You can't call it from the asp, you need to use it IN your sql query.
Expand|Select|Wrap|Line Numbers
  1. select tenpercentdiscount(redleafprice) as newprice from mytable 
Jared
Nov 11 '10 #2
omar999
120 100+
hi Jared - thanks for clarifying.

I shall post this question in the sql section then..

thanks again
Omar.
Nov 11 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Highlander416 | last post: by
1 post views Thread by David Carwile | last post: by
1 post views Thread by Mphoza | last post: by
3 posts views Thread by chreo | last post: by
2 posts views Thread by Lalit Bhatia | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.