Subject Re: [firebird-support] Update a Highwater Value in a single Statement
Author Alexandre Benson Smith
robert_difalco wrote:

>This is a simple question that has me stumped. I know I can do this in
>a single statement:
>
> UPDATE Stat SET Stat.count = State.count + 1
> WHERE Stat.id = 10;
>
>
>But how do I do this:
>
> UPDATE Stat SET
> Stat.count = State.count + 1,
> Stat.maxValue = NUMERIC_MAX( Stat.maxValue, 200 )
> WHERE Stat.id = 10;
>
>I know there is no NUMERIC_MAX function in FB 1.0.3, so I am only
>using it as an example. Think of it as a C max() function or java
>Math.max() method.
>
>Sorry for asking such a simple question, couldn't find anything
>googling around and searching in these forums; well I only have
>patience if search results are found in the first few thousand messages.
>
>TIA,
>
>R.
>
>
In FB 1.5 you could use a case.

In FB 1.0.3 you will need an UDF

look for MaxNum functoin at rFunc UDF Library at
http://rfunc.sourceforge.net/

see you !

--

Alexandre Benson Smith
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.322 / Virus Database: 267.2.0 - Release Date: 27/05/2005