MySQL Forums
Forum List  »  Stored Procedures

Re: Display all the records from table using cursor
Posted by: Peter Brawley
Date: September 26, 2017 12:43PM

I imported your data with ...

load data infile 
  'base_report.csv' 
  into table base_report
  character set 'utf8'
  fields terminated by ','
  lines terminated by '\r\n' ;

Unfortunately your base_report dataset is broken ...

+---------+------+----------------------------------------------------------------------------+
| Level   | Code | Message                                                                    |
+---------+------+----------------------------------------------------------------------------+
| Warning | 1265 | Data truncated for column 'ISSN' at row 3                                  |
| Warning | 1262 | Row 3 was truncated; it contained more data than there were input columns  |
| Warning | 1265 | Data truncated for column 'ISSN' at row 4                                  |
| Warning | 1262 | Row 4 was truncated; it contained more data than there were input columns  |
| Warning | 1265 | Data truncated for column 'ISSN1' at row 14                                |
| Warning | 1366 | Incorrect integer value: 'NULL' for column 'CC' at row 14                  |
| Warning | 1265 | Data truncated for column 'ISSN' at row 14                                 |
| Warning | 1262 | Row 14 was truncated; it contained more data than there were input columns |
| Warning | 1265 | Data truncated for column 'ISSN1' at row 15                                |
| Warning | 1366 | Incorrect integer value: 'NULL' for column 'CC' at row 15                  |
| Warning | 1265 | Data truncated for column 'ISSN' at row 15                                 |
| Warning | 1265 | Data truncated for column 'eISSN' at row 15                                |
| Warning | 1262 | Row 15 was truncated; it contained more data than there were input columns |
| Warning | 1265 | Data truncated for column 'ISSN1' at row 16                                |
| Warning | 1366 | Incorrect integer value: 'NULL' for column 'CC' at row 16                  |
| Warning | 1265 | Data truncated for column 'ISSN' at row 16                                 |
| Warning | 1262 | Row 16 was truncated; it contained more data than there were input columns |
| Warning | 1265 | Data truncated for column 'ISSN1' at row 17                                |
| Warning | 1366 | Incorrect integer value: 'NULL' for column 'CC' at row 17                  |
| Warning | 1265 | Data truncated for column 'ISSN' at row 17                                 |
| Warning | 1262 | Row 17 was truncated; it contained more data than there were input columns |
+---------+------+----------------------------------------------------------------------------+

So is the master_data dataset ...

+---------+------+----------------------------------------------------------------------------+
| Level   | Code | Message                                                                    |
+---------+------+----------------------------------------------------------------------------+
| Warning | 1265 | Data truncated for column 'CC' at row 1                                    |
| Warning | 1265 | Data truncated for column 'eISSN' at row 1                                 |
| Warning | 1262 | Row 1 was truncated; it contained more data than there were input columns  |
| Warning | 1265 | Data truncated for column 'ISSN1' at row 3                                 |
| Warning | 1366 | Incorrect integer value: 'NULL' for column 'CC' at row 3                   |
| Warning | 1265 | Data truncated for column 'eISSN' at row 3                                 |
| Warning | 1262 | Row 3 was truncated; it contained more data than there were input columns  |
| Warning | 1265 | Data truncated for column 'ISSN1' at row 4                                 |
| Warning | 1366 | Incorrect integer value: 'NULL' for column 'CC' at row 4                   |
| Warning | 1265 | Data truncated for column 'eISSN' at row 4                                 |
| Warning | 1262 | Row 4 was truncated; it contained more data than there were input columns  |
| Warning | 1265 | Data truncated for column 'ISSN1' at row 10                                |
| Warning | 1265 | Data truncated for column 'CC' at row 10                                   |
| Warning | 1265 | Data truncated for column 'ISSN' at row 10                                 |
| Warning | 1262 | Row 10 was truncated; it contained more data than there were input columns |
| Warning | 1262 | Row 23 was truncated; it contained more data than there were input columns |
| Warning | 1265 | Data truncated for column 'ISSN' at row 34                                 |
| Warning | 1262 | Row 34 was truncated; it contained more data than there were input columns |
| Warning | 1265 | Data truncated for column 'ISSN' at row 35                                 |
| Warning | 1262 | Row 35 was truncated; it contained more data than there were input columns |
| Warning | 1265 | Data truncated for column 'ISSN' at row 36                                 |
| Warning | 1262 | Row 36 was truncated; it contained more data than there were input columns |
| Warning | 1262 | Row 37 was truncated; it contained more data than there were input columns |
| Warning | 1265 | Data truncated for column 'ISSN' at row 43                                 |
| Warning | 1262 | Row 43 was truncated; it contained more data than there were input columns |
| Warning | 1265 | Data truncated for column 'ISSN' at row 44                                 |
| Warning | 1262 | Row 44 was truncated; it contained more data than there were input columns |
+---------+------+----------------------------------------------------------------------------+

A mysqldump dataset would likely work better.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Display all the records from table using cursor
688
September 26, 2017 12:43PM


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.