SQL Loader: double quotes inside double quotes
Hello,
I need to find a solution for loading some data that contains double quotas. The csv contains data like:
"1";"Name1";"Name2"
"2";"Name3 "another thing here"";"Name4"
"3";"Name33 "thing here"";"Name "name" Name"
The data inside the " " must be loaded exactly as it is, that means that in the DB, for row2, column2 the data must be: Name3 "another thing here". I cannot remove the qoutes.
the CTL:
LOAD DATA
CHARACTERSET AL32UTF8
INTO table table_name
APPEND
FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '\"'
TRAILING NULLCOLS
Column1,
Column2,
Column3
Could anyone help on this?
try with this ctl
LOAD DATA
CHARACTERSET AL32UTF8
INTO table table_name
APPEND
FIELDS TERMINATED BY ';' ENCLOSED BY '"'
TRAILING NULLCOLS
Column1,
Column2,
Column3
)also refer to
here and here
for detailed explanations and instructions
Similar Messages
-
How to put single quotes inside single quotes
Hi all,
My requriement is to put a statement
LIKP~VSTEL <> INF
in a variable LV.
For that I have written
CONCATENATE LV 'LIKP~VSTEL <> "INF" ' INTO LV.
where LIKP is a table as VSTEL is a table field.
When this LV is used inside a select query, the value for LIKP~VSTEL is "INF", but I want without the double quotes. Can any one please help me with this.
Thanks and Regards,
AvinashHi,
Iif you mean LV should hold something like LIKP~VSTEL = ' INF ', then try this
data: c_quote(4) type c value ''''.
data: l_inv type string.
CONCATENATE c_quote 'INF' c_quote into l_inv.
CONCATENATE ' LIKP~VSTEL' '=' l_inv INTO LV separated by space.
Regards,
Vikranth.
Edited by: Vikranth.Reddy on Sep 1, 2009 1:55 PM -
SQL Loader - double quote within data
Hi,
I'm putting together some SQL loader scripts to load source data into a DB. The data we are receiving is comma delimited, optionally enclosed by double quotes (").
e.g. "abc","123","this is a "test"","987"
The problem I've got is that some data items contain double quotes ("test") as part of the data and this cause the SQL Loader to fall over with the error:
Record 14644: Rejected - Error on table x, column y.
no terminator found after TERMINATED and ENCLOSED field
Is it possible to load this without changing the extraction process from the source system?
My .ctl file looks like this:
LOAD DATA
INFILE '../data/toload/BR_ADDRESS.CSV'
APPEND INTO TABLE STA_COMP_BRADD
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
etc....
Message was edited by:
MaximumStaggHi,
Look in to this in Oracle documentation:
"If two delimiter characters are encountered next to each other, a single occurrence of the delimiter character is used in the data value. For example, 'DON''T' is stored as DON'T. However, if the field consists of just two delimiter characters, its value is null."
http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_field_list.htm
Thanks,
Kishore -
Pass double-quote inside a string via flashvars and SWFObject?
Hi All,
Consider some SWFObject code like this:
flashvars.data1 = "{"requestId":14979,"email":"[email protected]","zip":"12345"}";
flashvars.data2 = '{"requestId":14979,"email":"[email protected]","zip":"12345"}';
If I host my SWF in IE, FlexGlobals.topLevelApplication.parameters.data1 will be a string, with double-quotes (" entities will be translated to double quotes). However, FlexGlobals.topLevelApplication.parameters.data2 will simply be the one-character string "{".
The opposite is true in Firefox. FlexGlobals.topLevelApplication.parameters.data2 will be a string, with double-quotes (" entities will be translated to double quotes). However, FlexGlobals.topLevelApplication.parameters.data1 will simply be the one-character string "{".
How can I pass a double-quote in a flashvar using SWFObject that works in all browsers? I've been searching on this and haven't been able to find a straight answer...
-JoshThis works in both IE, Firefox, and Chrome:
flashvars.data2 = escape('{"requestId":14979,"email":"[email protected]","zip":"12345"}');
Is that the way to go if you want double quotes in your string? -
SQL*Loader and data enclosed by single quotes
Hello,
I need to migrate some data from Sybase to Oracle. Can't use the Migration Workbench because this is Sybase's SQL Anywhere product. We are therefore trying to load via SQL*Loader.
Sybase outputs its data into text files and encloses it with single quotes, like:
'ABC123',
'UR94LL',
'7YUHII'
We are running into a problem because we cannot figure out how to use the OPTIONALLY ENCLOSED BY parameter with single quotes. If we just use the FIELDS TERMINATED BY parameter, then the entire string, including the quotation marks, gets loaded into the Oracle table. This causes bad records to be created when the data is exactly the length of the column width - the two quotation markss make the field longer than is allowed in the table. Plus - the data shouldn't have quotes around it in normal situations.
We can do 'Find and Replace' to replace the single quotation marks with double quotations, but some of the Sybase tables are huge, and we'd like to avoid having to open and edit them. However, if this is the only way to go, then we'll have to use it. I just wondered whether anyone had run into this before and been able to solve it.
Thanks.
-melissaWe are running into a problem because we cannot figure out how to use the OPTIONALLY ENCLOSED BY parameter with single quotesTry
OPTIONALLY ENCLOSED BY X'27'http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96652/ch06.htm#1015083 -
How to replace single quote with double quote
hai all,
i have a problem,
i am trying insert a string containing single quote into ms-access database.
it is giving error.
how can i avoid this .if i replace a single quote in the text with double quote it will defenitely
insert into database.
in java.lang.String
replace () will not work to replace quote with double quote.
any otherway to solve this problem.
please mail me to [email protected]
thank you
sambareddy
inidajava.lang.String.replace () will not work to replace quote with double quote.Really?
String x = ...
x.replace( "'", "\"" ); -
String value changes single quote ' to double quote "
I am creating a list with different bill codes within single
quotes as follows
<cfset corlist = " '1100 ','1200 ','1300 ','1700 ','1800
','1950 ','7001 ' ">
when I do an output
for
<cfoutput>AND idbillcode IN ( #corlist
#)</cfoutput>
I get the values as follows
AND idbillcode IN ( '1100 ','1200 ','1300 ','1700 ','1800
','1950 ','7001 ')
However when I put the same string within a cfquery the
single quotes get replaced by double quotes as follows
AND idbillcode IN ( ''1100 '',''1200 '',''1300 '',''1700
'',''1800 '',''1950 '',''7001 '') which throws an error.
Anybody has any clues.
Thanks.However when I put the same string within a cfquery the
single quotes
get replaced by double quotes as follows
AND idbillcode IN ( ''1100 '',''1200 '',''1300 '',''1700
'',''1800
'',''1950
'',''7001 '') which throws an error.
Anybody has any clues.
That is ColdFusion escaping the single quotes, by doubling
them so that
you can search for strings such as "singhpk's code does not
work".
(Note the single quote/apostrophe that would normally break
this string
if it was not escaped.
To tell CF not to do this, one uses the
preserveSingleQuotes() function.
The documentation has all the details. -
What 's the difference between quote ' and double quote "?
what's the difference between quote' and double quote "?
when we use each one?
Exemple of use of each case?'c' is a char, ie. a primitive type representing a single character
"c" is an instance of the String class length 1. -
Firefox is replacing double quotes with single quotes.
In WordPress and at other sites where I input and save text, Firefox is replacing double quotes with single quotes when I save. It's also showing double quotes as single quotes on websites. I tried uninstalling and reinstalling, and it's still happening.
Do you have the needed font installed?
*http://en.wikipedia.org/wiki/Punctuation -
SQL*loader support database columns Of Binary Double/Float
Does SQL*loader support database columns Of Binary Double/Float when applying Direct Path?
Why not use Google and find out for yourself.
The first hit on Google is this
Go see for yourself
Regards
FJ -
I'm trying to match double letters inside words, excluding ones that begin or end a word. I'm running into a problem matching \B at the end of a line.
example:
My RegExp is /\Bdd\B/gi
String is "dda adda add add"
This will match twice, the dd in the 2nd word, and the dd in the 4th word. Why is it matching the 4th word??It matches only once. Make sure there are no other characters in the end of your string.
-
I have this project where i have outlined my character and have a quote inside. I outlined the hair and arms and part that will be needing color. But I'm not sure how to color the words on the inside of the outlined parts without it affecting the letters that overlap.
I'm trying to follow your description. Can you provide a screen capture?
A normal workflow is to organize elements in groups and layers. You can assign multiple attributes to any of these "Objects" using the "Appearance" panel. Move the attributes, such as fills and strokes, up or down the Appearance list as needed. Try separating your elements in this way. Target a group or layer by clicking the round button to its right, in the Layers panel and add additional fill, stroke, or effect attributes from the Appearance Panel Flyout Menu. -
SQL Loader Problem with Date Format
Dear all,
I am dealing with a problem in loading data with SQL Loader. The problem is in the date format.
More specifically, I created the following Control File:
file.ctl
LOAD DATA
INFILE 'D:\gbal\chatium.log'
APPEND INTO TABLE CHAT_SL
FIELDS TERMINATED BY WHITESPACE
TRAILING NULLCOLS
(SL1 DATE "Mon DD, YYYY HH:MI:SS FF3AM",
SL2 char,
SL3 DATE "Mon DD, YYYY HH:MI:SS FF3AM",
SL4 char,
SL5 char,
SL6 char,
SL7 char,
SL8 char,
SL9 char,
SL10 char,
SL11 char,
SL12 char,
SL13 char,
SL14 char,
SL15 char)
The data we want to load are in the following file:
Apr 29, 2007 12:05:49 AM 1060615 Apr 29, 2007 12:05:35 AM 306978537730 24026384 chatium.user.userinfo WAP 0
Apr 29, 2007 12:12:51 AM 1061251 Apr 29, 2007 12:12:27 AM 306978537730 24026384 chatium.channel.list WAP 0
Apr 29, 2007 12:12:51 AM 1061264 Apr 29, 2007 12:12:32 AM 306978537730 24026384 chatium.channel.listdetail WAP 0
Apr 29, 2007 12:13:51 AM 1061321 Apr 29, 2007 12:13:31 AM 306978537730 24026384 chatium.user.search WAP 0
Apr 29, 2007 12:13:51 AM 1061330 Apr 29, 2007 12:13:37 AM 306978537730 24026384 chatium.user.userinfo WAP 0
The error log file is the following:
SQL*Loader: Release 9.2.0.1.0 - Production on Mon Apr 30 11:29:16 2007
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Control File: file.ctl
Data File: D:\gbal\chatium.log
Bad File: chatium.bad
Discard File: none specified
(Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array: 64 rows, maximum of 256000 bytes
Continuation: none specified
Path used: Conventional
Table CHAT_SL, loaded from every logical record.
Insert option in effect for this table: APPEND
TRAILING NULLCOLS option in effect
Column Name Position Len Term Encl Datatype
SL1 FIRST * WHT DATE MonDD,YYYYHH:MI:SS
SL2 NEXT * WHT CHARACTER
SL3 NEXT * WHT CHARACTER
SL4 NEXT * WHT CHARACTER
SL5 NEXT * WHT CHARACTER
SL6 NEXT * WHT CHARACTER
SL7 NEXT * WHT CHARACTER
SL8 NEXT * WHT CHARACTER
SL9 NEXT * WHT CHARACTER
SL10 NEXT * WHT CHARACTER
SL11 NEXT * WHT CHARACTER
SL12 NEXT * WHT CHARACTER
SL13 NEXT * WHT CHARACTER
SL14 NEXT * WHT CHARACTER
SL15 NEXT * WHT CHARACTER
Record 1: Rejected - Error on table CHAT_SL, column SL1.
ORA-01840: input value not long enough for date format
Record 2: Rejected - Error on table CHAT_SL, column SL1.
ORA-01840: input value not long enough for date format
Record 3: Rejected - Error on table CHAT_SL, column SL1.
ORA-01840: input value not long enough for date format
Record 4: Rejected - Error on table CHAT_SL, column SL1.
ORA-01840: input value not long enough for date format
I wonder if you could help me.
Thank you very much in advance.
Giorgos BaliotisSQL> select to_date('Apr 29, 2007 12:05:49 AM','Mon DD, YYYY HH:MI:SS FF3AM') from dual;
select to_date('Apr 29, 2007 12:05:49 AM','Mon DD, YYYY HH:MI:SS FF3AM') from dual
ERROR at line 1:
ORA-01821: date format not recognized
SQL> ed
Wrote file afiedt.buf
1* select to_date('Apr 29, 2007 12:05:49 AM','Mon DD, YYYY HH:MI:SS AM') from dual
SQL> /
TO_DATE(
29/04/07
SQL> Then, you defined blank space as separator, but there is spaces in your date inside your file. So, you should add double-quotes around the date field like below, and add optionally enclosed by '"' into your ctlfile.
"Apr 29, 2007 12:05:49 AM" 1060615 "Apr 29, 2007 12:05:35 AM" 306978537730 24026384 chatium.user.userinfo WAP 0
"Apr 29, 2007 12:12:51 AM" 1061251 "Apr 29, 2007 12:12:27 AM" 306978537730 24026384 chatium.channel.list WAP 0
"Apr 29, 2007 12:12:51 AM" 1061264 "Apr 29, 2007 12:12:32 AM" 306978537730 24026384 chatium.channel.listdetail WAP 0
"Apr 29, 2007 12:13:51 AM" 1061321 "Apr 29, 2007 12:13:31 AM" 306978537730 24026384 chatium.user.search WAP 0
"Apr 29, 2007 12:13:51 AM" 1061330 "Apr 29, 2007 12:13:37 AM" 306978537730 24026384 chatium.user.userinfo WAP 0Example :
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_concepts.htm#sthref477
Nicolas. -
SQL Loader Inserts chr(13) and chr(10) in the first column of every row.
Hi,
I have exported a data in a pipe delimited file using TOAD in one database. Now I want to load the data in my local database using SQL Loader. However every time I try to load the data a double quote followed by a new line is entered for the first column of each row. Unfortunately the delimited file is very big and hence can't be posted here. However I tried the same with a customized table and its data and found the same problem. Below are the table structures and control file that I used.
create table test_sql
a varchar2(30),
b date
insert into test_sql values('51146263',sysdate-3);
insert into test_sql values('51146261,sysdate-1);
EXPORTED PIPE DELIMITED FILE_
A|B|!##!
51146261|04/14/13 4:55:18 PM|!##!
51146263|04/12/13 4:55:32 PM|!##!
create table test_sql1 as select * from test_sql where 1=2;
CONTROL FILE_
OPTIONS(SKIP=1)
LOAD DATA
INFILE 'C:\Users\Prithwish\Desktop\Test.txt' "str '!##!'"
PRESERVE BLANKS
INTO TABLE TEST_SQL1
FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
A CHAR(2000),
B DATE "MM/DD/YYYY HH12:MI:SS AM"
select * from TEST_SQL1;
After this when I paste it in notepad I get the following result
A B
51146261" 14-APR-0013 16:55:18
51146263" 12-APR-0013 16:55:32.
I have no idea how the quotes or the newline appear. Is this a Toad bug? Any help would be greatly appreciated. Really urgent.
Thanks in advance
RegardsHi Harry,
I actually thought that the str !##! was causing the problem. Actually my original export has some new lines in some specific columns so I can't keep the new line as my line terminator and hence I kept the !##! as my terminator.
When I put the same data in a notepad and load it there is no problem at all. For e.g I just typed the following in a notepad and the data loaded just fine.
A|B|!##!
51146261|01-01-01 10:10:10 AM|!##!
51146263|01-01-01 11:11:11 AM|!##!
Its just when I load the exported file there the problem arises though I have verified the file using UNIX as well using octal dump and found no hidden characters.
Regards,
Prithwish -
SQL Loader error while loading a date field
Hi,
I am getting the below error while I am trying to load a table with a date field using SQL Loader
Record 1: Rejected - Error on table RPT_HOST_USAGE, column USAGE_TIMESTAMP.
ORA-01861: literal does not match format string
My input file is as below
<code>
Host_Usage_ID,Host_ID,Technology_ID,Environment_ID,Usage_Timestamp,Avg_CPU_Pct,Avg_Memory_MB,CPU_Spike
1,12,1,8,'2009-08-01 00:00:00',0.000000000,23875.000000000,0.000000000
<code>
My Loader.ctl is
<code>
OPTIONS (SKIP=1)
load data
infile 'C:\rpt_Host_Usage.txt'
into table RPT_HOST_USAGE
fields terminated by ","
HOST_USAGE_ID,
HOST_ID,
TECHNOLOGY_ID,
ENVIRONMENT_ID,
USAGE_TIMESTAMP,
AVG_CPU_PCT,
AVG_MEMORY_MB,
CPU_SPIKE
<code>
I have tried options like USAGE_TIMESTAMP TO_DATE(USAGE_TIMESTAMP,'YYYY-MM-DD HH24:MI:SS') but didn't work...
Can you please tell me how to resolve this issue?
Any pointers on this will be helpful
Thanks
MaheshI went back and looked at some of my old *.ctl files and I did something simlilar to what you mentioned and it worked for me, but I had surrounded the option in double-quotes and included a colon in front of the item. Example:
TECHNOLOGY_ID,
ENVIRONMENT_ID,
USAGE_TIMESTAMP "to_date(:USAGE_TIMESTAMP,'YYYY-MM-DD HH24:MI:SS')",
AVG_CPU_PCT,
AVG_MEMORY_MB,
....
Maybe you are looking for
-
I have been unable to turn on automatic download on my iPad 2
-
Delete one Skype account on LG TV
How can I remove/delete one account from LG TV? I have signed-in with 5-6 Skype accounts, some of them I dont use any more, how can I delete it? tx
-
The ABAP program lines are wider than the internal table.
Hello; i use FM REUSE_ALV_FIELDCATALOG_MERGE to fill in fieldcat from an internal table but i receive dump message READ_REPORT_LINE_TOO_LONG. Is there smt. like a type mismatch or waht can that be? detail explanation of the dump is The internal tabl
-
I run i3 as my window manager, and whenever I open a pdf file, i3 insists on opening it in Firefox. I was wondering how I can make pdf's open by default in zathura or evince, or more generally, how I can set a default program for certain file extensi
-
Is it possible to auto-upgrade Minefield version of Firefox?
Hello, I'm wondering if it's possible to make pacman to auto-upgrade Minefield to the latest nightly build every time I execute pacman -Syu Many thanks