Error in inserting records into sqlserver table
Posted: Mon Jun 04, 2007 5:50 am
Hi All,
I am getting errors while inserting records from sequential file to sqlserver table.
My seq file contains data like this
-------------------------------------------------------
name,header_date,start_date,no_of_records
IB,2007-04-16 10:20:30,Apr 16 2007 ,300
-------------------------------------------------------
In the database table the data type of above columns are mentioned below
name varchar(4)fk
header_date datetime
start_date varchar(12)
no_of_records numeric(5,3)
I have taken the metadata in the seq file as below
name varchar(4)
header_date varchar (23)
start_date varchar(12)
no_of_records integer(10)
for header_date column,in the trnasformer stage I have defined the derivation as
StringToTimestamp( input.file_header_date,"%yyyy-%mm-%dd %hh:%nn:%ss")
after running the job I am getting following error
-------------------------------------------------------------------------------------
Dynamic_RDBMS_11,0: Warning: stats_2_insert.Dynamic_RDBMS_11: [DataDirect][ODBC SQL Server Driver][SQL Server]INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_DSS_SOURCE'. The conflict occurred in database 'FIDO', table 'source', column 'name
-------------------------------------------------------------------------------------
in the source table I have value for name column as IB then what this error is pointing to any suggestions?
I am getting errors while inserting records from sequential file to sqlserver table.
My seq file contains data like this
-------------------------------------------------------
name,header_date,start_date,no_of_records
IB,2007-04-16 10:20:30,Apr 16 2007 ,300
-------------------------------------------------------
In the database table the data type of above columns are mentioned below
name varchar(4)fk
header_date datetime
start_date varchar(12)
no_of_records numeric(5,3)
I have taken the metadata in the seq file as below
name varchar(4)
header_date varchar (23)
start_date varchar(12)
no_of_records integer(10)
for header_date column,in the trnasformer stage I have defined the derivation as
StringToTimestamp( input.file_header_date,"%yyyy-%mm-%dd %hh:%nn:%ss")
after running the job I am getting following error
-------------------------------------------------------------------------------------
Dynamic_RDBMS_11,0: Warning: stats_2_insert.Dynamic_RDBMS_11: [DataDirect][ODBC SQL Server Driver][SQL Server]INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_DSS_SOURCE'. The conflict occurred in database 'FIDO', table 'source', column 'name
-------------------------------------------------------------------------------------
in the source table I have value for name column as IB then what this error is pointing to any suggestions?