Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can user-defined functions be called from the application.

Status
Not open for further replies.

manohars

Programmer
Feb 28, 2004
97
US
Is it possible to call a user-defined function from a front end or middle-tier component written in vb.net or c#.net. If so, is it possible get the return value, which is either scalar or a table?

Thanks in advance,
Manohar
 
Make you life easy and your program more efficient...convert it to a stored procedure.
-Karl

[red] Cursors, triggers, user-defined functions and dynamic SQL are an axis of evil![/red]
[green]Life's uncertain...eat dessert first...www.deerfieldbakery.com[/green]
 
No, I just want to know whether we can use it.

Regards,
Manohar
 
Just call it from a stored procedure or select statement the same way it would normally be called. Of course all of your code to the ASP page should be from stored procedures for security and efficiency reasons.

Select myFunction(1,203)

This should give you the result of that function assuming it was a scalar function.

A tabular function would be called

Select field1, field2 from myFunction('test')


Questions about posting. See faq183-874
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top