Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Stored procedures 关键字“convert”附近的语法不正确_Stored Procedures_Sybase - Fatal编程技术网

Stored procedures 关键字“convert”附近的语法不正确

Stored procedures 关键字“convert”附近的语法不正确,stored-procedures,sybase,Stored Procedures,Sybase,我有程序 create procedure dbo.updateView(@cobdate datetime) as begin Update hir_view set ValidTo=@cobdate where HierarchyId in ( select distinct HierarchyId from hir_organisation where ValidTo<getDate() and HierarchyId not in ( sele

我有程序

create procedure dbo.updateView(@cobdate datetime)
as
begin
    Update hir_view set ValidTo=@cobdate where  HierarchyId in (
      select distinct HierarchyId from hir_organisation where ValidTo<getDate() and HierarchyId not in (
        select HierarchyId from hir_organisation where ValidTo>getDate()
      ) 
    ) and ValidTo>getDate()

end
go
我得到了错误声明 查找错误-Msg 156,级别15,状态34,服务器DSLNPHX02,第18行-Sybase数据库错误:关键字“convert”附近的语法不正确


我不确定哪里出错了

语法正确,您是否尝试过像这样运行update命令

convert(dateTime,'20160209') 

 Update hir_view set ValidTo=convert(dateTime,'20160209')  where  HierarchyId in (
      select distinct HierarchyId from hir_organisation where ValidTo<getDate() and HierarchyId not in (
        select HierarchyId from hir_organisation where ValidTo>getDate()
      ) 
    ) and ValidTo>getDate()
convert(dateTime,'20160209') 

 Update hir_view set ValidTo=convert(dateTime,'20160209')  where  HierarchyId in (
      select distinct HierarchyId from hir_organisation where ValidTo<getDate() and HierarchyId not in (
        select HierarchyId from hir_organisation where ValidTo>getDate()
      ) 
    ) and ValidTo>getDate()