-1

I am spooling data from cassandra as file. Column is

Id | text_file
---------------
1   JSON string (13000 characters string)

i have to load this data to oracle table. what should be my oracle table structure and ctl file format.

Saumya Ranjan
  • 75
  • 1
  • 3
  • 11

1 Answers1

1

You can use SQL Loader for it. I am assuming that your file contains two fields. One is Id and other is text_file and you want to load it in

LOAD DATA
INFILE '<filepath>'
TRUNCATE -- see oracle docs for more options here
INTO TABLE <YOUR_TABLE_NAME>
fields terminated by '|'
(
  ID,
  text_file CHAR(13000) -- Size needs to be mentioned here if it is more than 255 characters
)

By default, the buffer for SQL loader is 255 characters but you can alter it using CHAR(n) as mentioned in the example.

Then execute this control file using

sqlldr control=<aforementioned_file_path>

Cheers!!

Popeye
  • 35,427
  • 4
  • 10
  • 31
  • value used for ROWS parameter changed from 64 to 16 Record 1: Rejected - Error on table table_name. ORA-01950: no privileges on tablespace 'DBA_TS' Record 2: Rejected - Error on table table_name. ORA-01950: no privileges on tablespace 'DBA_TS' – Saumya Ranjan Dec 13 '19 at 12:35