Subject Re: [firebird-support] Need some direction on combining values into one
Author Jim Gardner
Thank you for your help.

Yes there are additional fields and the table is basically a temp data to
hold the data before we export it.

I was thinking that a stored procedure may be the best solution as well :)

Thank you again for your suggestions and your time.

Jim

On Wed, Feb 20, 2013 at 6:16 AM, Andr� Knappstein <
Knappstein@...> wrote:

> **
>
>
>
> > I have a table (see below) where I want to combine the two totals
> > below into the 0304KZ6 total so that I can end up with something like
> the second example.
>
> > current 0304KZ6 6786.11
> > 0304KZ6RR 3750.41
>
> > desired 0304KZ6 10536.52
> > 0304KZ6RR 0.00
>
> Am I correctly assuming that these 2 fields are only an example, and
> you probable have more of such constructions?
>
> Then I'd first try to change the database layout. The above structure
> does not seem to be optimal if you need such results more often.
>
> Then, if you can't change the database, you can try a client approach
> (calculate the total of the 2 fields by a routine in your client
> application) if you can provide for proper isolation (not having one
> field updated while another is read).
>
> If all of this does not work, consider "execute statement" in PSQL
> within a StoredProcedure. It helps me quite well in a similar
> situation, even though the experts seem to be quite reluctant about
> "execute statement".
>
>
>



--
[image: qrcode.5674456.png]


[Non-text portions of this message have been removed]