Subject Re: [IBO] More TIB_DataPump questions
Author mspencewasunavailable
--- In IBObjects@yahoogroups.com, Lester Caine <lester@...> wrote:
>
> 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.
>

That'd be ideal if this was the only place I needed a unique session
ID, but there are a dozen or so of these tables involved (still
walking them up in the code, actually) and they need to have the
*same* session ID for a given instance of the application. I do
have a generator and a companion SP which allows the app to obtain
this ID when it starts up.

And I really want to know more about TDataPump. I've spent lots of
time over the years doing bulk imports and conversions and would've
been very grateful for such a control.