
14/07/2005, 14:14
|
 | | | Fecha de Ingreso: enero-2005 Ubicación: Santiago, Chile
Mensajes: 215
Antigüedad: 20 años, 1 mes Puntos: 0 | |
if dentro de un case holas... me gustaria saber si se puede inkluir un if dentro de un case en sql, porke tengo el siguiente kodigo de un procedimiento y me da error de sintaxis..
Código:
case descrip_form.tipo
when 't' then
convert(nvarchar(4000),isnull(valor_hist.v_t,'--'))
when 's' then
convert(nvarchar(800),isnull(valor_hist.v_t,'--'))
when 'c' then
if exists(select cod_ubic from valor_hist where cod_ubic = @cod_ubic and cod_campo = '4263')
begin
set @var='s'
select @var as mercado
end
else
begin
set @var='n'
select @var as mercado
end
when 'm' then
convert(nvarchar(4000),isnull(valor_hist.v_m,'--'))
when 'n' then
convert(nvarchar(200),convert(int,isnull(valor_hist.v_n,'0')))
when 'f' then
convert(nvarchar(10),isnull(valor_hist.v_f,null) ,103)
when 'e' then
'Titulo'
else '--'
end
as valor
porfis ayuyaaaaa
__________________ y nada más
porke el cielo ya está de nuevo torvo y sin estrellas kon helikópteros y SIN DIOS.... |