当前位置: 代码迷 >> Sql Server >> 求帮忙改下sql语句能在sqlserver2008跑起来的解决思路
  详细解决方案

求帮忙改下sql语句能在sqlserver2008跑起来的解决思路

热度:29   发布时间:2016-04-27 13:43:37.0
求帮忙改下sql语句能在sqlserver2008跑起来的
FUNCTION NENDO_MM_NO(pSYO_M IN CHAR) RETURN NUMBER
IS
  mySEQ NUMBER(2);
BEGIN
  --月テーブルから該当するインデックスをサーチ
  for i in 1..12 loop
  if MM(i) = pSYO_M then
  mySEQ := i;
  exit;
  end if;
  end loop;

  return mySEQ;

END;

------解决方案--------------------
收到你的信息,但是我对JAVA也不怎么了解。
------解决方案--------------------
你函数中貌似又调用了一个函数,我不知道你MM那个函数体的具体内容,只能照搬引用.

SQL code
create FUNCTION dbo.NENDO_MM_NO(@pSYO_M as varchar(10)) RETURN intBEGIN  declare @mySEQ as int  declare @i as int  set @i = 1  while @i <= 12  begin    set @mySEQ = @i    if dbo.MM(@i) = @pSYO_M then       begin         break       end    set @i = @i + 1  end  return @mySEQEND
  相关解决方案