Loading TEXT fields using dbload
Posted in 2007
Art Kagel asked how to load TEXT columns with dbload, since the Migration Guide gave no command file syntax. He first thought the load file holds a filename pointing to the contents, but Carsten Haese doubted this and Art found by testing he had loaded filenames. Carsten said dbload tolerated unquoted newlines on 10.00.UC5, though pipes need quoting, and suggested a Python loader.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Topics: Migration, Import/Export & Data Conversion
I've never tried this before, but have a need now. The Migration Guide says:
"You can load simple large objects with the dbload utility as long as the simple
large objects are in text files."
But nowhere does it say how to code the command file to do that. Has anyone
done it? Anyone at IBM know how?
Art S. Kagel
On Jun 12, 1:28 pm, "ART KAGEL, BLOOMBERG/ 731 LEXIN"
<k...@bloomberg.net> wrote:
> I've never tried this before, but have a need now. The Migration Guide says:
>
> "You can load simple large objects with the dbload utility as long as the simple
> large objects are in text files."
>
> But nowhere does it say how to code the command file to do that. Has anyone
> done it? Anyone at IBM know how?
Never mind, I remembered. The load file contains a filename in the
TEXT field location and the named file contains the TEXT field's
actual contents. <sigh> I'm getting slow in my old age.
Art S. Kagel
On Tue, 2007-06-12 at 17:42 +0000, Art S. Kagel wrote:
> On Jun 12, 1:28 pm, "ART KAGEL, BLOOMBERG/ 731 LEXIN"
> <k...@bloomberg.net> wrote:
> > I've never tried this before, but have a need now. The Migration Guide says:
> >
> > "You can load simple large objects with the dbload utility as long as the simple
> > large objects are in text files."
> >
> > But nowhere does it say how to code the command file to do that. Has anyone
> > done it? Anyone at IBM know how?
>
> Never mind, I remembered. The load file contains a filename in the
> TEXT field location and the named file contains the TEXT field's
> actual contents. <sigh> I'm getting slow in my old age.
Really? I thought that's how BLOB and CLOB columns get unloaded/loaded.
I thought BYTE just unloaded the stream in hex into the unload file and
TEXT dumps the actual contents into the unload file, with
backslash-quoting of line endings and embedded pipes.
--
Carsten Haese
http://informixdb.sourceforge.net
On Jun 12, 1:55 pm, Carsten Haese <cars...@uniqsys.com> wrote:
> On Tue, 2007-06-12 at 17:42 +0000, Art S. Kagel wrote:
> > On Jun 12, 1:28 pm, "ART KAGEL, BLOOMBERG/ 731 LEXIN"
> > <k...@bloomberg.net> wrote:
> > > I've never tried this before, but have a need now. The Migration Guide says:
>
> > > "You can load simple large objects with the dbload utility as long as the simple
> > > large objects are in text files."
>
> > > But nowhere does it say how to code the command file to do that. Has anyone
> > > done it? Anyone at IBM know how?
>
> > Never mind, I remembered. The load file contains a filename in the
> > TEXT field location and the named file contains the TEXT field's
> > actual contents. <sigh> I'm getting slow in my old age.
>
> Really? I thought that's how BLOB and CLOB columns get unloaded/loaded.
> I thought BYTE just unloaded the stream in hex into the unload file and
> TEXT dumps the actual contents into the unload file, with
> backslash-quoting of line endings and embedded pipes.
You're right. I was too quick with the keyboard. Testing it, I ended
up loaded a bunch of filenames.
Ahh well. I guess I'll just have to post-process the exported data to
quote the newlines, etc.
Art S. Kagel
> --
> Carsten Haesehttp://informixdb.sourceforge.net
On Tue, 2007-06-12 at 18:01 +0000, Art S. Kagel wrote:
> Ahh well. I guess I'll just have to post-process the exported data to
> quote the newlines, etc.
dbload seems to forgive unquoted newlines, at least it did in my quick
experiment on 10.00.UC5. Of course, embedded pipe characters would still
have to be quoted. Maybe you should consider writing a small Python
script to load the data ;)
--
Carsten Haese
http://informixdb.sourceforge.net