如何在Sybase中查找传入参数是否为非空且不为空 [英] how to find if incomming parameter in not null and not empty in Sybase

查看:33
本文介绍了如何在Sybase中查找传入参数是否为非空且不为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 sybase ASE 中写一些这样的东西

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

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

    exec(@strexecsql)

    }
    else
    {

    exec(@strexecsql1)

    }

对于传入的@parameter 检查此条件 IsNULLorEmpty 的最佳方法是什么?

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

推荐答案

最好是 ISNULL,即:

The best would be ISNULL, i.e.:

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

这篇关于如何在Sybase中查找传入参数是否为非空且不为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆