我在SQL里写了个函数,如下:
CREATE FUNCTION f_tree_bom2(@MAT_CODE char(20))
RETURNS @t_Level table(
father_matcode char(20),
child_MATCODE CHAR(20),
LI_LEVEL INT,
Sort varchar(7600)
)
as
begin
.......(过程代码)
return
end
在PB7里定义Stored Procedure数据源为上面的函数,结果出现以下错误:
Cannot create DateWindow
'第1行:过程号(0)无效。必须介于1到32767之间。
1 execute dbo.f_tree_bom2:0 father_matcode = :father_matcode,child_Matcode = :child_matcode,LI_LEVEL = :LI_LEVEL,Sort = :Sort '
这到底是什么问题??谢谢!!!
------解决方案--------------------
别用Stored Procedure,直接在SQL中写就可以了,
并且存储过程才用你这样的使用方法: execute 存储过程名
函数的调用可以用这样的方法: select 函数名(参数1,参数2)