dbTalk Databases Forums  

Oracle Import

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Oracle Import in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
The Magnet
 
Posts: n/a

Default Oracle Import - 08-06-2010 , 08:37 AM






We are exporting data from MySQL to Oracle. According to the
developers the data from MySQL contains new lines and tabs (\n, \r,
\t).

Is there a way to retain that in the message? The data is being
imported into a CLOB column. Are there CHR for that? I think there
is more than just a replace, so, I'm looking for ideas as I continue
to search.

Thanks!

Reply With Quote
  #2  
Old   
Mark D Powell
 
Posts: n/a

Default Re: Oracle Import - 08-06-2010 , 11:04 AM






On Aug 6, 9:37*am, The Magnet <a... (AT) unsu (DOT) com> wrote:
Quote:
We are exporting data from MySQL to Oracle. *According to the
developers the data from MySQL contains new lines and tabs (\n, \r,
\t).

Is there a way to retain that in the message? *The data is being
imported into a CLOB column. *Are there CHR for that? *I think there
is more than just a replace, so, I'm looking for ideas as I continue
to search.

Thanks!
If you are going to load the data in question into a CLOB column then
the sqlldr utility has the ability to load LOB's and each LOB can be a
file so the tabs, CR, and NL can be loaded.

You can also load the data via programs that insert the data in
question.

You can shove tab and NL into varchar2 columns for that matter. As
long as the data submitted to Oracle has tab and NL in it Oracle will
store it. If you transfer the data across platforms be sure you do
not translate it such as the ASCII FTP I do between Windows and UNIX
automatically converts Windows text file CR NL combinations in just NL
on windows.

HTH -- Mark D Powell --

Reply With Quote
  #3  
Old   
patrick
 
Posts: n/a

Default Re: Oracle Import - 08-06-2010 , 12:27 PM



On Aug 6, 6:37*am, The Magnet <a... (AT) unsu (DOT) com> wrote:
Quote:
We are exporting data from MySQL to Oracle. *According to the
developers the data from MySQL contains new lines and tabs (\n, \r,
\t).

Is there a way to retain that in the message? *The data is being
imported into a CLOB column. *Are there CHR for that? *I think there
is more than just a replace, so, I'm looking for ideas as I continue
to search.

Thanks!
Export file cannot use \t, \n as field or record delimiter.

In sqlldr control file specify those separators, e.g.,
load data
infile 'xxx.dat' "str '<R>'"
APPEND
into table XXXXXX.xxx_xx
REENABLE DISABLED_CONSTRAINTS
fields terminated by '<F>'
trailing nullcols

Assuming CLOB size is small enough you can also specify as
as CHAR(64000) in the control file.

====>Patrick

Reply With Quote
  #4  
Old   
The Magnet
 
Posts: n/a

Default Re: Oracle Import - 08-06-2010 , 12:43 PM



On Aug 6, 11:04*am, Mark D Powell <Mark.Powe... (AT) hp (DOT) com> wrote:
Quote:
On Aug 6, 9:37*am, The Magnet <a... (AT) unsu (DOT) com> wrote:

We are exporting data from MySQL to Oracle. *According to the
developers the data from MySQL contains new lines and tabs (\n, \r,
\t).

Is there a way to retain that in the message? *The data is being
imported into a CLOB column. *Are there CHR for that? *I think there
is more than just a replace, so, I'm looking for ideas as I continue
to search.

Thanks!

If you are going to load the data in question into a CLOB column then
the sqlldr utility has the ability to load LOB's and each LOB can be a
file so the tabs, CR, and NL can be loaded.

You can also load the data via programs that insert the data in
question.

You can shove tab and NL into varchar2 columns for that matter. *As
long as the data submitted to Oracle has tab and NL in it Oracle will
store it. *If you transfer the data across platforms be sure you do
not translate it such as the ASCII FTP I do between Windows and UNIX
automatically converts Windows text file CR NL combinations in just NL
on windows.

HTH -- Mark D Powell --

Well, maybe not the best way, but I was thinking of replacing the \t
with CHR(9) and the \n with CHR(10). I'll just parse the line. It
comes from MySQL with the line feed & tab stuff, so I'll just do a
parse / replace.

It is a one time thing, so I think that will do.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.