how to find if incomming parameter in not null and not empty in Sybase

谁说胖子不能爱 提交于 2019-12-12 01:53:40

问题


I am trying to write some thing like this in sybase ASE

@searchstring varchar(500)
    If(IsNULLorEmpty(@searchstring))
    {

    exec(@strexecsql)

    }
    else
    {

    exec(@strexecsql1)

    }

what is best way to check this condition IsNULLorEmpty for a incoming @parameter?


回答1:


The best would be ISNULL, i.e.:

DECLARE @searchstring varchar(500)
...
IF(ISNULL(@searchstring,'') = '')
    EXEC(@strexecsql)
ELSE
    EXEC(@strexecsql1)


来源:https://stackoverflow.com/questions/29077854/how-to-find-if-incomming-parameter-in-not-null-and-not-empty-in-sybase

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!