我有这个功能
create function getmobnum(@input bigint)
RETURNS bigint
as
begin
declare @output varchar(10)='';
declare @i int = 1;
while @i <= (len(@input)) begin
declare @unicode varchar(1) = substring(cast(@input as varchar(10)), @i, 1);
if @i>3 and @i<9
begin
set @output=@output+'*';end
else
begin
set @output=@output+@unicode;end
set @i=@i+1;
end
return @output
end;
我在这里叫功能
declare @premob varchar(10)='';
set @premob= dbo.getmobnum(@premo);
但发生此错误
将数据类型varchar转换为bigint时出错。