I want to bulk import data from a file present on my local into the Netezza Database using NZSQL language.
I tried with below query but, I am not able to do it.
create external table ext_tab (
login_email VARCHAR(10),identifier int,first_name VARCHAR(10),last_name VARCHAR(10)
)
USING (
DATAOBJECT('C:\Business\Imp Links\Netezza\Bulk Dir\email.csv')
REMOTESOURCE 'jdbc'
DELIMITER ';'
SKIPROWS 1
MAXERRORS 1000
LOGDIR 'C:\Business\Imp Links\Netezza\Bulk Dir\Logs' );
create table email_details as select * from ext_tab;
This is my csv file named email.csv -
Login email;Identifier;First name;Last name
laura@example.com;2070;Laura;Grey
craig@example.com;4081;Craig;Johnson
mary@example.com;9346;Mary;Jenkins
jamie@example.com;5079;Jamie;Smith
When I try to run this below command it gives error -
create table email_details as select * from ext_tab;
Error -
[Code: 1100, SQL State: HY000] ERROR: Transaction rolled back by client
I am not able to bulk import data into Netezza database hence, please guide me.
Tried with another below query, still throwing another error -
CREATE EXTERNAL TABLE my_external_table_new (
login_email VARCHAR(10),identifier int,first_name VARCHAR(10),last_name
VARCHAR(10)
)
USING (DATAOBJECT ('C:\Business\Imp Links\Netezza\Bulk
Dir\email_1.csv')
DELIMITER ','
REMOTESOURCE 'JDBC'
ESCAPECHAR '\' );
CREATE TABLE my_table_new (
login_email VARCHAR(10),identifier int,first_name VARCHAR(10),last_name
VARCHAR(10)
)
insert into my_table_new (login_email, identifier, first_name,
last_name)
select login_email, identifier, first_name, last_name
from my_external_table_new;
Error -
[Code: 1100, SQL State: HY000] ERROR: Remotesource option of external table was not defined to load/unload using a jdbc/dotnet client