Problem in loading data for clob columns [message #417395] |
Fri, 07 August 2009 16:18 |
vikram1780
Messages: 222 Registered: January 2007 Location: Bangalore
|
Senior Member |
|
|
Hi,
I am having problem in loading data for tables having clob column.
Could anyone help me in correcting the below script for ctrl file inorder to load the data which is in mentioned format.
Any help really appreciated.
Table Script
------------
Create table samp
(
no number,
col1 clob,
col2 clob
);
Ctrl File
---------
options (skip =1)
load data
infile 'c:\1.csv'
Replace into table samp
fields terminated by ","
trailing nullcols
(
no,
col1 Char(100000000) ,
col2 Char(100000000) enclosed by '"' and '"'
)
Data File(1.csv)
----------------
1,asdf,"assasadsdsdsd""sfasdfadf""sdsdsa,ssfsf"
2,sfjass,"dksadk,kd,ss""dfdfjkdjfdk""sasfjaslaljs"
Error Encountered
-----------------
ORA-01461: can bind a LONG value only for insert into a LONG column
Table samp
Thanks in advance
|
|
|
|
|
|
|
|
Re: Problem in loading data for clob columns [message #417405 is a reply to message #417403] |
Fri, 07 August 2009 18:18 |
|
ebrian
Messages: 2794 Registered: April 2006
|
Senior Member |
|
|
As BlackSwan pointed out, it helps to know what version you are on. Works fine for me on 10gR2 (10.2.0.3).
E:\>type samp.ctl
options (skip =1)
load data
infile 'e:\1.csv'
Replace into table samp
fields terminated by ","
trailing nullcols
(
no,
col1 Char(100000000),
col2 Char(100000000) enclosed by '"' and '"'
)
E:\>type 1.csv
Skip_this
1,asdf,"assasadsdsdsd""sfasdfadf""sdsdsa,ssfsf"
2,sfjass,"dksadk,kd,ss""dfdfjkdjfdk""sasfjaslaljs"
E:\>sqlldr test/test control=samp.ctl
SQL*Loader: Release 10.2.0.3.0 - Production on Fri Aug 7 19:15:46 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Commit point reached - logical record count 1
Commit point reached - logical record count 2
E:\>sqlplus test/test
SQL*Plus: Release 10.2.0.3.0 - Production on Fri Aug 7 19:15:52 2009
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining options
SQL> select * from samp;
NO COL1 COL2
---------- ------------ ----------------------------------------
1 asdf assasadsdsdsd"sfasdfadf"sdsdsa,ssfsf
2 sfjass dksadk,kd,ss"dfdfjkdjfdk"sasfjaslaljs
SQL>
|
|
|
Re: Problem in loading data for clob columns [message #417408 is a reply to message #417405] |
Fri, 07 August 2009 18:48 |
vikram1780
Messages: 222 Registered: January 2007 Location: Bangalore
|
Senior Member |
|
|
Hi,
Thanks for your reply.
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for Solaris: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
I have a huge data (app 20 pages of data) for each row of col2. Data format for col2 is in the format of given example.
In that case I am encountered with below mentioned error
ORA-01461: can bind a LONG value only for insert into a LONG column
Thanks in advance
|
|
|
|
Re: Problem in loading data for clob columns [message #417413 is a reply to message #417412] |
Fri, 07 August 2009 22:47 |
vikram1780
Messages: 222 Registered: January 2007 Location: Bangalore
|
Senior Member |
|
|
hi,
Thanks for your reply.
I am not using any long column in table creation script.
I came to know its a bug in oracle.
Is there any other way. Where i can load clob data into table having huge data for each clob column.
Any help on this really appreciated.
Thanks in advance
|
|
|
Re: Problem in loading data for clob columns [message #417414 is a reply to message #417395] |
Fri, 07 August 2009 22:52 |
|
BlackSwan
Messages: 26766 Registered: January 2009 Location: SoCal
|
Senior Member |
|
|
>I came to know its a bug in oracle.
Post Bug# and/or URL to Metalink page
>Is there any other way.
To be determined.
>Where i can load clob data into table having huge data for each clob column.
Quantify "huge" to within 2 to 4 powers of 10
Is there a threshold size below which no error occurs?
Does behaviour change when only 1 CLOB per table?
[Updated on: Fri, 07 August 2009 23:31] Report message to a moderator
|
|
|