I don't know what custom tag you're using ... is it encrypted?  If not
modify it ... if it is, write to me off line and I'll send you my own code
(which may or may not be as good, but it works for me and you can modify how
you please)

What you could do is ingest your CSV, then loop over your PartNum list doing
a select query in the loop, and if you find a match, run an update query; if
not run an insert query:

loop over csv.value
        select *
        from table
        where partNum = #csv.value#

        if select.query = loop.index
                run update query
        else
                run insert query
end loop

As for updating only new values ... are your CSVs always different as far as
what fields/columns are available?  There's different ways to handle this
based on what you're expecting from your CSVs.

H.






> -----Original Message-----
> From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, January 14, 2003 4:45 PM
> To:   CF-Talk
> Subject:      CSV updater???
> 
> I've got a site where I am using a CSVtoDatabase custom tag to add new 
> records, but it doesn't allow for an update feature  - are there any
> custom 
> tags out there that do this (replace a record based on a specific field,
> or 
> more ideally, only replace the  specific contents of a few fields in that 
> record based on the fieldnames in the CSV?
> 
> For example, if the table has 20 fields, but the UPDATE.csv only has a 
> PartNumber field (the relationship field), DiscPrice, and Sku then the 
> process would loop through the csv and update those fields in those
> records...
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to