we'd really need the exact error you are getting...and also the exact code you are doing to really help. All i can offere is generalities.
where is param1 and param2? are they fields, or locally declared variables inside the proc?
CREATE PROC myProc AS
BEGIN
declare @Param1 int
Declare @Param2 int
'assign values to variables inside the proc?
select @Param1 = object_id,@Param2 = colid from sys.columns where object_name(object_id)= 'myTable'
declare @selVal as integer
set @selVal = select dbogetCalcvalue(@Param1,@Param2)
--do more stuff
END
Lowell