inserting Data into Netezza Fastest way
Hi All,
Thought of sharing this information to all SSIS developers who are trying to insert data in to netezza, The fastest way is to use NZload which inserts data in to netezza,External tables are much faster than nzload.
Here you go
Inserting Data in to Netezza:-
INSERT INTO NetezzaTable
SELECT *
FROM EXTERNAL 'C:\\temp\\Your.csv'
USING (delimiter '~' REMOTESOURCE 'ODBC' LOGDIR 'C:\\temp' skiprows 1 maxerrors 0 fillrecord);
Extracting data out of Netezza :-
CREATE EXTERNAL TABLE 'C:\temp\test.csv' USING (remotesource 'ODBC' DELIM '~')
AS
Select * from Netezzatable limit 100;
You can create a Store procedure in netezza and call that SP from SSIS data flow task.
CREATE OR REPLACE PROCEDURE ETL_Netezza(CHARACTER VARYING(ANY))
RETURNS CHARACTER VARYING(ANY)
LANGUAGE NZPLSQL AS
BEGIN_PROC
DECLARE
PATH ALIAS FOR $1;
v_rowcount INTEGER;
BEGIN
execute immediate 'INSERT INTO Netezzatable SELECT * FROM EXTERNAL '''||PATH||''' USING(delimiter ''~'' REMOTESOURCE ''ODBC'' LOGDIR ''C:\\temp'' skiprows 1 maxerrors 0 fillrecord)';
v_rowcount:=ROW_COUNT;
RETURN v_rowcount;
END;
END_PROC;
Execute the Above SP In Aginity Framework
Select ETL_Netezza('C:\\temp\\Your.csv');
you can now call the SP from SSIS data flow task or you can assign the path name to a variable and call the variable
select ETL_Netezza ?
Hope this helps who are trying to insert data in to netezza using SSIS
SSIS ROCKS !!!!!!
Sri.Tummala
February 1st, 2013 4:45pm