Subject Re: [firebird-support] Case - When :Parameter
Author Helen Borrie
At 11:50 AM 31/05/2004 -0300, you wrote:
>Hi all,
>
>CanĀ“t I just use a parameter in a When as the code below?

You could; but a parameter isn't a variable. You have three parameters
here, not one, so you need a different name for each.


>Update TempPrce100Itens
>
>Set PercDesconto = :PercDesconto,
> ValorUnitario = Case
> When ValorUnitario > 0
> then ValorBruto - ((ValorBruto * :PercDesconto) /
>100)
> Else 0
> End,
> ValorTotal = QuantAtendida *
> Case
> When ValorUnitario > 0
> then ValorBruto - ((ValorBruto * :PercDesconto) / 100)
> else 0
> End
>Where Empresa = :Empresa
> and CodPedido = :CodPedido
> and Status <> 'E'

It would be much more elegant to do this update in a SP. Then you *can*
use your single input parameter as a variable.

/heLen