Subject Re: [IBO] Ib_import for relational tables?
Author Helen Borrie
At 07:34 PM 9/02/2005 +0000, you wrote:


>Hi
>
>My app has to import a CSV file that contains data from several
>tables of a relational db. At the moment i use components that allow
>me to do this by setting mappings such as:
>fname=Field1
>sname=field2
>balance=field3
>creditLimit=field4
>
>where fields 1 and 2 correspond to one table in the db and fields 3
>and 4 correspond to a different table.
>
>Can Ib_import be used in the same way? From the import.pas file it
>seems to suggest a simple list of fields like:
>Fname
>Sname
>
>Any ideas?

I suggest importing the CSV file into a table that defines all fields with
all char() and varchar() fields of suitable length. Write an executable
SP, with all of these char fields as input, that loops through and sorts
out which fields are to go to each destination. Do any casting and
substringing required right inside the procedure and use custom exceptions
to catch bad data and write a log.

Helen