Subject | Re: [IBO] TIB_Import |
---|---|
Author | peter@cyionics.com |
Post date | 2003-11-15T07:53:38Z |
Thanks Paul
Yes that's basically what I meant, I decided in the end to call a stored procedure to delete the record with the key passed on the before post event, then let the TIB_Import component always do an Insert.
What I realised looking further was that an update wasn't really needed with this component because if a record is changed then because it is an import from an external csv file , all fields should change.
It will of course be slow, but the theory is that after the initial import only 1-2 new records at a time will be imported per session.
Thanks for your input.
Rgds
Peter
Yes that's basically what I meant, I decided in the end to call a stored procedure to delete the record with the key passed on the before post event, then let the TIB_Import component always do an Insert.
What I realised looking further was that an update wasn't really needed with this component because if a record is changed then because it is an import from an external csv file , all fields should change.
It will of course be slow, but the theory is that after the initial import only 1-2 new records at a time will be imported per session.
Thanks for your input.
Rgds
Peter
----- Original Message -----
From: Paul Vinkenoog
To: IBObjects@yahoogroups.com
Sent: Friday, November 14, 2003 11:00 PM
Subject: Re: [IBO] TIB_Import
Hi Peter,
> 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.
I suppose you mean the TIB_Import.OnPrePost event? I use that all
the time: I check the unique fields of the record to be inserted;
if they don't exist yet, I leave OKToPost true. If they exist
already, I set OKToPost false and - depending on the situation
and sometimes on user-provided parameters - either do nothing
(so the record is skipped) or I update the existing record using
a parameterized TIB_DSQL.
Your idea of using an SP might be quicker though! It may seem silly
to use a TIB_Import only to refuse every single record it wants to
insert but hey, if it works... why not?
Greetings,
Paul Vinkenoog
Yahoo! Groups Sponsor
ADVERTISEMENT
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]