on 08-01-2013 7:47 AM
Dear all, I hope someone can help
When I attempt to load data into my table, i receive this message, and also now get it when performing a check on the .hdbtim file
ERROR playpen/db/ZGS.hdbtim
Repository: Internal error during statement execution, please see the database error traces for additional details An error occurred when inserting data from csvfile to table. CSV-file: playpen.db:ZGS. Target Table: playpen.db::ZGS Exception:: unique constraint violated: Table(playpen.db::ZGS) at ptime/query/plan_executor/trex_wrapper/trex_wrapper_body/trex_update.cc:1391
I know what is causing it.
I have an Att View which uses my table ZGS, with a join to M_TIME_DIMENSION. Without the join, it works fine.
My table is defined as this, in a .hdbtable
table.columns = [
{name = "MANDT"; sqlType = NVARCHAR; length = 3; nullable = false; comment = "Client"; },
{name = "MATNR"; sqlType = NVARCHAR; nullable = false; length = 18; comment = "Material Number"; },
{name = "CHARG"; sqlType = NVARCHAR; nullable = false; length = 10; comment = "Batch Number"; },
{name = "ADBTH"; sqlType = DATE; nullable = true; comment = "Actual RDR Delivery Date"; }
];
table.primaryKey.pkcolumns = ["MATNR","CHARG"];
My Att View contains the fields from ZGS: MATNR and CHARG, and the field CALMONTH from M_TIME_DIMENSION. The Att View, has MATNR and CHARG as Key Attributes.
It is joined using ZGS-ADBTH to M_TIME_DIMENSION-DATE_SQL.
The Join is Referention, with no Cardinality (the default).
Anyone ?
Thanks
G
This message was moderated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Glen,
If you have solved this issue, you can ignore it.
I think that you load duplicate data into your table, so please you related data, if you table has no dada, you only check cvs file, otherwise you need to check both (table and cvs).
Hope this can help you.
Regards,
Jerry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Glen,
Thank you for your information, according to your posted error information, it should be duplicate data issue "unique constraint violated", so I suggested you double checked related data before.
Based on your commends, you can import your csv file by command, then I tested on my test environment, even if the design-time table has used as att view, it also can imported related data to design-time table.
Why you use "date" type as join condition? It is joined using ZGS-ADBTH to M_TIME_DIMENSION-DATE_SQL.
could you test other type suchas integer or varchar as join type to try again.
Hope this can help you .
Regards,
Jerry
Hi Glen,
As my mention, you can test for other column, you know, the "calmonth" column has duplicate data, though you did not import data to m_time_dimension, I am afraid that it maybe HANA import bug under special situation or landscape, so I suggest that you try other field to test it.
Regards,
Jerry
Hi Glen,
I don't think the attribute view might be causing the issue. It is just a view and should not perform unique constraint check. This seems more with the data.
Can I request you to do something to check if there are any duplicate records in the table itself.
My doubt is there might be multiple values for MANDT for a given combination of MATNR and CHARG, which is causing the unique key constraint issue. Ideally even MANDT should be part of the primary key.
Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Glen,
When you Import data from CSV to a table, for the very first time it does not throw any error for column store table if you choose proper key and length. As your CSV file contains only one record, obviously your table has one record.
But when you try Import again for an existing table, make sure that your CSV file does not contain the record which is already inserted in table, else you will get unique constraint violation.
Regards
Raj
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.