求改一个 sqlserver函数语句 放到mysql数据库里面执行
具体sqlserver语句如下:CREATEFUNCTION[dbo].[funGetUserName](@UserIDint)RETURNSvarchar(500)AS...
具体sqlserver语句如下:
CREATE FUNCTION [dbo].[funGetUserName] (@UserID int )
RETURNS varchar(500) AS
BEGIN
Declare @strReturn varchar(500)
Set @strReturn = ''
Select @strReturn=UserName from dddUser where nID=@UserID
return @strReturn
END
字母修改可以放到mysql 里面可以执行 先谢了 展开
CREATE FUNCTION [dbo].[funGetUserName] (@UserID int )
RETURNS varchar(500) AS
BEGIN
Declare @strReturn varchar(500)
Set @strReturn = ''
Select @strReturn=UserName from dddUser where nID=@UserID
return @strReturn
END
字母修改可以放到mysql 里面可以执行 先谢了 展开
1个回答
展开全部
CREATE FUNCTION myFunction (UserID int)
RETURNS VARCHAR(255)
BEGIN
DECLARE strReturn varchar(255);
Set strReturn = '';
Select UserName into strReturn from dddUser where nID=UserID ;
RETURN(strReturn);
RETURNS VARCHAR(255)
BEGIN
DECLARE strReturn varchar(255);
Set strReturn = '';
Select UserName into strReturn from dddUser where nID=UserID ;
RETURN(strReturn);
追问
不行啊 执行不成功 提示如下: 语法错误
错误代码: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RETURN(strReturn)' at line 1
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询