Solved

load data above varchar2(4000) using sqlldr

Posted on 2009-05-04
4
1,226 Views
Last Modified: 2013-12-19
i pull data from sybase using BCP and then build a pipe delimited data file.

I see 2 of the fields are above varchar2(4000).

I need to use sql loader to load the data file to my oracle table.

How to handle the data above 4000 bytes.?


0
Comment
Question by:vishali_vishu
  • 2
4 Comments
 
LVL 40

Expert Comment

by:mrjoltcola
ID: 24300492
You should probably use CLOB, there is no "long varchar" as in Sybase, but CLOB works just fine.
0
 
LVL 1

Author Comment

by:vishali_vishu
ID: 24300510
can you please give an example of the ctl file using clob and the create table structure.
0
 
LVL 40

Accepted Solution

by:
mrjoltcola earned 500 total points
ID: 24300606
CREATE TABLE T (
  ID INTEGER PRIMARY KEY,
  COL1 CLOB
);


Then use the file below. It has inline data, not external file data. To use your data file, you comment out:

infile *

and uncomment:

infile 'dataload.dat'

-- sample sql loader for clob

-- t.ctl

-- run: sqlldr username/password control=t.ctl
 

load data

--infile 'dataload.dat'

infile *

append into table t

fields terminated by '|' optionally enclosed by '"'

(

id      INTEGER EXTERNAL,

col1    CHAR

)

begindata

1|sample data clob ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ

2|"sample data clob 2 ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"

Open in new window

0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
levels for reporting 5 63
Trigger usage 2 59
sort a spool into file output in oracle 1 21
Oracle sql query 7 38
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now