Subject Re: [IBO] "FieldType" or alike in IBO?
Author Lutz Kutscher
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:

> Use ReadCommitted isolation for your transaction.
> Use a SELECT statement and an ib_cursor to fetch your single row
from the
> source database;

OK, that's the way I do it already.

> use a TIB_DSQL for the DML statement(s) to the
> destination database - all of this invisible to the user.

I had thought of that, but then I would have to execute an additional
check first: if record exists in destination DB, create an update
statement else create an insert statement.
In Sybase/MS-SQL this could be in a single statment
if exists() update [...] else insert [...]
statement, but I believe Firebird doesn't support this syntax, so i
used this (weird) statement to check whether a record exists:

select case when exists(select 1 from <Table> where <PKWhere>) then 1
else 0 end from rdb$database

> Neither of these statements is linked to any visual controls.

The application contains no visual controls. It reacts to events
triggered by the source database. The data copied to the destination
database is read by a different application. Only after the transfer
is committed the data should become visible to the user.

> Have you considered using a TIB_Datapump for this job? It just
takes care of everything.

Does IB_Datapump support the decisions
if not record exisits at source: delete at destination
else if exists at destination: update at destination
else insert at destination?

Thanks,
Lutz

BTW: Your Firebird Book is absolutely great, do you know if something
of that quality exists for IBObjects?