load and unload and update
Posted in 1994
In message <784550352snz@arcfan.demon.co.uk>
Alex@arcfan.demon.co.uk (Alex McLintock) wrote:
> A few days ago I posted a question about the format of UNLOAD.
>
> I am generating csv files from my MS Windows app to upload to the Informix
> database (on Unix). I can dbload them if they are brand new records -
> but if they are updated versions of existing records then dbload
> refuses to update them - since it tells me there would be duplicate records
> and unique keyed indexes. Can I use some kind of sql LOAD statement to load
> and/or update records? or can I use dbload to update existing
> records - as well as load new ones?
>
> [help wanted deleted...]
> --
> Alex McLintock [also alexmc@biccdc.co.uk]
> Editor for the Project Galactic Guide (alt.galactic-guide) Number 6
dbload is a very rough method for just slamming in data that's supposed to
be absolutely good. That means putting data that you just unloaded back
into tables. Any time you want to do things like error checking, verifying,
updating, writing record-oriented log files of what went on, and such you
need to use a program.
We are dbloading huge amounts of new data that comes from a process
controller (that is supposed to be "clean") and finding more and more that
we should have used a program with some smarts to keep up with the data.
To answer your questions:
Yes, you can use some kind of SQL statement. There is an UPDATE keyword
described on page 7-311 of the Informix SQL Reference Guide, September 1992.
Also there's a LOAD FROM statement, described on page 7-191 which will only
add (not update) records. I have written an application which (in 4GL)
always tries to delete everything it adds. It works because all "update"
records are complete new records (not just changes.) Maybe you could use
something like that. My general policy is to use a program, not dbload.
Good luck,
__________________________________________________________________
| Clem Akins Standard Disclaimers Apply |
| Reynolds Metals Co. "Climb High, Cave Deep!" |
| Muscle Shoals, Alabama USA cwakins@leia.alloys.rmc.com |
|________________________________________________________________|
BTW, I got a O/S upgrade yesterday! Maybe now my mail will work as it should.