I wanted to use plugins.rawSQL.getException().getMessage() to show the user what could have gone wrong in case of an error in a LOAD DATA INFILE MySQL statement, but I always get this message
TypeError: Cannot call method "getMessage" of
```I tried the same statement in MySqlWorkbench and I get the expected error (I purportedly shortened the column length to throw an error, otherwise the statement would execute correctly)```
Error Code: 1406. Data too long for column 'fd_name' at row 1
The method is this
sqlExp = LOAD DATA LOCAL INFILE '/Users/rioba/2013/File DB/list.csv' REPLACE INTO TABLE dbfa_geo.tb_test CHARACTER SET 'utf8' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' IGNORE 1 LINES (fd_name,@dummy,fd_stat) SET fd_created = CURRENT_TIMESTAMP(),fd_mod = CURRENT_TIMESTAMP();
var done = plugins.rawSQL.executeSQL('dbfa_geo','tb_test',sqlExp);
if(done)
{
plugins.dialogs.showInfoDialog('','Import OK','Ok');
}
else
{
var endMsg = plugins.rawSQL.getException().getMessage();
plugins.dialogs.showInfoDialog('',endMsg,'Ok');
}
Any suggestion on what am I doing wrong?