unload inserts unwanted backslashes
Posted in 2000
Topics: Migration, Import/Export & Data Conversion, Platform-Specific Issues
How does one prevent the Informix 'unload to' command from automatically inserting a backslash before a "real" backslash within the exported ASCII file? The computer is HP-UX running B.10.20 Thanks, Mike Sent via Deja.com http://www.deja.com/ Before you buy.
If you intend to reload an informix database using these files, then the extra backslashes are required to "quote" the embedded backslashes. If not, then just sed the extra backslashes out of the unloaded files. In article <8btt9m$rlt$1@nnrp1.deja.com>, mike_jay@my-deja.com wrote: > How does one prevent the Informix 'unload to' > command from automatically inserting a backslash > before a "real" backslash within the exported > ASCII file? > > The computer is HP-UX running B.10.20 > > Thanks, > Mike > > Sent via Deja.com http://www.deja.com/ > Before you buy. > Sent via Deja.com http://www.deja.com/ Before you buy.
Really appreciate the reply, but can I use some environment variable or some other solution native to Informix to suppress the additional backslashes--the number of records will be in the order of millions. However, if parsing the UNIX host ASCII files provides the only approach as the cutomary solution, that may the the route I have to go. Thanks again, Mike In article <8buciv$d27$1@nnrp1.deja.com>, georhill@my-deja.com wrote: > If you intend to reload an informix database using these files, then > the extra backslashes are required to "quote" the embedded backslashes. > If not, then just sed the extra backslashes out of the unloaded files. > In article <8btt9m$rlt$1@nnrp1.deja.com>, > mike_jay@my-deja.com wrote: > > How does one prevent the Informix 'unload to' > > command from automatically inserting a backslash > > before a "real" backslash within the exported > > ASCII file? > > > > The computer is HP-UX running B.10.20 > > > > Thanks, > > Mike > > > > Sent via Deja.com http://www.deja.com/ > > Before you buy. > > > > Sent via Deja.com http://www.deja.com/ > Before you buy. > Sent via Deja.com http://www.deja.com/ Before you buy.
mike_jay@my-deja.com wrote: > How does one prevent the Informix 'unload to' > command from automatically inserting a backslash > before a "real" backslash within the exported > ASCII file? As someone else asked -- why would you want to suppress this? The LOAD process needs the double backslash. It uses a single backslash to indicate that the next character is part of the data; it could be a newline, a pipe (or other delimiter symbol), or a backslash itself. If you omit it, the output becomes ambiguous. Check out SQLCMD from the IIUG archives. Amongst other things, it allows you to specify the escape character, which you could set to something other than backslash (perhaps the code for ASCII ESC?). As long as neither the escape nor the delimiter appears in your data, you will achieve the desired effect. I remain to be convinced that what you are seeking to do is a good idea, though. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v1.00.PC1 -- see http://www.perl.com/CPAN #include <disclaimer.h>
The SQL*Loader for the Oracle 8.0.6 DBMS on the HP-UX B.10.20 does not require the additional backslashes inserted by the Informix unload command. When I use the Informix unload command the extra backslashes between the pipe delimiter in the ASCII host file become part of the data when inserted into the Oracle DMBS copy of the Informix DBMS. The unload is adding information within the columns of my row data instead of just exporting the data "as is" between the pipe delimiter as I am trying to specify. Can I stop this with an environment variable or some other means of declaration, yes/no? What I am looking for is the "don't do that" environment variable. I have no idea what character I could use as a reserved only for me special case escape character with thousands and in some cases millions of records to consider. If no, I will use the recommendation provided first to apply the sed UNIX command to extract the extra backslash from my data. I appreciate your help. Thanks, Mike In article <38E2EE1C.674147B5@earthlink.net>, Jonathan Leffler <jleffler@earthlink.net> wrote: > mike_jay@my-deja.com wrote: > > > How does one prevent the Informix 'unload to' > > command from automatically inserting a backslash > > before a "real" backslash within the exported > > ASCII file? > > As someone else asked -- why would you want to suppress this? > The LOAD process needs the double backslash. It uses a single > backslash to indicate that the next character is part of the > data; it could be a newline, a pipe (or other delimiter symbol), > or a backslash itself. If you omit it, the output becomes > ambiguous. > > Check out SQLCMD from the IIUG archives. Amongst other things, > it allows you to specify the escape character, which you could > set to something other than backslash (perhaps the code for ASCII > ESC?). As long as neither the escape nor the delimiter appears > in your data, you will achieve the desired effect. I remain to be > convinced that what you are seeking to do is a good idea, though. > > -- > Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) > Guardian of DBD::Informix v1.00.PC1 -- see http://www.perl.com/CPAN > #include <disclaimer.h> > > Sent via Deja.com http://www.deja.com/ Before you buy.