Check constraint in Data Modeler

Hi
I have a problem with merging two logical models.
in first I have a table with column ranking number(2),
in second model I modify this column:
ranking varchar2(10) default 'A'
and create check constraint ranking_ch:
ranking..... check ('A', 'B',.....)
Then I compare models I have only
alter table....
modify ranking varchar2(10) default 'A'
but I have not constraint ranking_ch.
Why?

Thanks.
Another topic:
I have a problem with reverse engineering with Data Modeler:
1.I have a simple script (*.sql):
create table jw
(a number(2),
b varchar2(30)
2.I use function file/import/ddl file - on Relational diagram is OK:
I have table with two columns.
3. I use function Engineer to Logical Model and I see entity with:
a numeric_0_2_0
b varchar_0_0_30
Modeler creates two new domains.
Why?

Similar Messages

  • NOT NULL Unique Constraint in Data Modeler

    I've created Unique Constraints in the Relational Model and I'm trying to figure out how to make it a NOT NULL constraint.
    Let's say the table name is category with columns cat_id, cat_name, sort.
    In SQL I create "ALTER TABLE category MODIFY (category CONSTRAINT xxx_cat_name_nn NOT NULL);", but inside the modeler there is no data entry points in the [Unique Key Properties - xxx_cat_name_nn] dialog box, that I can find, that lets me tell it that it is a NOT NULL constraint. I'm sure there is a way but I'm just fall over my own feet trying to find it.
    Any help would be greatly appricated.
    Edited by: 991065 on Feb 28, 2013 1:40 PM

    Hi,
    You can make the column NOT NULL by unsetting the "Allow Nulls" property for the Column.
    If you want a named NOT NULL Constraint, you should also set the "Not Null Constraint Name" property (on the Default and Constraint tab of the Column Properties dialog).
    David

  • ODBC error checking in a data model

    At my client we're using PD 16.5.0 build 3982, and we're trying to check in a LDM that was originally generated from a PDM. When we try and check the LDM in to the repository, we get an ODBC error:
    ODBC driver for Oracle
    ORA-12899: value too large for column "PMTEXT"."TDAT" (actual: 2002, maximum: 2000)
    SQLSTATE = NA000
    I have an old (PD 16.1) PDM for the repository, which shows the column as having a length of 30,000, not 2,000. On my own laptop, the 16.5.3 (Sybase SQL Anywhere) repository also shows the column as varchar(30,000). However, the client's 16.5.0 Oracle database shows the column as varchar2(2000).
    Has anyone else had this problem with an Oracle repository?

    Check your settings for MaxBytePerChar  in your ODBC connection details. If you have a  multi byte database this helps to correctly store chars that are represented by more than 1 byte, e.g. the EUR sign in a comment field.

  • Data Modeler 3.0 EA1: Import deferrable column constraints

    Importing from Data dictionary. Table has a deferrable initially deferred column constraints.
    create table didmn( m number check (mod(m,2)=1) deferrable initially deferred
                      , mn number constraint didmn_modmn_chk check (mod(mn,2)=1) deferrable initially deferred
                      , constraint didmn_mnn_chk check (mn/m=3) deferrable initially deferred
                      , check (mn>m) deferrable initially deferred
                    );Column level constraints are NOT DEFERRABLE in DDL Preview. Also after merge to a model they are in physical model not deferrable. As in my earlier foreign key thread Data Modeler 3.0 EA1: Import deferrable foreign key
    Table level constraints are imported deferrable.
    Edited by: Rafu on 19.10.2010 14:34

    Hi Rafu,
    EA2 is available and those DEFERRABLE problems are sorted out there.
    Philip

  • SQL Developer - Data Modeler - Trigger for FK arc constraints

    In the preferences there is an option "Data Modeler > DDL > Create Triggers for FK arc constraints". I think Oracle recomments to use constraints instead of triggers where it is possible. Can anyone from the Development team tell me why here is just the option to create triggers and not also the option to create table level constraints for FK arc constraints? If it is possible I'd like to have this option. My suggetion is to use the following check constraint construction for creation: nvl2(FK_IDx,1,0)+nvl2(FK_IDy,1,0)+...+nvl2(FK_IDz,1,0)=1 or with not only single FK columns: nvl2(FK_IDx1,1,0)+nvl2(FK_IDx2,1,0)+nvl2(FK_IDy,2,0)+...+nvl2(FK_IDz,2,0)=2. Please tell me if that would be possible (and maybe available in next Version) or why it is better to user triggers instead.
    Thanks
    /c

    The Data Modeler forum is at:
    SQL Developer Data Modeler

  • Check constraint generation in physical model in 3.1.1.

    My question: Is it possible to set Use Domain Constraints ticked as default (or another way to get them in DDL) if the Domain with Check constraint is set for the column. I assume it's logical as if I bind a column to the domain then use the domain constraint as default policy. It's not a big deal if you have a few but in my case I do re-modelling just for physical model level and I have tens column in the tables based on a domain. So, I have first to set the domain as a column type and then in another screen tick Use Domain Constraints
    Thank you

    Hi,
    Is it possible to set Use Domain Constraints ticked as default (or another way to get them in DDL) if the Domain with Check constraint is set for the column.No it's not possible I logged bug for that.
    So, I have first to set the domain as a column type How do you set domain as data type? Do you have more than one columns using the same domain? In such cases you can use domain dialog (in the browser) and "Used in" page in order to assign domain to several columns/attributes at once.
    You can use the script below to set use domain constraints on columns that use domain as data type
    Philip
    var model;
    tables = model.getTableSet().toArray();
    for (var t = 0; t<tables.length;t++){
    table = tables[t];
    columns = table.getElements();
    for (var i = 0; i < columns.length; i++) {
         column = columns;
         if(column.getUse() == 0 && column.getDomain()!=null){
              if(!column.getUseDomainConstraints()){
                   column.setUseDomainConstraints(true);
                   table.setDirty(true);

  • SQL Data Modeler adds blank line to UK Constraints

    Oracle SQL Developer Data Modeler Version: 2.0.0 Build: 584
    I'm migrating my schema designs from Oracle Designer to SQL Developer Data Modeler. When I get to the point of generating SQL files I consistently get an extra blank line added to every unique constraint. My primary key constraints are defined the same way, but they do not have the blank line. See below for an example of the SQL output:
    ALTER TABLE ALIAS
    ADD CONSTRAINT ALIAS_PK PRIMARY KEY ( ALIAS_NO )
    USING INDEX TABLESPACE INDEX1
    NOLOGGING
    NOSORT
    ALTER TABLE ALIAS
    ADD CONSTRAINT ALIAS_UK UNIQUE ( ALIAS_NAME )
    USING INDEX TABLESPACE INDEX1
    NOLOGGING
    NOSORT
    This blank line causes errors when I execute the SQL script so I have to edit it before using. Did I forget to something or is this a bug?
    Thanks,
    Gail Binkley
    Stanford University

    Hi Gail,
    thanks for feedback. I logged bug for that.
    Philip

  • To create referential constraints or not while designing a data model...

    Hi,
    If I were to design a data model involving some tables which tend to grow fast and huge, which option w.r.t creating referential constraints (foreign key constraints) between tables is advisable - to create or not to create?
    Assuming that there are no specific requirements to implement referential integrity (though it maybe implicity stated). I know that creating referential constraints might maintain data integrity but on the other hand, it might be a bottleneck in some data-intensive queries/operations involving huge tables.
    In other words, what factors should we consider while deciding on to create referential constraints or not in a data model?
    thanks & regds,
    Ashok.

    Hi,
    >>it might be a bottleneck in some data-intensive queries/operations involving huge tables.
    Hummm, are you sure ? I'm not convinced that foreign key constraints can cause a bottlenecks while querying the database. Why ? Otherwise, DML statements can be affected by some constraints and indexes ... in some systems for example perform data loading in a Data Warehouse, DSS Systems, etc....
    "The key thing to remember here is that if you cannot guarantee the integrity of your data, it doesn't matter how fast you can retrieve it from the database"
    Cheers

  • Data Modeler 2.1 EA1  FK Constraints

    Hi,
    I don't know what functionality you have planed but, when I drag and drop the Master + Detail Table at the same time to the modeler window I see visually my FK Constraints. When I drag it one after the other I dont.
    Most of the time I'm working on existing models. I would need the Model-Viewer to drag one table to the modeler window and have the opportunity to import all dependend tables and see all the FKs. Otherwise I wouldn't work with it but still work with JDeveloper.
    Regards,
    Juergen

    Hi Philip,
    Yes I'm talking about the viewer in 2.1 EA1
    To be honest, I like the way Apex is doing it in the Object Browser / Model. You click on any table and it shows the first level dependency around it, you click on the dependend table and you get the first level dependencies of this table and so on.
    So first level dependencies would be enough but I would like to have the opportunity to import a single table and tell Data Modeler import all first level dependency tables, then I want to click to a imported table and say, import all first level dependencies of this table, and so on..., just like Apex.
    So first level would be a deal... :)
    Juergen

  • SQL*Modeler forgets check constraint names

    SQL*Modeler Version 2.0.0. Build 584
    If I create named check constraints under the Relational Model/Tables/Table level Constraints then generate the model I have the constraints correctly named. Exit the model and reload, the constraints appear to be correct but when I look at the physical model under tables/table check constraints I see generated names such as TCC4, TCC5 etc.
    At this point I can change the name but this is not stored it is just thown away.
    If I go back to Relational Model/Tables/Table level Constraints and simply Apply no changes then the constraint names appear correctly in the generated model. However, I have many tables and this is not a practial solution each time I generate the model.

    Hi Ian,
    thanks for feedback. Fix will be available in next release.
    Philip

  • Data Modeler : Modifying the Table Report layout

    Hi ,
    I'm using SQL Data Modeler (DM) 4.0 EA .
    I used the File -> reports option to generate the reports on Table and in the report
    1) I couldn't see the column data type ? (Refer below table ) , Is there any options to bring on the Data Type in the Report ?
    No
    Column Name
    PK
    FK
    M
    Data Type
    DT
    kind
    Domain Name
    Formula
    (Default Value)
    Security
    Abbreviation
    1
    ID1
    P
    Y
    (10)
    LT
      2
    ID2
    F
    Y
    (10)
    LT
    3
    ID3
    Y
    (1)
    LT
    4
    ID4
    Y
    (10)
    LT
    5
    ID5
    F
    (20,4)
    LT
    2) In options to manage the Table report (Reports -> Manage). Currently I can only remove a heading (like Descriptions Notes ,columns,column comments.). Is there is any way to customize the report in such a way that I can remove some columns (mostly the empty ones) from the report and add the column comments along with the column table than a new column comments table.
    Please let me know  ,is there is an option to customize the report .
    Note: I even tried generating the report using the search then report , but it doesn't give a complete report (i was only able to generate a report on column or table name or constraints , not all together.)
    Thanks,
    Srinivasan.K

    Thanks for the immediate reply.
    I checked on the DM again, the report comes good for the one which has the data type . But now all my data type changed to UNKNOWN and lokks like ,due to this my table report is coming without the "Data Type".
    Can you please help me in fixing this unknown data type issue ?
    Table report for the ones with proper Data type:
    Columns
    No
    Column Name
    PK
    FK
    M
    Data Type
    DT
    kind
    Domain Name
    Formula
    (Default Value)
    Security
    Abbreviation
    1
    ID1
    Y
    NUMERIC (10)
    LT
    2
    SCRIPT
    Y
    VARCHAR (1024)
    LT
    3
    UPGRADE_S
    Y
    VARCHAR (10)
    LT
    4
    UPGRADE_D
    Y
    VARCHAR (250)
    LT
    5
    UPGRADING_F
    Y
    VARCHAR (20)
    LT
    6
    TIMESTAMP2
    Y
    Timestamp
    LT

  • How to add an index to a materialized view in Data Modeler 3.3

    Hello everyone,
    I'm looking for a how-to to add an index to a materialized view in Data Modeler 3.3.0.747, as I coudn't find a way to do it so far.
    I looked here:
    Relational Model
    Physical Model
    Oracle 11g
    Materialized Views
    "my_mv_name"
    "INDEXES" IS NOT HERE IN THE TREE
    "Tables" does not include it either
    Thank you & Best regards,
    Blama

    Hi David,
    thanks a lot. I did so and it worked, but I found a minor bug while doing so:
    I marked the table as "Implement as Materialized View" and went to File->Export->DDL (for Oracle 11g).
    The generated code (I checked all options in "Drop Selection") includes a row:
    DROP MATERIALIZED VIEW mv_mymatview CASCADE CONSTRAINTS ;
    which produces a syntax error.
    Best regards,
    Blama

  • SQL Data Modeler bugs (or only misused?)

    Hi,
    I think I ran into some modeler bugs and missing features ...
    BTW: is there a place where all the known bugs are listed?
    * although "no action" was selected in "General Options - Model - Relational" for foreign keys all the foreign keys are created with
    "not deferrable" (well, why not, if it makes the modeler happy) and
    "on delete set null" (thats not what I'd call "no action")
    * DDL statements for indexes lack the schema name
    * newly generated foreign relations are not always displayed in the relational model
    * DDL preview for syncing physical model with relational does not (always) work (well - so far it worked once)
    steps taken: File - Import - Data dictionary, selected objects for import, correct target model chosen, "swap target model" checked
    * foreign keys in unique constraints are always set to "not null" (in logical and physical model)
    * no trigger/constraint created for ARCs (I am not sure about this, but IIRC I did not see anything making an ARC really work)
    Or do ARCs simply not work yet?
    * modeler hangs sometimes (e.g. when opening "Save as" dialog etc.)
    * dialogs are opened outside visible pane when the position of monitors is changed (the dialogs seem to remember their last position)
    * sequences (physical model withing relational model) are loosing their user
    * missing multi schema capabilities :-(
    * the layout capabilities - pardon my french - suck
    Especially that the boxes and lines seem to wander around from one usage to the next (entities aligned with grid - next start the entities are no longer aligned).
    And if you ever need to save/export the model somewhere else all the references stick to a single connection point.
    Not to mention a simple move of a box ...
    Thank you for your effort
    Peter
    Edited by: stueckl on Sep 3, 2009 9:41 PM

    Hi Philip,
    sorry for not answering quite a time ...
    Just some prerequisites ;-) ...
    - Target database: Oracle 10g R2 (10.2.0.4)
    - Modeler version 2.0.0 build 570
    - model creation method: logical model, relational model, (physical model), Database objects
    - OS WindowsXP German, SP3
    - JDK Sun Java 1.6, build 1.6.0_16-b01
    * nullable FK column in unique keys
    meanwhile I found out, how to achieve that - but IMHO the steps to take are quite cumbersome
    1) make a FK relation with "target optional" checked on the Cardinality page of the FK properties
    2) open entity properties, check attributes of FK column (it says: nulls allowed - the checkbox cannot be changed)
    3) got to unique identifiers page and add a unique identifier
    4) open the unique identifier property dialog and add the foreign key
    5) close both property dialogs
    6) reopen the entity property dialog, check attributes of FK column (it says: no nulls allowed - the checkbox cannot be changed)
    7) check the FK properties: it still says: target optional (it is checked)
    8) check the graphical representation of the FK key: dashed line at target entity (meaning: optional)
    9) create the relational model: the FK column is created with "not null"
    10) go back to logical model
    11) change FK property to: target mandatory (uncheck "target optional")
    12) create relational model
    13) change FK property to: target optional (check "target optional")
    14) create relational model
    15) SUCCESS! the foreign key column is now nullable
    BUT: you never ever must change ANY of the entities properties or you must redo steps 11 to 15
    * "no action" of FKs
    I will look into that. Thanks for the suggestions.
    * DDL statements for indexes
    Sorry for being imprecise ... I was talking about automatically generated indexes (for unique and foreign keys).
    Those don't show up in the index listing of the tables in the physical model (probably, because they are automated).
    But why do I have to set the default schema for indexes again? The tables get the schema information for the default schema (General Options - Model - Physical) but not the indexes :-(.
    Generated DDL snippet:
    CREATE TABLE ZCBC1ST1.ZCBRAGIT_AGENDAITEM ( ...
    CREATE UNIQUE INDEX ZCBSAgIt_U1X ON ZCBC1ST1.ZCBRAGIT_AGENDAITEM ( ...
    Same for FK indexes. And the unique index property page in the physical table section does not let me specify a schema owner (OK for me, because the unique key is created by an "alter table" statement).
    * ARC trigger
    My bad - I only checked "DDL preview" of the table, which doesn't show the ARC trigger. The complete generation does. Sorry.
    * "missing multi schema capabilities" and "sequences loose owner"
    Please excuse a newbie blush.
    I just found out I can change the table owner using the physical model capabilities (I guessed I used way too long PowerDesigner V6 ;-) ).
    BUT ...
    The newly created user does not "survive" a "save all - close all - open" sequence on "Physical Models" ... only closing the app or saving the Oracle10g physical model makes the user persistent.
    And also ... if the new table or sequence owner is the first in the drop down list on the property dialog, the user is replaced by an automatically created new user (e.g. User4, User5, and so on).
    Example:
    * I have three defined users and the standard "MDSys" and "Public".
    * My three users are named ZCBC1ST1, ZCBCCore and ZCBCDial (those names are because i need to follow naming rules).
    * ZCBC1ST1 is my default physical model user, which was set in "General Options"
    * ZCBC1ST1 is the first in each drop down list.
    * I have some sequences named Seq1, Seq2, Seq3 and Seq4
    * Seq1 was given to ZCBC1ST1, Seq2 to MDSys, Seq3 to ZCBCCore and Seq4 to ZCBCDial
    * saved and closed the Oracle10g physical model and reopened it
    * Seq1 now has User4, but the other have still the users they were attached to
    The same applies to tables - I am unable to give a table to the first entry of the user list.
    Solution I found to this problem ...
    1) remove the default physical user in "General Options" (and never ever set it again)
    2) create a explicit user (with the name of the prior default user)
    3) manually reattach all objects to this user sigh
    4) so far not a problem with automatically generated indexes, because they don't use the default user anyway
    * newly generated FKs not shown in relational model
    I had this odd behaviour several times.
    1) Logical model: adding a new FK relation
    2) giving the reference-column a pretty relational name
    3) generating the relational model
    4) rather often the new column shows up in the relational model but the arrow for the new foreign key does not.
    5) only after i open the properties dialog of the missing foreign key the arrow is shown in the model
    6) happens often to sub-models - less often to the top-model
    * model syncing (Oracle10g with modeler)
    As Ms. Harper stated in one of her posts (and she even made a video tutorial IIRC) it should be possible to sync a Modeler model with the Oracle10g contents.
    AFAIR the tutorial showed only how to sync the model with the contents but not vice versa.
    I tried to achieve this checking the "swap target model" check box (that's the important thingy) of the import dialog. Everything worked fine besides there is only a preview of DDL statements available but no "Merge" or "Create DDL Statement". And exactly that preview doesn't seem to work anymore. No matter what objects I select, I am unable to see any DDL statements to upgrade the Database.
    I don't know why, but it worked again just before. I will keep an eye on this. ;-)
    So much for now ...
    Thank you for your effort
    Peter
    Edited by: stueckl on Sep 9, 2009 1:03 PM

  • Does SQL Developer Data Modeler fit-in??

    Hi Everyone,
    Wish you happy new year 2011.
    Does SQL Developer Data Modeler support conceptual, logical and physical in our modeling or only logical and physical?
    We all use Erwin for modeling. Erwin works without database repository storing models in desktop folders and provide additional reporting. I find some place SQL Developer Data Modeler talked about repository need.
    Does SQL Developer Data Modeler store the models in local/network folders instead of Database server?
    What are the functions need database based repository to work with SQL Developer Data Modeler?
    We are thinking of using SQL Developer Data Modeler for our conceptual, Logical, and data dictionary need. Will it help in our need?
    Do we need to face any surprises on using SQL Developer Data Modeler for our need?
    Thanks in sharing your experience and helping me out.
    RI

    1) Do we need to have Oracle database at back end to work with SQL Developer Data Modeler?No, Data Modeler use Oracle database only if you create reporting repository.
    Data Modeler is free, you need database license only if you want to log service request
    2) Will SQL Developer Data Modeler create any tables (as backend repository ) in Oracle database to store Model details? no
    3) Do we need to create reporting schema in backend oracle database to generate reports of SQL Developer Data Modeler's items such as Entity/attributes etc?no, reports can be created out of current loaded design. However having reporting repository will give you additional benefits - history (reports can be generated for every snapshot of your designs there) and multi-user usage, you can create your own reports
    4) Do we to use SQL Developer Data Modeler reverse engineer from DB2, SqlServer, Terra data etc?Data Modeler has full support for Oracle, DB2/390, DB2/UDB(LUW) and MS SQL Server. Reverse engineering from other databases (including Terra Data) is at generic JDBC level - you'll get some and some will be missing (no check constraints for example).
    You can read release notes http://www.oracle.com/technetwork/developer-tools/datamodeler/ea2-releasenotes-185793.html
    Philip

  • Sql Developer Data Modeler 3.0 EA1: Custom transformation script

    What is the object model used by:
    Tools -> Design Rules -> Transformations
    From looking at the examples (and guessing) I have managed to create ID attributes on all my entities, but how do I set its sequence number or set it as the primary key?
    entities = model.getEntitySet().toArray();
    for (var e = 0; e<entities.length; e++)
    entity = entities[e];
    att = entity.createAttribute();
    att.setName('ID');
    - Marc de Oliveira

    content of XML files:
    1) class described, parent class if there is one
    2)<property .../>
    describes property - set and get method, data type of property, default value
    3) <collection ... />
    describes collection of objects belonging to class - 5 collections are defined in Table.xml - columns, indexes, table check constraints, column groups and spatial definitions
    - get method - to get collection
    - create item method - method of described class used to create item for that collection; so for columns collection table.createColumn() will create column in table
    - other methods - add, move, remove if are defined
    4)other meta data
    definitions in 1) .. 4) are used by Oracle SQL Developer Data Modeler, so it'll be wrong to modify those xml files
    5)<roproperty ../>
    Data Modeler doesn't parse/process these definitions, we decided to not filter them out however you should not rely that much on them
    6)some junk left
    For each object you can set your own properties and they will be persisted (also included in compare/merge in versioning) together with other information for object - look at "template table" example in transformation scripts. Here are methods you can use:
    void setProperty(String key, String value);
         String getProperty(String key);
         boolean hasProperty(String key);
         boolean hasProperty(String key, String value);
         void removeProperty(String key);
         void clearProperties();
         Iterator getPropertyNames();
    Philip

Maybe you are looking for