dbTalk Databases Forums  

Omit Null Fields During Import

comp.databases.filemaker comp.databases.filemaker


Discuss Omit Null Fields During Import in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Al
 
Posts: n/a

Default Omit Null Fields During Import - 10-09-2005 , 10:34 AM






I import updated info from an external database file on a weekly basis into
a FM Pro 5.5 file. The data arrives in csv format and contains all fields
available (approx. 50)... However, the file only includes data that has been
updated since the last export... Therefore, many of the fields show blank...
Only those fields with updated data have info in them...

Need to import (already have a key ID field) and replace only those fields
that have values in them... Otherwise, the "blank" fields will overwrite the
data in the FM Pro database!...

Thanks,
Al



Reply With Quote
  #2  
Old   
Remi-Noel Menegaux
 
Posts: n/a

Default Re: Omit Null Fields During Import - 10-09-2005 , 11:41 AM






When importing, in the window 'ImportField Mapping' you have several
options on the bottom left. One is 'Update matching records in the found
set'.
But if all fields are selected with an arrow in that window, you will
indeed - I think - replace the actually data with blank when your import
field will be blank.
So I think we should imagine something more complex.
Suppose you make a full copy of your base DB1 and you name it DB2.
Then you import your data from the import file into your DB2 using the
option 'Update matching records in the found set'.
Then you create in DB1 a relationship with DB2 based on your KeyID.
In DB1 you make a copy of all the 50 fields definitions, say FieldX
copied into FieldX2.
Now you create a script that will loop into all records, and for each of
the 50 FieldX, you write the 2 following script lines :
SetField (FieldX2, FieldX)
SetField (FieldX, Case( Isempty(RelationshipDB2::FieldX), FieldX2,
RelationshipDB2::FieldX))
And let it go.
It should work - probably with some adjustments ... -.
Good luck.
Remi-Noel


"Al" <catmando49 (AT) adelphia (DOT) net> a écrit :
Quote:
I import updated info from an external database file on a weekly basis
into a FM Pro 5.5 file. The data arrives in csv format and contains all
fields available (approx. 50)... However, the file only includes data
that has been updated since the last export... Therefore, many of the
fields show blank... Only those fields with updated data have info in
them...

Need to import (already have a key ID field) and replace only those
fields that have values in them... Otherwise, the "blank" fields will
overwrite the data in the FM Pro database!...

Thanks,
Al




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.