database - How should I escaping quotes and line breaks for Oracle SQLLoader (sqlldr) importing? -


First of all: Yes, I know about CONCENDENT and CONTINUEIF, but I'm not smart enough to understand the documentation can. I do not know how they solve my problem. Thanks ...

I am in a position to create the file to import into an Oracle DB via sqlldr.

The column file file needs to be delimited with "~" (ask no ask), I have some concern about the behavior of sqlldr in relation to quotes and newlines.

If there is a simple line column values ​​to include:

  one, hello ~ world like you "and three"  
< P> How should I output this file? My first estimate is

  one ~ "hello ~ world me" like you "three" <3>  

I think it's with suspended field It would be easy to import via optional 'encounter' specified in the CTL file. I do not know how to handle that as if I am creating the file, there are quotes around then Should they also save? how?

Additional Bonus Questions: There may be line-breaks in the fields. If "raw" is written then it will be converted to

  one line break ~ three  

is there any option in the CTL file Can I use it in "sewing"? There may be breaks in different columns, and more than one brake or column may be on record.

Thanks in advance!

After some experiments I found it:

  CTL file and table structure  
  
  in "optionally closed" " 

The correct way to handle quotation and delimiter

  1 ~ Hello World 2 ~ "Area defined by  key: number, message: varchar2  

Hello ~ world "3 ~" hello "" world "" 4 ~ "hello ~" "world" ""

So if the data has a delimiter, Quoted value and modify quotes in value 2 quotes.

As far as the new lines go, I'm going to ask him another question.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -