Hi,
I implements a java loader component and use COPY statement in order to load the data into Vertica.
This is a snippet of my java code :
....
Connection connection = DriverManager.getConnection(connectionUrl, username, password);
try {
String sql = "COPY public.TEST_LOAD_TABLE (A, B, DATADATE FORMAT 'YYYYMMDDHH24MISS', N) FROM STDIN DELIMITER '|' TRAILING NULLCOLS DIRECT NO COMMIT;"
FileInputStream file = new FileInputStream(workingFile);
connection.setAutoCommit(false);
PGStatement stmt = (PGStatement) connection.createStatement();
stmt.executeCopyIn(sql, file);
} catch (Exception ex) {
connection.rollback();
throw ex;
}
connection.commit();
........
During the copy statement I have some reject records, but I need to know which records has been rejected in order to edit e reload these ones.
Does exist a way to retrieve the rejected records?
Retrieve rejected records after COPY command
Moderator: NorbertKrupa
Re: Retrieve rejected records after COPY command
Hi caprile!
What Vertica version you are using? and JDBC drivers? 3.5? 4.1?
PS
http://my.vertica.com/docs/5.0/JDBC/index.html
Interface PGStatement has declaration of next method getNumRejectedRows() (but it deprecated as of 4.1)
If you will migrate to Vertica JDBC 5.1 drivers here example
What Vertica version you are using? and JDBC drivers? 3.5? 4.1?
PS
http://my.vertica.com/docs/5.0/JDBC/index.html
Interface PGStatement has declaration of next method getNumRejectedRows() (but it deprecated as of 4.1)
If you will migrate to Vertica JDBC 5.1 drivers here example
Re: Retrieve rejected records after COPY command
Hi,
I'm using Vertica 5.0 and the java component VerticaCopyStream is not available,
I will migrate to Vertica 5.1 because is much important for my business to have the references to the rejected rows so I can reload these ones.
Thank you very much!!
I'm using Vertica 5.0 and the java component VerticaCopyStream is not available,
I will migrate to Vertica 5.1 because is much important for my business to have the references to the rejected rows so I can reload these ones.
Thank you very much!!