importing and updating data

S

Steve

I am importing and updating data from our server. I have been able to
get it into comma-delimited fields, and then import into a temporary
table with the same structure of our Demog table. My problem is the
next step. Since the data is not necessarily unique, ie, some of the
records to be imported are <updates> to previous information, I have not
been able to get all my information.
In other words, I can import new, unique rows, but if I already have a
index number and a name field with data, I havent figured out how to
update address, phone, etc.
Can somebody point me in the right direction?

Thanks in advance. If another newsgroup is more appropriate for this
question, please advise.

Reply to Newsgroup only, or you might figure out how to invert the real
name of my ISP....
 
T

tina

if you have one or more fields in the main table that constitute a unique
index for each record, and those same fields appear in the temp table, then
you should be able to link existing records in the main table to the
matching records in the temp table. to update the main table's records with
the new info in the temp table, you have to overwrite all fields that *may*
have new data, using an update query. here's an example:

UPDATE tblExistingData INNER JOIN tblTemp ON (tblExistingData.EName =
tblTemp.TName) AND (tblExistingData.EIndex = tblTemp.TIndex) SET
tblExistingData.EAddress = [tblTemp].[TAddress], tblExistingData.EPhone =
[tblTemp].[TPhone];

***test an update query THOROUGHLY on a COPY of your database before using
it on live data*** because once data is overwritten, it's gone. you can't
"undo" it or recover the original data.

hth
 
S

Steve

OK, I'll try that. Thanks
if you have one or more fields in the main table that constitute a unique
index for each record, and those same fields appear in the temp table, then
you should be able to link existing records in the main table to the
matching records in the temp table. to update the main table's records with
the new info in the temp table, you have to overwrite all fields that *may*
have new data, using an update query. here's an example:

UPDATE tblExistingData INNER JOIN tblTemp ON (tblExistingData.EName =
tblTemp.TName) AND (tblExistingData.EIndex = tblTemp.TIndex) SET
tblExistingData.EAddress = [tblTemp].[TAddress], tblExistingData.EPhone =
[tblTemp].[TPhone];

***test an update query THOROUGHLY on a COPY of your database before using
it on live data*** because once data is overwritten, it's gone. you can't
"undo" it or recover the original data.

hth


I am importing and updating data from our server. I have been able to
get it into comma-delimited fields, and then import into a temporary
table with the same structure of our Demog table. My problem is the
next step. Since the data is not necessarily unique, ie, some of the
records to be imported are <updates> to previous information, I have not
been able to get all my information.
In other words, I can import new, unique rows, but if I already have a
index number and a name field with data, I havent figured out how to
update address, phone, etc.
Can somebody point me in the right direction?

Thanks in advance. If another newsgroup is more appropriate for this
question, please advise.

Reply to Newsgroup only, or you might figure out how to invert the real
name of my ISP....
 
S

Steve

OK, that really works!!! Thanks. I still have some tweaking to do, but
this goes a long way.
if you have one or more fields in the main table that constitute a unique
index for each record, and those same fields appear in the temp table, then
you should be able to link existing records in the main table to the
matching records in the temp table. to update the main table's records with
the new info in the temp table, you have to overwrite all fields that *may*
have new data, using an update query. here's an example:

UPDATE tblExistingData INNER JOIN tblTemp ON (tblExistingData.EName =
tblTemp.TName) AND (tblExistingData.EIndex = tblTemp.TIndex) SET
tblExistingData.EAddress = [tblTemp].[TAddress], tblExistingData.EPhone =
[tblTemp].[TPhone];

***test an update query THOROUGHLY on a COPY of your database before using
it on live data*** because once data is overwritten, it's gone. you can't
"undo" it or recover the original data.

hth


I am importing and updating data from our server. I have been able to
get it into comma-delimited fields, and then import into a temporary
table with the same structure of our Demog table. My problem is the
next step. Since the data is not necessarily unique, ie, some of the
records to be imported are <updates> to previous information, I have not
been able to get all my information.
In other words, I can import new, unique rows, but if I already have a
index number and a name field with data, I havent figured out how to
update address, phone, etc.
Can somebody point me in the right direction?

Thanks in advance. If another newsgroup is more appropriate for this
question, please advise.

Reply to Newsgroup only, or you might figure out how to invert the real
name of my ISP....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top