Re: Fatal error encountered attempting to read the resultset.
Posted by: Fernando Gonzalez
Date: October 01, 2012 10:35AM

Hi,

in your sample entry
BRCOL-CORE-A,0,2000000533586F00,1,0,9/17/12 8:45 PM,304,6527.82,24454.09,30981.9013,11.34,46.27,57.602,10.27,29.19,1.778,1.937,1.904,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.4,5.71,3.55,0.0,0.0,0.0,0.0

if that is in the first row, it will be ignored, because the clause "IGNORE 1 LINES "

I was looking into the code and found other issues, first "Port" column appears twice in create table, so stmt cannot be executed as is.

removing first definition of port in create you can run the load data like this
LOAD DATA LOCAL INFILE 'D:\\src\\ForumIssues\\LoadDataInfile\\input.txt' INTO TABLE By_Switch FIELDS TERMINATED BY ',' LINES TERMINATED BY '\\r\\n'

That should work.

Also a good way to find out the right format for the CSV file is to run a couple of statements like:

insert into By_Switch select 'BRCOL-CORE-A',0,'2000000533586F00',1,0,'9/17/12 8:45 PM',304,6527.82,24454.09,30981.9013,11.34,46.27,57.602,10.27,29.19,1.778,1.937,1.904,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.4,5.71,3.55,0.0,0.0,0.0,0.0


select * from By_Switch into outfile 'D:\\src\\ForumIssues\\LoadDataInfile\\output.txt'



Thanks.

Options: ReplyQuote


Subject
Written By
Posted
Re: Fatal error encountered attempting to read the resultset.
October 01, 2012 10:35AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.