Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying a record from one DB to another DB 1

Status
Not open for further replies.

BorlandDave

Programmer
Jun 13, 2005
86
GB
My program accesses two interbase databases with identical structures. I need to copy a selected record from a table in DB1 to the corresponding table in DB2.

Is there a quick way to do this with TIBQuery? Or do I really have to write each field in DB2 manually from the query on DB1?
 
I don't use Interbase myself, but from experience with other databases, it can be done if both databases are located on the same database server (and therefore accessible from the same connection). For example (in MySQL):
[tt]
INSERT db2.tbl1
SELECT * FROM db1.tbl1
WHERE id=123
[/tt]
If the databases are located on different servers, then it can't be done directly.
 
Thanks for the help, but I've decided to copy the data field-by-field to ensure data integrity.

It's the long way round, but the right way I think :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top