Re: SQL-Loader Problem

From: <rthorne_at_my-dejanews.com>
Date: Fri, 10 Jul 1998 03:04:13 GMT
Message-ID: <6o40bd$dpb$1_at_nnrp1.dejanews.com>


In article <35a4a424.19011937_at_news.topnet.de>,   Henrik.Bachmann_at_bim-consulting.de (Henrik Bachmann) wrote:
> Hi there anybody!
>
> I'm trying to load some rows with fields from a file into a table,
> e.g. TO, SUBJECT and BODY. The field BODY consists of several physical
> lines. The number and the length of the rows of these BODY are
> variable. Another potential problem: The body contains free formatted
> text and characters, such as ",',|,~,...
>
> Any ideas to create an appropriate control file for the loader?
>
> Best regards
>
> Henrik
>
> Henrik Bachmann
> mailto:Henrik.Bachmann_at_bim-consulting.de
> B.I.M.-Consulting Magdeburg
> Germany
>
>

Henrik,

It depends how you're using your data. For a similar application I'm doing, I take all of the control characters and encode them (say, CR ==> \n, TAB ==> \t), and then I do the Loader .CTL tab delimited:

--Here's the style of CTL I use
LOAD DATA
INFILE *
INTO TABLE mytable APPEND
FIELDS TERMINATED BY X'09'
(SUBJECT, BODY)
BEGINDATA
This is my subject This is the body of the message.\nAnd here is line two. <End of the CTL file>

If your application using the data can scan for the encoded control characters and then expand them, this works reasonably nicely.

Rob

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Fri Jul 10 1998 - 05:04:13 CEST

Original text of this message