[resolved] error when I try to deploy the data model after i set the foreign key

One Star

[resolved] error when I try to deploy the data model after i set the foreign key

I get an error when I try to deploy the data model after i set the foreign key:
"FK field 'REF_VAL_CD' is invalid because it isn't typed as string (nor a string restriction)."
I'm successfully created and deployed a view into and mdm server but the I'm having issue setting the foreign key on the data model between the two tables so that the child table will include the parent table attributes as a Pick-list that pops up for the mdm users.
I checked and both "ref_val_cd" fields (in parent and child tables) are set as type string.
I attached some screen shot to help explaining the issue.

Accepted Solutions
Employee

Re: [resolved] error when I try to deploy the data model after i set the foreign key

Hi,
To answer:
Is it compulsory for the B's "A_ID" to be a string, although A's "A_ID" is an integer?

The quick answer is "yes". This is because B's "A_ID" may contain square brackets (this a Talend MDM convention for foreign key values) so even if A's "A_ID" is an integer (this perfectly fine), the B's FK needs to be string to accept values such as "" (otherwise you would have a validation error for the value in B since '' are not a valid characters for integers).

All Replies
Moderator

Re: [resolved] error when I try to deploy the data model after i set the foreign key

Hi,
Could you tell us what the build version you're using?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] error when I try to deploy the data model after i set the foreign key

Talend Platform for MDM 5.4.1
Employee

Re: [resolved] error when I try to deploy the data model after i set the foreign key

Please report a bug on Jira (jira.talendforge.org) and attach your data model to the Jira (use 'Protected view' if you attach a data model you don't want to be seen by everyone).
Moderator

Re: [resolved] error when I try to deploy the data model after i set the foreign key

Hi tal_cohen,
I would suggest you to connect to the Support portal and ask our support colleagues to log a jira issue for you with high priority, through the support cycle.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Employee

Re: [resolved] error when I try to deploy the data model after i set the foreign key

This is issue is described in https://jira.talendforge.org/browse/TMDM-7214 and is fixed for next scheduled 5.4 release (5.4.2).
One Star

Re: [resolved] error when I try to deploy the data model after i set the foreign key

I was having this same issue in 5.4.1 and upgraded to 5.5.0 am still having this issue when I try deploying the container. Is this not resolved in the 5.5.0 version?
Moderator

Re: [resolved] error when I try to deploy the data model after i set the foreign key

Hi,
This jira issue is fixed on 5.4.2, 5.6.0.
You'd better open a support ticket on Talend Support Portal to ask for a solution for your current build version. Our Colleagues from support team will see if it is possible to give a patch to you.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] error when I try to deploy the data model after i set the foreign key

Hi,
I am having a similar issue when saving my Data Model, for which:
- Table A has "A_ID" integer as its PK
- Table B has "A_ID" integer as its FK, linked to A's PK
When saving, the message "FK field 'A_ID' is invalid because it isn't typed as string (nor a string restriction)" shows up.
Is it compulsory for the B's "A_ID" to be a string, although A's "A_ID" is an integer?
Employee

Re: [resolved] error when I try to deploy the data model after i set the foreign key

Hi,
To answer:
Is it compulsory for the B's "A_ID" to be a string, although A's "A_ID" is an integer?

The quick answer is "yes". This is because B's "A_ID" may contain square brackets (this a Talend MDM convention for foreign key values) so even if A's "A_ID" is an integer (this perfectly fine), the B's FK needs to be string to accept values such as "" (otherwise you would have a validation error for the value in B since '' are not a valid characters for integers).
One Star

Re: [resolved] error when I try to deploy the data model after i set the foreign key

Hi fhuaulme,
Thanks for the explanation!
Regards,
Jordi