Importing flat file into relational files - Help?

Importing flat file into relational files - Help?

Post by David Schen » Wed, 24 Jul 2002 01:46:39



Hello Everybody!

Here is my problem - I have a solution with 5 files - all linked
together by an autonumber serial number generated by the main file.
Now I want to import reports we get from another agency which come in
a flat text file.  I know I can just use a script to import the
relevant fields into each file, but the question is - how do I get
them to all relate?  If I run a script to import the fields into the
main file - at that point the serial numbers are assigned, how will I
get them moved over into the other files as I import the rest of the
fields?  Should I create a separate relationship based on some
calculation that creates a (hopefully) unique key that I can then go
back and do a looping copy replace?  That sounds pretty cumbersome.
Anyone have any good ideas?  Thanks.

David

 
 
 

Importing flat file into relational files - Help?

Post by STL » Wed, 24 Jul 2002 16:43:01


I suggest you never use Auto-Enter-Serial field as primary key!
But now, what to do?
1-Add a new numeric field to your solution which will be the primary key.
2-Use Substitute in oder to populate this field with the value of the
Auto-Enter-Serial field
3-Change the relationship from AES to this new field.

What to do with extra files from agencies?
1-Leave all the way they do but change the start number of their AES
   field.
   For example: <Agency A> : AES starts from   10.000
                <Agency B> : AES starts from   20.000
                <Agency Z> : AES starts from   xx.xxx
   the start number depends by how many main records they creates in
   the business time you are referring to.
2-When importing from Agency files put their mainfile's AES into your
   new primary key field.
3-That's all!

Hoping this is what you was looking for...

/Steve


> Hello Everybody!

> Here is my problem - I have a solution with 5 files - all linked
> together by an autonumber serial number generated by the main file.
> Now I want to import reports we get from another agency which come in
> a flat text file.  I know I can just use a script to import the
> relevant fields into each file, but the question is - how do I get
> them to all relate?  If I run a script to import the fields into the
> main file - at that point the serial numbers are assigned, how will I
> get them moved over into the other files as I import the rest of the
> fields?  Should I create a separate relationship based on some
> calculation that creates a (hopefully) unique key that I can then go
> back and do a looping copy replace?  That sounds pretty cumbersome.
> Anyone have any good ideas?  Thanks.

> David


 
 
 

1. Importing a flat file database in a relational one

Hi there,
I would like to import the data I had in an old flat-file database. I have
created the tables to remodel it as a relational database, now I would like
to recover the old data.
The import expert would like to write all the data in a single table, while
I would like to distribute the data properly among tables.

Is there any way to do this?

best regards
Franz
--

c/o SISSA                                  http://www.sissa.it/~ditolla
Via Beirut 2-4                             tel: +39 0403787448
34014 Grignano (TS) - Italy                fax: +39 0403787528

2. Is Code Basic Version 1.10 compatible with Visual Basic Version 3 ???

3. Importing from flat text files to relational DB

4. ISM don't start

5. Help converting Flat file DB to Relational

6. Next Record Script in a Mulit-User environment

7. Accessing Flat files through DTS Flat File OLE DB Provider

8. MD-Landover-242623--Windows NT-UNIX-Firewalls-ORACLE-SQL-Web Architect/Sales Engineer

9. Importing Flat Fixed Len File to SQL7----HELP

10. Importing from multiple flat files - HELP!!!

11. Help: importing flat data into relational structure

12. Help With File Size Limitations - Large Flat Files