You can use UFD in SQL sintax but this not work poperly
all time
example
Select id_customer,suma(id_customer) from tbl_customers
procedure suma
lparameter id_cust
select sum(amount) as sumas from
tbl_sales where id_customer=id_cust
into cursor totals
return totals.sumas
sorry for my english!!
Fernando España
SQL Server Specialist