Subject Re: [IBO] More TIB_DataPump questions
Author Lester Caine
mspencewasunavailable wrote:

> This query is constant. Although I don't prepare it and reuse it,
> and making a new SQL string each time is not really a big deal, I
> could see that it might be in other situations. The results of the
> query go to a temporary table for additional processing, so I wanted
> to add a unique, per-instance number in a new column when I pumped
> the data into the table. It seemed to me to be a more elegant
> solution to introduce the session ID at that point, since it's just
> there to emulate a temp. table.
>
> If there's no other way, then I'll just produce a new SQL string for
> the query each time, incorporating the session ID, but surely this
> is what the DataPump's events are for? Would making a custom DPItem
> class be another way to do this?

Then just create a generator and use that in the select

select
fielda,
fieldb,
fieldc,
( SELECT GEN_ID(SESID,1) FROM RDB$DATABASE ) as mysessionid
from blah
where.....

Just set the generator to your start value.

--
Lester Caine - G8HFL
-----------------------------
L.S.Caine Electronic Services - http://home.lsces.co.uk
Model Engineers Digital Workshop -
http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/
Treasurer - Firebird Foundation Inc. - http://www.firebirdsql.org/index.php