Team,
was reading this new feature about LOAD from Jeffsmiths blog
https://www.thatjeffsmith.com/archive/2021/10/using-sqlcl-to-load-csv-to-a-table-without-column-headers/ Played with this feature on my local 21c XE instance – here is what i get.
Can you help us to understand why we got only 13 rows loaded instead of 14 rows from the file ?
Kindly let me know if this has to go as a new question.
demo@XEPDB1> $ type c:\users\admin\emp_csv_without_header.txt
7698,”BLAKE”,”MANAGER”,7839,01-MAY-1981,2850,,30
7566,”JONES”,”MANAGER”,7839,02-APR-1981,2975,,20
7788,”SCOTT”,”ANALYST”,7566,19-APR-1987,3000,,20
7902,”FORD”,”ANALYST”,7566,03-DEC-1981,3000,,20
7369,”SMITH”,”CLERK”,7902,17-DEC-1980,800,,20
7499,”ALLEN”,”SALESMAN”,7698,20-FEB-1981,1600,300,30
7521,”WARD”,”SALESMAN”,7698,22-FEB-1981,1250,500,30
7654,”MARTIN”,”SALESMAN”,7698,28-SEP-1981,1250,1400,30
7844,”TURNER”,”SALESMAN”,7698,08-SEP-1981,1500,0,30
7876,”ADAMS”,”CLERK”,7788,23-MAY-1987,1100,,20
7900,”JAMES”,”CLERK”,7698,03-DEC-1981,950,,30
7839,”KING”,”PRESIDENT”,,17-NOV-1981,5000,,10
7782,”CLARK”,”MANAGER”,7839,09-JUN-1981,2450,,10
7934,”MILLER”,”CLERK”,7782,23-JAN-1982,1300,,10
demo@XEPDB1> truncate table emp2;
Table EMP2 truncated.
demo@XEPDB1> load emp2 c:\users\admin\emp_csv_without_header.txt
Load data into table DEMO.EMP2
csv
column_names on
delimiter ,
enclosures “”
encoding UTF8
row_limit off
row_terminator default
skip_rows 0
skip_after_names
#ERROR Unable to scan data.
#ERROR Index -1 out of bounds for length 8
#INFO Number of rows processed: 13
#INFO Number of rows in error: 0
#INFO Last row processed in final committed batch: 13
SUCCESS: Processed without errors
demo@XEPDB1> select count(*) from emp2;
COUNT(*)
___________
13
demo@XEPDB1>