I agree to Idea Toad Changes Data Types in a Foregin Key relationships
Voting Disabled

3 votes

I disagree to Idea Toad Changes Data Types in a Foregin Key relationships



This idea is active.
Modeling »

Toad Changes Data Types in a Foregin Key relationships

Toad Data Modler changes the Child table's Data Type to match to the Parent Table's data types in a foregin key relationship. For example if pat_id is varchar2(12) in a table finsum.patient and a child table has pat_id as varchar2(18), in order for the relationship to be created the child table's column changes to 12 in length. This is great for an ideal situation. But we have tables that are coming from internal/external sources that have different data lengths than the tables that we already have in system. We want to keep the source data types "as is" so they match to source system. But at the same time on our models we would like to have an exception on the relationships. It would be nice if Toad doesn't change the data types in foregin key relationships where data types between Parent and Child don't match. We are hoping this feature to be added on the next release.

We have opened a service Request (SR# 2111152) in this regard.


Submitted by 1 year ago

Comments (1)

  1. Moderator

    I don't think you can ensure good data integrity when record in child table can have more chars then record in parent table. Allowing this to be modeled seems to be dangerous. Let's say I have two parent tables and one child and both the parents are mapped to the same column in child table. Image what would happen if all the data types were different and how the application should work in case you change data type in one of the parents. There are other consequences that would result into worse performance etc. I can suggest several workarounds: ideally, if possible, make all the data types equal. If that is not possible for some reason, draw a line between the tables (just a line, instead of relationship line) and write the SQL for your constraints to After Script section on your Entity Properties form or on Model Properties form.

    1 year ago
    0 Agreed
    0 Disagreed

Vote Activity Show


  1. The idea was posted
    1 year ago