Insert/Update from file
Posted in 2001
Topics: Migration, Import/Export & Data Conversion
Could anyone tell me if the following is possible in INFORMIX:
1. Use UNLOAD to create an input file (fields separated by "|")
2. Try to insert these records into a table (same specs as the one in
step two but in a different database).
3. If the insert fails because it is a duplicate perform an update
instead
Can this be done in a command file? What would I use LOAD, dbload???
Thanks for any help!
Sent via Deja.com
http://www.deja.com/
Get Jonathan Leffler's sqlcmd package it comes with a utility sqlupload
which was designed by Jonathan and a committee from this list to solve just
that problem.
Art S. Kagel
aztecs@my-deja.com wrote:
>
> Could anyone tell me if the following is possible in INFORMIX:
>
> 1. Use UNLOAD to create an input file (fields separated by "|")
> 2. Try to insert these records into a table (same specs as the one in
> step two but in a different database).
> 3. If the insert fails because it is a duplicate perform an update
> instead
>
> Can this be done in a command file? What would I use LOAD, dbload???
>
> Thanks for any help!
>
> Sent via Deja.com
> http://www.deja.com/
Thanks!
I new to this newsgroup. Where do I get this sqlcmd package?
Thanks again
In article <3A81DF26.59045671@bloomberg.net>,
kagel@bloomberg.net wrote:
> Get Jonathan Leffler's sqlcmd package it comes with a utility
sqlupload
> which was designed by Jonathan and a committee from this list to solve
just
> that problem.
>
> Art S. Kagel
>
> aztecs@my-deja.com wrote:
> >
> > Could anyone tell me if the following is possible in INFORMIX:
> >
> > 1. Use UNLOAD to create an input file (fields separated by "|")
> > 2. Try to insert these records into a table (same specs as the one
in
> > step two but in a different database).
> > 3. If the insert fails because it is a duplicate perform an update
> > instead
> >
> > Can this be done in a command file? What would I use LOAD,
dbload???
> >
> > Thanks for any help!
> >
> > Sent via Deja.com
> > http://www.deja.com/
>
Sent via Deja.com
http://www.deja.com/
aztecs@my-deja.com wrote:
>
> Could anyone tell me if the following is possible in INFORMIX:
>
> 1. Use UNLOAD to create an input file (fields separated by "|")
> 2. Try to insert these records into a table (same specs as the one in
> step two but in a different database).
> 3. If the insert fails because it is a duplicate perform an update
> instead
>
> Can this be done in a command file? What would I use LOAD, dbload???
As well as SQLUPLOAD to which you've already been referred, consider
violations tables as an alternative -- I didn't see anybody else mention
that. You do need a new enough version of IDS for that, of course, and
you'd have to post-process the violations table, so it doesn't
absolutely meet your requirements.
Also beware - SQLUPLOAD is (medium good) alpha quality code. Use at
your own risk and certainly not without experimentation on test data
first.
--
Yours,
Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h>
Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN
"I don't suffer from insanity; I enjoy every minute of it!"