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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -