问题
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