Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, everyone! Did anyone ever come across this problem? I'm trying to insert data into my dw.
I already disabled my FKs on my data warehouse. But it won't go anyways.
Here's the error:
Cannot add or update a child row: a foreign key constraint fails
(`dw_bi_web`.`fact_lancamento_contabil`, CONSTRAINT `fk_fact_lancamento_contabil_dim_conta_contabil1`
FOREIGN KEY (`dim_conta_contabil_sk_conta_contabil`)
REFERENCES `dim_conta_contabil` (`sk_c) [statistics] disconnected Job carga_fato_contas ended at 11:11 12/04/2018. [exit code=0]
Thanks!
Hello,
Could you please clarify in which Talend version/edition you are?
Best regards
Sabrina
@isadoralmeida06,this is DB related issue.
Foreign key relationships involve a parent table that holds the central data values, and a child table with identical values pointing back to its parent. The FOREIGN KEY clause is specified in the child table.
It will reject any INSERT or UPDATE operation that attempts to create a foreign key value in a child table if there is no a matching candidate key value in the parent table.
Please check the the vaule which you were instering or updating in `dw_bi_web`.`fact_lancamento_contabil` are presnt in `dim_conta_contabil`.
@isadoralmeida06, did this help you?
If so, thank's to mark your case as solved (Kudos also accepted).
Hi
Basically, yes it does have an fk in my child table, but the problem is, it should be working.
So I have a field on my parent table (item) from my data warehouse called "item_description" which is a long string, e.g : "1-The car was cleaned on time.".
And then on my database (origem), I have a table that have this same column with exact same rows "1-The car was cleaned on time." and then when I do mapping, it gives me the FK error, and when i dropped my FK constraint, it says that my sk is null, so my fact table has all NULLs on the item_sk.
Does anyone know how to make talend get it that if a text is equal to the other, get the correspondent SK?
All my other maps are working, but the matches are between, few words or number.
Can you share your tables definition?
What if you try to do same from SQL, not from a Talend job?
It works on my database. But all the project is on talend, cuz that's what my client wants. Anyways, I managed to work around it a couple of days ago,but I wish I could get it fixed by the BI rules, you know. Trought the Surrogate key. But I'll leave like this for now.
Thanks!