import/export data to/from Firebird

Closed Posted Dec 4, 2008 Paid on delivery
Closed Paid on delivery

while a great deal of code (both free and open source) is avaiable in internet, I need my own code for importing/exporting data from/to a firebird database. The code must be in Delphi 5. IBObjects components should be used in order to access the database. Two external files should be created/read: 1 text file (with extension TXT) and 1 binary file (with extension MEM) The binary file is needed for BLOB/MEMO field. The text file is needed in order to quickly apply needed changes by means of a word-processor. The text file will be structured as follows: [TB_YEA] // table name Field1=ID_YEA,INT64,18,0,0 // field description: name, type, length, decimals, offset Field2=ID_PER,INT64,18,0,18 Field3=ID_MON,INT64,18,0,36 Field4=QTY,INT64,19,3,54 Field5=ID_REP,INT64,18,0,73 Field6=AYEAR,LONGINT,9,0,91 78000000644,78000000616,78000000591,79,78000000001,0 // data, in delimited format 6000003868,6000002550,6000002501,20205,6000000001,2006 20000192761,20000100545,20000069659,120,20000054616,2008 6000010844,6000002549,6000002501,0,6000000001,2008 When a memo or a blob field is found, the structure could be [TB_YEA] // table name Field1=ID_YEA,INT64,18,0,0 // field description: name, type, length, decimals, offset Field2=ID_PER,INT64,18,0,18 Field3=ID_MON,INT64,18,0,36 Field4=QTY,INT64,19,3,54 Field5=ID_REP,INT64,18,0,73 Field6=AYEAR,LONGINT,9,0,91 Field7=MYBLOB,BLOB 78000000644,78000000616,78000000591,79,78000000001,0,5728826 the last number means the offset of the MEM file where blob data is written. When reading the MEM section, the first 4 bytes represent the data lenght to read/write. Please note that - due to large volume of data to read/write and to intrinsic limitations of the TStringList component - you won't be able to use a TStringlist to read/write the TXT file. The use of a TMemoryStream for both files (TXT and MEM) is mandatory. The following 2 points are also important: 1. most tables have field ID_REP. I want to be able to say: 'read/write only records that have ID_REP='. In this case, tables that have no field ID_REP won't be read/written 2. at import time, I want to decide if destination tables should be emptied before reading. Some code is attached, mostly for your inspiration.

## Deliverables

please note that when importing data, the order by which tables are read is very important: tables with less dependencies should be read first. If you want, I will provide some hint re how to do it. For export, I did a few changes to component TIB_EXport of IBObjects. I can provide what I did or you can roll out your code.

Delphi Engineering Microsoft MySQL PHP Project Management Software Architecture Software Testing Windows Desktop

Project ID: #3446698

About the project

Remote project Active Dec 26, 2008