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);

Similar Messages

  • 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

  • Creating a check constraint with a join

    Hi,
    is it possible to create a check constraint under the data models using a join on lookup table?
    I would like to filter out tuples in the target table involving conditions from an another table.
    Regards

    Numbers has checkable boxes but they don't work once exported to PDF.
    And there is iBooks Author as well which can create ePubs.
    If it is just for yourself on your Mac I highly recommend Qu-s.
    Peter

  • 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?

  • Security, Consistency Check, Physical Model

    Hi experts,
    just THREE questions:
    1- the following object-level security configurations: "Assign users to a web catalog group" and "Create a Web catalog group" could be done in the BI Administration Tool?
    2- a consistency check can be performed over a selection of multiple dimension hierarchies?
    3- is it possible modify the physical model of a repository for add a derived metric column, and define this column as a value like "dollar divided by units"?
    I think it's possible only through database manipulation and not Administration Tool. Is it right???
    Thanks a lot.
    Huge

    Huge10 wrote:
    Hi experts,
    just THREE questions:
    1- the following object-level security configurations: "Assign users to a web catalog group" and "Create a Web catalog group" could be done in the BI Administration Tool?No
    2- a consistency check can be performed over a selection of multiple dimension hierarchies? Yes.
    >
    3- is it possible modify the physical model of a repository for add a derived metric column, and define this column as a value like "dollar divided by units"?
    I think it's possible only through database manipulation and not Administration Tool. Is it right???
    You can do it in BMM layer ..as a logical column without manipulating DB.

  • Check constraint from domain missing after generation

    Hi,
    I've got the following problem with designer 10g. When I create a column and specify a specific domain, then generate the scripts for 10g (or 8i,9,...) the check constraints that is specified in the domain goes missing. The strange part is that we have about 50 domains and 49 of them work perfect but one of them just doesn't want to be generated. I've been comparing the domain to the others but I don't see any major differences that would cause the problem. Anyone know what could cause the problem or where I should (I think it is somewhere in the design & generate part) ?
    Help would be greatly appreciated.
    Grtz
    Message was edited by:
    Yves C

    Kent,
    in the DM v3.3.0.747 I have defined domains using value lists that lets you specify data values for the domain instead of define a check constraint, example Domain Name: "YesNo" and Value List -> "Y", "N".
    After adding a new column and set with the domain created, I force to apply the standard names to table with the button "Naming Rules", and the constraint created is correctly named . Notice that I need to force to apply the standard names because by default these constraints are created without name.
    Now I checked create a domain with check constraint definition for 11g (instead of using a list of values) and the behavior was the same.
    I recently upgraded to version 4.0EA2 and it works in the same way for both, so see if forcing to apply the "naming rules" solves your issue.
    Regards.
    Ariel.

  • Data Modeler bug? - it keeps reporting missing physical model files

    Hi,
    I'm having a rather serious problem with the latest data modeler, Oracle SQL Developer Data Modeler 3.1.4.710. It keeps losing physical model files for some reason.
    I started to notice that it was not generating all the tables in my small design. After hours of struggle I found multiple error messages in the log file:
    2012-12-18 10:51:20,126 [Thread-71] ERROR XMLTransformationManager - Unable to load object from XML: C:\cygwin\home\Brian\codebase\models\data\Design\rel\395D160B-C7224B8EAD05\phys\D9582E4E-2ED963CB9D32\View\seg_0\A555DB9B-8864-9C0B-DCA8-BAC5231F55C6.xml
    java.io.FileNotFoundException: C:\cygwin\home\Brian\codebase\models\data\Design\rel\395D160B-C7224B8EAD05\phys\D9582E4E-2ED963CB9D32\View\seg_0\A555DB9B-8864-9C0B-DCA8-BAC5231F55C6.xml (The system cannot find the path specified)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(FileInputStream.java:138)
         at oracle.dbtools.crest.model.metadata.XMLToObjectTransformer.transformToObject(Unknown Source)
         at oracle.dbtools.crest.model.metadata.XMLToObjectTransformer.transformToObject(Unknown Source)
         at oracle.dbtools.crest.model.metadata.XMLTransformationManager.transformFromXMLToObject(Unknown Source)
         at oracle.dbtools.crest.model.metadata.XMLTransformationManager.openPhysicalModel(Unknown Source)
         at oracle.dbtools.crest.model.metadata.XMLTransformationManager.openPhysicalModel(Unknown Source)
         at oracle.dbtools.crest.swingui.browser.BrowserPanel$88.run(Unknown Source)
    These messages appeared every time I opened my physical model (Oracle 10g).
    After deleting and recreating the physical model the problem went away for a while. But after closing and reopening the design I started to see the errors again.
    Has anyone seen something similar?
    Regards,
    Brian

    Thanks Philip!
    The workaround does the trick for the tables, primary keys and unique keys.
    I have just observed that table level constraints show a slightly different behaviour.
    Names show up like TCC5, TCC6, etc.
    Seems the same problem as previously in SQL*Modeler forgets check constraint names
    Is there a workaround for that problem too ?
    I already noticed that there is no parameter NameChanged for a table constraint.
    Enrico

  • Arc is not implemented for SQL Server 2005 physical model

    I added the Arc in my relational model, which is supposed to provide that references are mutually exclusive (so only one refering column can be not null). However there is not any implementation for this in the SQL Server 2005 physical model. The SQL code generated simply ignores the Arc and allows any values for the columns covered by Arc. If we check Oracle physical model. then it generates some trigger, which controls how many columns have values assigned - this is actually an implementation of Arc. But there is nothing of this kind for SQL Server model...
    By the way, implementing this Arc by trigger looks like to heavy approach. The very simple table level check constraint will do the same job. But this is a different subject though.
    Edited by: Otbl on Nov 3, 2011 7:34 PM

    Hi Dmitry,
    it's fixed in Data Modeler 3.1 EA2.
    Philip

  • How to implement more than one physical models from the same model

    Hello,
    We have designed a relational model for our application and now, we would like to implement it for our 4 environments: Development, Test, User-Test and Real. Each one has the same logical schema but, different physical clauses (i.e.: in development environment we will not use partitioning clauses).
    Is this possible?
    Thank you,
    Bernat Fabregat

    Hello Bernat,
    yes it's possible:
    1) open your design and go to Tools>"RDBMS site administration"
    2) add your sites there (Current design) - Development, Test, User-Test and Real; press ok when finish
    3) go to "Physical models" node in browser and use "new" from pop-up menu - your sites will appear in list
    4) after you set physical objects in one model (need to save it as well)l, you can clone those objects in other models - you can clone from lower or the same database version
    You can consider usage of "name substitution" functionality during DDL generation if objects should have different name (prefix) in different environment - in this there will be no need to change the name of objects in models.
    Philip

  • How convert spaces in logical model to underscores in physical model

    Hi,
    in Oracle Designer we used spaces in logical model objects (entities, attributes, relations) which were automatically converted to underscores when the physical model was generated from the logical one. Is there any way how do this conversion in Data Modeler? So far I have been able to convert mixed case in logical model to uppercase in physical model (with the exception of foreign keys) but changing space to underscores still eludes me.
    Why I think this is important: the logical model should use "normal" language if possible, i.e. spaces, mixed case etc. But the physical model should have uppercase only and definitely no spaces. Having objects in Oracle defined with spaces leads to many difficulties since any reference to the object must use "" around the name of the object...
    Thanks
    Jakub

    Hi,
    but the problems continues (even when the model is reduced to no entities at all!)
    The error you reported (in engineering and import) cannot be reached if there are no entities and attributes - it's a specific error probably related to usage of distinct types that are removed from design.
    You can use search functionality in order to find attributes/columns (logical/relational model) with incorrect data type definition based on distinct type.
    And it's better to move to Data Modeler 4.0 (833).
    So what to search (example is on logical model - it's the same for relational model - column):
    1) Activate search window (CTRL-F when logical diagram is active, or Find icon), switch to advanced mode
    2) for "Object type" Attribute:
    - check "Data Type kind" line and put DT as search text
    - check "Distinct type" line, don't put search text - it'll search for attributes without distinct type
    - change the operand for expression from OR to AND
    3) press "Find" button
    If you find some attributes, then you need to decide what to do with them - to set data type or to delete them.
    The same for columns in relational model.
    Philip

  • Logical and Physical Models

    Hi All,
    I'm new to Designer. I need to produce a logical data model in Oracle Designer 10g. I have created a few tables in the RON and have used Design Editor to add these to a Server Model. I think this is giving me the physical model rather than the logical model.
    Can you please tell me if I'm going about this the wrong way ? I need the logical model to confirm with the non-technical people before I produce the physical model for the techies.
    Thanks

    Billy wrote:
    Hi,
    John - yes I have already checked all this, all looks ok. Also, I'm only using the REPOS_MANAGER account for now so permissions should not be an issue.
    Mark - when you say create an entity in the RON, I can create tables, how would I create an entity in the RON ? I can go to Diagrams in the RON and see my ERD.
    When I installed the repository I do remember having to go to the SYS account to grant an execute on a package to the REPOS_MANAGER user because one of the REPOS_MANAGER packages required it.
    Any direction would be appreciated ?
    Thanks
    BillyAh, but that IS the issue. You shouldn't use the repository owner account for your day to day work. Create another Oracle user and grant it privileges through the RAU. Then connect as that user to work in Designer. Oddly enough, the repository owner doesn't have the privileges that it needs - the privileges are stored in the repository, not database privileges.

  • Data modeler saving Physical model changes not saved

    I am using version 2.0.0.584.
    The bug fix list contains: 8722310: Save does not save physical model changes
    Hovever I still see unexpected behaviour.
    I created a physical model for "Oracle database 10g" and allocated a couple of tables to a different tablespace.
    I saved the physical model via Physical model--> right mouse button --> save all.
    I saved the model with File--> save
    I close the model.
    After opening, the physical model is not available anymore.
    After Physical model--> right mouse button --> open (for Oracle 10g) the contents are not the same anymore.
    Tablespaces with name "TableSpace3" and "TableSpace4" are added and objects belong to this tablespace.
    We do not have currently a workaround for this behaviour.
    Can anyone help?
    Thanks
    Edited by: 793016 on 06-Sep-2010 03:10
    Edited by: 793016 on Sep 6, 2010 12:14 PM

    Hi Philip,
    default tablespaces were defined and I removed this. It did not have a positive effect.
    Checking the log files was a good idea.
    The log file contained errors about files which could not be found on the system.
    I will do some additional tests and let you know.
    Thanks.
    Kind regards,
    Maurice

  • SQL Dev Data Modeller:  Auto-generate Surrogate PKs in the Physical Model ?

    How can I have the logical modeller allow the user to design with logical PKs, but then have surrogate primary keys be auto-generated off sequences by the modeller when it comes to create the physical model - as in conventional application design?
    Without this facility, this tool is useless, IMO.
    I want:
    i). sequences to become the physical PKs by default, and that what were the logical PKs in the logical model, to become a unique key in the physical model.
    ii). I want this set by default when generating the physical model....
    iii). ....with an option to turn this off on a entity-by-entity basis (as not all tables will necessarily require such a surrogate PK; so the logical PK may remain the physical PK).

    It is common practice that physical PKs in Oracle tables are defined from sequences (surrogate PKs), and that the logical PK from the entity becomes a unique key in the table.
    This may not always be the case in every application out there, and some people may disagree, but it is nonetheless a needed feature.
    My new Feature Request is therefore:
    I would like to see the following additions to the product.
    1. In the Preferences -> Data Modeler -> Model -> Logical, a flag that by default indicates whether the designer wishes to opt to enable this feature (ie; have all logical PKs converted to unique keys, and replaced by sequence nos. in the physical model). This flags needs to be there since in real life, albeit erroneously IMO, some people will choose not to opt to use this functionality.
    2. On every entity created in the model, there needs to be a flag that allows to override this default option, as not every table will require a surrogate PK to be generated. Being able to (re)set a flag located on the entity properties (perhaps under 'Engineer To'), will accomplish this.
    3. When Forward Engineering to the physical model from the logical, the following should happen.
    ENTITY  1 ---------->TABLE 1
    ---------------------> P * Surrogate PK
    * Attribute 1 -----> U * Column 1
    * Attribute 2 -----> U * Column 2
    o Attribute 3 ----------> Column 3
    Here you can see,
    - Attributes 1 & 2 (the logical PK) of the entity become a unique key in the table (columns 1 & 2),
    - optional Attribute 3 becomes NULLable column 3,
    - and a physical surrogate PK column is added (type unbounded INTEGER, PRIMARY KEY constraint added).
    From entity DEPT as:   (Examples based on SCOTT schema)
    DEPTNO NUMBER(2) NOT NULL <-- Logical primary key on entity
    DNAME VARCHAR2(14)
    LOC VARCHAR2(13)
    CREATE TABLE DEPT
    (PK_DEPT INTEGER, -- New column becomes surrogate physical PK, driven from sequence defined later
    DEPTNO NUMBER(2) NOT NULL, -- Former logical PK becomes a UK
    DNAME VARCHAR2(14),
    LOC VARCHAR2(13))
    ALTER TABLE DEPT
    ADD CONSTRAINT PK_DEPT PRIMARY KEY (PK_DEPT) USING INDEX PCTFREE 0
    ALTER TABLE DEPT
    ADD CONSTRAINT UKLPK_DEPTNO UNIQUE (DEPTNO) USING INDEX PCTFREE 0 -- Former logical PK becomes a UK (constraint name reflects this)
    CREATE SEQUENCE PK_DEPT_SEQ
    CREATE TRIGGER PK_DEPT_SEQ_TRG
    BEFORE INSERT ON DEPT
    FOR EACH ROW
    WHEN (new.PK_DEPT IS NULL)
    BEGIN
    SELECT PK_DEPT_SEQ.NEXTVAL
    INTO :new.PK_DEPT
    FROM DUAL;
    -- Or from 11g onwards, simply,
    :new.PK_DEPT := PK_DEPT_SEQ.NEXTVAL;
    END;
    From entity EMP as:
    EMPNO NUMBER(4) NOT NULL -- Logical primary key on entity
    ENAME VARCHAR2(10)
    JOB VARCHAR2(9)
    MGR NUMBER(4)
    HIREDATE DATE
    SAL NUMBER(7,2)
    COMM NUMBER(7,2)
    DEPTNO NUMBER(2)
    CREATE TABLE EMP
    (PK_EMP INTEGER, -- New column becomes surrogate physical PK, driven from sequence defined later
    FK_DEPT INTEGER, -- New FK to surrogate PK in DEPT table (maybe NOT NULL depending on relationship with parent)
    EMPNO NUMBER(4) NOT NULL, -- Former logical PK becomes a UK
    ENAME VARCHAR2(10),
    JOB VARCHAR2(9),
    MGR NUMBER(4),
    HIREDATE DATE,
    SAL NUMBER(7,2),
    COMM NUMBER(7,2),
    DEPTNO NUMBER(2))
    ALTER TABLE EMP
    ADD CONSTRAINT PK_EMP PRIMARY KEY (PK_EMP) USING INDEX PCTFREE 0
    ALTER TABLE EMP
    ADD CONSTRAINT FK_DEPT FOREIGN KEY (FK_DEPT) REFERENCES DEPT (PK_DEPT)
    ALTER TABLE EMP
    ADD CONSTRAINT UKLPK_EMPNO UNIQUE (EMPNO) USING INDEX PCTFREE 0 -- Former logical PK becomes a UK (constraint name reflects this)
    CREATE SEQUENCE PK_EMP_SEQ
    CREATE TRIGGER PK_EMP_SEQ_TRG
    BEFORE INSERT ON EMP
    FOR EACH ROW
    WHEN (new.PK_EMP IS NULL)
    BEGIN
    SELECT PK_EMP_SEQ.NEXTVAL
    INTO :new.PK_EMP
    FROM DUAL;
    -- Or from 11g onwards, simply,
    :new.PK_EMP := PK_EMP_SEQ.NEXTVAL;
    END;
    [NOTE:   I use PCTFREE 0 to define the index attributes for the primary & unique keys since the assumption is that they will in general not get updated, thereby allowing for the denser packing of entries in the indexes and the (albeit minor) advantages that go with it.
    This is certainly always true of a sequence-driven primary key (as it is by its very nature immutable), but if the unique key is likely to be frequently updated, then this PCTFREE option could be user-configurable on a per table basis (perhaps under Table Properties -> unique Constraints).
    For non-sequence-driven primary keys, this storage option could also appear under Table Properties -> Primary Key.
    I notice no storage options exist in general for objects, so you may like to consider adding this functionality overall].
    Associated Issues :
    - Preferences, 'Naming Standard: Templates' should be updated to allow for the unique key/constraint to be called something different, thus highlighting that it comes from the logical PK. I've used 'UKLPK' in this example.
    - Mark the physical PK as being generated from a sequence; perhaps a flag under Table Properties -> Primary Key.
    - When Forward Engineering, if an entity exists without a logical PK, the forward engineering process should halt with a fatal error.
    !!! MODERATOR PLEASE DELETE ME !!!

  • Physical Model Data Type Issue

    Hi,
    I have created ware house tables using E-business suite tables for general ledger model and exported into physical model. I could see all my keys/IDs which were numbers have been converted into decimal.
    Ex: journal_id in my oracle table is number (ex:1234). But when I exported into OBIEE and used view data option. All the IDs(data type number) data is showing as decimal format (1234.00).
    Ex: If I want to see data for check number in answers, then it is showing as 112456.00 instead of 112456.
    Please anyone had this kind of issue. how to resolve?
    Is there any default setting which is causing this problem.how to find?
    OBIEE version : 10.1.3.2
    Appreciate your help.

    Hi Sandeep,
    When I opened the rpd in offline mode, it is saying the repository can only be opened as Read-Only. I clicked Yes for this and entered admin user name and password. But in Physical model, when I right clicked any table, I couldnt see find any place to modify. I tried with properties also. I am not able change data type as it read-only. How to do it in offline?
    FYI,
    I opened rpd when OC4J was stopped. Aslo I opened when OC4J is running. But both times I am not able to change datat type.
    Thanks!!

  • Check Constraint names aren't synced when engineering to logical

    Just learned about this tool at OOW and ran into an issue involving check constraint names being compared but not synced when engineering from the relational model to the logical model. When I set the constraint names in the logical model (and perform one last "Engineer to Logical Model") after that the compare dialog shows the table and entities match. Is this a bug?
    Steps to reproduce:
    1. importing a relational data model from data dictionary which contains a table with a column level check constraint
    2. perform "Engineer to Logical model" to produce the logical model
    Issue:
    Perform another "Engineer to Logical model" which will show the table with the column level check constraint as being out of sync with the logical model's equivalent entity, when you drill down into the diff in the compare dialog box you see the check constraint name has a value in the relational model and the name is null in the logical model
    Verify:
    Looking in logical model at the constraint (<Entity>/Attributes/Attribute Properties/Default and Constraint/Constraint Name) the value is empty
    Work Around:
    Set the constraint name in the spot from verify above and perform "Engineer to Logical model" twice. The first time it will show the same issue, the second time it will show the table and entity match

    Hi Bo,
    thanks for feedback. It's fixed now and you'll get the fix in version 3.0.
    Another( probably better workaround) - in engineering dialog - "Compare/Copy options" tab - uncheck "Don't use for new objects" option.
    Philip

Maybe you are looking for