Subject | Re: [IBO] update from one database to another |
---|---|
Author | Svein Erling Tysvær |
Post date | 2001-09-27T08:46:40Z |
Hi Dave!
This should be simple.
your destination table (use a tiCommitted transaction without AutoCommit for it), assign an update statement to it (UPDATE <table> SET <field> = <value>
WHERE <pk> = <value>), prepare this DSQL, loop through all records in source assigning the values to the parameters to your DSQL and call Execute (or
ExecSQL). When your finished with all your records (or maybe for every x records if you're updating very many records) call Commit for your transaction(s).
HTH,
Set
This should be simple.
>I have tried to open a query on the source table (to get a dataset ofYour start is good, albeit if done without user interaction a TIB_Cursor would be preferrable to a TIB_Query. But then you mess things up. Use a TIB_DSQL for
>only the update-needing records). Then going down these records to
>eof, at each source record have opened a cursor on destination
>table , set it in edit mode, copied the fields across one-by-one,
>then posted the dest table record.
your destination table (use a tiCommitted transaction without AutoCommit for it), assign an update statement to it (UPDATE <table> SET <field> = <value>
WHERE <pk> = <value>), prepare this DSQL, loop through all records in source assigning the values to the parameters to your DSQL and call Execute (or
ExecSQL). When your finished with all your records (or maybe for every x records if you're updating very many records) call Commit for your transaction(s).
HTH,
Set