sybase - BEGIN..END not working in Nested IF..ELSE -
i confused begin.. end in nested if..else condition. example, when trying execute below mentioned query. returning error -- "incorrect syntax near else.."
if ( isnull(@tin,'')=''and isnull(@prpr_ntwrk,'')<>'' ) begin if (isnull(@prpr_ntwrk,'')='p') begin -- code end else begin -- code end end
please suggest.
the code below executes on ase 15.7.0
declare @tin varchar, @prpr_ntwrk varchar if ( isnull(@tin,'')=''and isnull(@prpr_ntwrk,'')<>'' ) begin if (isnull(@prpr_ntwrk,'')='p') begin select "p" end else begin select "not p" end end
note ase gets confused empty stubs "-- code" in original example.
your first if statement may not want, sticking question asked.
Comments
Post a Comment