I have a proc where I need to condition my "where" clause:
create procedure get_eqmdet
(in @jobnumber char(12)
@costcode char(8),
@suffix char(2),
select ........
where glmcu = @jobnumber and
glsub = @costcode and
case
when @suffix = ' ' then glalty in (' ', 'HR')
when @suffix <> ' ' then glalty = @suffix
end and ......
I am passing in @Suffix as a parm. I am getting error:
Keyword IN not expected. Valid tokens: END.
create procedure get_eqmdet
(in @jobnumber char(12)
@costcode char(8),
@suffix char(2),
select ........
where glmcu = @jobnumber and
glsub = @costcode and
case
when @suffix = ' ' then glalty in (' ', 'HR')
when @suffix <> ' ' then glalty = @suffix
end and ......
I am passing in @Suffix as a parm. I am getting error:
Keyword IN not expected. Valid tokens: END.