Sybase Stored Procedure Creation Doubt
Posted on 2012-03-26
I have a general doubt regarding creating stored procedues which can substitue different values say null when 0 or 0.0 is passed as an argument. Right now i know to create a stored procedure which can use the default value only if nothing is passed to the parameter.
create proc myproc
( @myparam1 int = 0,
@myparam2 float ,
@myparam3 char(20) = "mydefault")
.... Here if i pass a 0 to the first parameter which is of an int type and if i pass 0.0 to the second parameter i want to substitute as null. But i dont want to do the same inside the main logic of the stored procedure. How can i achieve the same...