Reputation: 71
I am copying data from Oracle
to Netezza
. I have like thousands of rows and its taking too long to out all of these data into netezza using insert once for a row. How could I boost this up?
copyToChidDatabaseColumnInfo(rs.getString("OWNER"), rs.getString("TABLE_NAME"), rs.getString("COLUMN_NAME"));
// this is what it is within the copyToChidDatabaseColumnInfo method:
PreparedStatement pstmt = ChildConnection.prepareStatement("INSERT INTO DATABASE_COLUMN_INFO (OWNER_NAME, TABLE_NAME, COLUMN_NAME, SYSTEM_ID, PLATFORM) VALUES (?,?,?,?,?)");
pstmt.setString(1,owner);
pstmt.setString(2,tbname);
pstmt.setString(3,columnname);
pstmt.setString(4,parentSYSTEM_ID);
pstmt.setString(5,parentPlatform);
pstmt.execute();
pstmt.close();
Upvotes: 1
Views: 499
Reputation: 4295
Suggestion:
INSERT INTO DATABASE_COLUMN_INFO (nullcolumn, OWNER_NAME, TABLE_NAME, COLUMN_NAME, SYSTEM_ID, PLATFORM)
SELECT null, OWNER_NAME, TABLE_NAME, COLUMN_NAME, SYSTEM_ID, PLATFORM
FROM EXTERNAL 'table_info.csv'
(
OWNER_NAME varchar(500)
,TABLE_NAME varchar(500)
, COLUMN_NAME varchar(500)
, SYSTEM_ID varchar(500)
, PLATFORM varchar(500)
)
USING (delimiter ',' REMOTESOURCE 'jdbc' LOGDIR 'C:\\temp' skiprows 1 maxerrors 0 fillrecord true)
Upvotes: 1