Subject Re: [IBO] TIB_Import
Author Jason Wharton
> I am using a TIB_Import successfully , however
> I need to do an edit on a field if the key exists rather
> than an Insert.
> Is this possible using the before post or similar ?
>
> One way I thought of was to pick up on the before post event ,
> pass the data to a stored procedure that does a edit / insert
> then skip the post in the TIB_Import.
>
> Anyone have any other advice ?

Make yourself a stored procedure that receives the data fields.
Inside that procedure do an error trap on SQLCODE -803 around your insert.
This is for a duplicate primary key violation.
If this happens then there is a record there already and you can then handle
that exception by performing an update.

Your client application need only pass the data to the server and this way
your server efficiently handles the data however necessary.

Always approach your database development this way when possible...

Jason Wharton