Forum Stats

  • 3,781,248 Users
  • 2,254,496 Discussions
  • 7,879,623 Comments

Discussions

Unsuccessful CSV loading (Column in header row XXXX is not defined for table)

gmatisa
gmatisa Member Posts: 32 Blue Ribbon
edited Dec 1, 2021 7:02PM in SQLcl

Hi,


I have csv file that I need to load into table. This is how top 5 rows look like:

$ head -5 aktivnost.csv

AKTIVNOST_ID,TEMA_ID,CIKLUS_ID,AKTIVNOST_VRSTA_ID,AKTIVNOST_TIP_ID,CILJANA_GRUPA_ID,MJESTO_ID,AKTIVNOST_DATUM,AKTIVNOST_TRAJANJE,AKTIVNOST_NAPOMENA

"1","1","2","4","3","2","5420","2005-10-19 00:00:00","1",""

"2","1","2","5","3","1","5420","2005-10-20 00:00:00","2",""

"3","1","2","5","3","1","5419","2005-12-19 00:00:00","2",""

"4","1","2","5","3","1","5420","2005-11-24 00:00:00","2",""


But, "load" command gives a strange error:

$ sqlcl

SQLcl: Release 20.4 Production on Wed Dec 01 19:53:46 2021

Copyright (c) 1982, 2021, Oracle. All rights reserved.

Connected to:

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Version 19.13.0.1.0

SQL> describe aktivnost

         Name    Null?       Type 

_____________________ ___________ ________________ 

AKTIVNOST_ID     NOT NULL  NUMBER      

TEMA_ID              NUMBER      

CIKLUS_ID             NUMBER      

AKTIVNOST_VRSTA_ID        NUMBER      

AKTIVNOST_TIP_ID         NUMBER      

CILJANA_GRUPA_ID         NUMBER      

MJESTO_ID             NUMBER      

AKTIVNOST_DATUM          DATE       

AKTIVNOST_TRAJANJE        NUMBER      

AKTIVNOST_NAPOMENA        VARCHAR2(100)   

SQL> load aktivnost aktivnost.csv

format csv


column_names on

delimiter ,

enclosure_left "

enclosure_right "

encoding UTF8

row_limit off

row_terminator default

skip_rows 0

skip_after_names


--Column in header row AKTIVNOST_ID is not defined for table.

--Number of rows processed: 0

--Number of rows in error: 0

--No rows committed

3 - SEVERE: Severe error, processing terminated

=========================================

Why would sqlcl say that column AKTIVNOST_ID does not exist in a table when it is evident (see "describe aktivnost" output) that the column is there?


With regards,

Goran