Concept Question : Migrate SQL Models

Hi Oracle SQL Data Modeler users.
I have a question. How, if it at all, do you migrate a Database from Version 1 of the model to version 2?
e.g. I've created the tutorial for a library. (Patrons; transactions; books).
Now I've generated the DDL and imported it into Oracle (or any other database).
Now I wish to change the model by adding an ISBN number and changing the domain of Person Name to 50 characters instead of 25.
All of this is fine. But Oracle generates new DDL for complete new tables.
How do I migrate the current data model from Version 1 to Version 2? Is this possible? How do other users manage this problem?
i.e. if the solution is with DDL, I'm looking for alter table statements rather than create table statements
Thanks
Martin
Edited by: mac24nz on Apr 11, 2011 3:07 AM

Hi Martin,
I suggest you look at these messages in the forum:
Generate DDL - change is a new column and I want to generate a alter table
Create 'alter tables ...' etc from Data Modeller
David

Similar Messages

  • SQL modeler can not import from data dictionary

    It was very frustruted to see that the SQL Modeler hang in import from data dictionary of a database as part of revise engineering. I have to question myself if sql modeler is a serious tool and should I give up.

    I am not sure if Data Modeller is still in Beta./Production. First couple off initial versions of a new product are normally buggy.
    Regards
    Alternatively, If this product is still in Beta, then you can contact the development team or report the issue so that they can take care of this issue in next beta release.
    Edited by: skvaish1 on Mar 30, 2010 3:18 PM
    Edited by: skvaish1 on Mar 30, 2010 3:26 PM

  • Basic questions on data modeling

    Hi experts,
    I have some basic questions regarding data modeling within MDM. I understand the available table types and the concept of lookup fields. I know that the MDM data modeling concept is different to the relational concept. But having a strong database background my first step was to design a relational data model which I would like to transfer to a MDM repository. Unfortunately I didn't found good information material on this. So here are some questions maybe you can help me:
    1) Is it the right approach to model n:m relationships with multivalued lookup fields? E.g. main table Users with lookup field from subtable SapAccounts (a user can have accounts in different SAP systems, that means more than one account).
    2) Has a record always be unique in MDM repositories (e.g. should we use Auto ID's in every table or do we have to mark a combination of fields as unique)? Is a composite key of 2 or more fields represented with marking these fields as unique?
    3) The concept of relationships in MDM is only based on relationships between single records (not valid for all records in a table)? Is it necessary to define all relationships similar to the relational data model in MDM? Is there something similar to referential integrity in MDM?
    4) Is it possible to change the main table to a sub table later on if we realize that it has also to be used as a lookup table for another table (when extending the data model) or do we have to create a new repository from scratch?
    Thank you for your answers.
    Regards, bd

    Yes you are correct. It is almost difficult to map relational database to mdm one. But again MDM is not 'just' a database. It holds much more 'master' information as compared to any relational db.
    1) Is it the right approach to model n:m relationships with multivalued lookup fields? E.g. main table Users with lookup field from subtable SapAccounts (a user can have accounts in different SAP systems, that means more than one account).
    Yes Here you need to use MV look up tables or can also try Qualifier tables if it gets more complex
    2) Has a record always be unique in MDM repositories (e.g. should we use Auto ID's in every table or do we have to mark a combination of fields as unique)? Is a composite key of 2 or more fields represented with marking these fields as unique?
    Concept of uniqueness differs here that you also have something called Display Fields (DF). A combination of DF can also be treated as Unique one. For instance while importing records if you select these DF as a combination, you will eliminate any possible of duplicates based on this combination. Auto Id is one of the ways to have a unique id once record is within MDM. While you use UF or DF to eliminate any possible duplicates at import level
    3) The concept of relationships in MDM is only based on relationships between single records (not valid for all records in a table)? Is it necessary to define all relationships similar to the relational data model in MDM? Is there something similar to referential integrity in MDM?
    Hmm... good one. Referencial Integrity. What I assume you are talking is that if you have relationships between tables then removing a record will not be possible as it is a foreign key for some record. Here MDM does not allow that. As Relationships within MDM are physical and not conceptual. For instance material can have components. Now if material does not exist then any relationship to components is not worthwile to maintain. Hence relationshsip is eliminated.  While in relational model relationships are more conceptual. Hence with MDM usage of lookups and main table you do not need to maintain these kind of relationships on your own.
    4) Is it possible to change the main table to a sub table later on if we realize that it has also to be used as a lookup table for another table (when extending the data model) or do we have to create a new repository from scratch?
    No. It is not possible to convert main table. There is only one main table and it cannot be changed.
    I went for the same option but it did not work. What I suggest is to look up your legacy system one by one and see what fields in general can be classified as Master, Reference, Transactional - You will start getting answers immediately.

  • Getting parsing SP error while migrating SQL Sever 7 to Oracle 8.1.7

    Hello,
    I migrate SQL Sever 7 database to Oracle 8.1.7 using latest
    Migration Workbench + sqlsever7 plugin.
    I captured the source database and created Oracle model but some
    of straight forward enough stored procuderes didn't pass. I try
    manually correct them but still receive the following error
    message:' java.lang.StringIndexOutOfBoundsException:string index
    out of range:0 ViewLog Window' I check log - not much help
    I check all names - non of the exceeds 30 char.
    Although, I'm not sure of following code:
    @sqlstr='select....'
    @sqlstr=@sqlstr+'select...'
    exec @sqlstr
    Could it be a cause?
    Thanks in advance
    Marina

    You can user Oracle Migration Workbench to migrate from SQL Server to Oracle.
    Here is the link which gives info on software usage and download :
    http://otn.oracle.com/tech/migration/workbench/content.html
    Chandar

  • Migrating SQL Server DB to Oracle DB - probably EASY answer

    I completed the tutorial on migrating SQL Server DB to Oracle. When I try on my own database, it all migrated well except anything containing a datetime. When I run the oracle_ctl.bat file and view any of the log files, I see Record 1: Rejected - Error on table DBO_RIVERSIDEDB_NCWCD_TEST.TS6HOUR_TAIN, column DATE_TIME.
    ORA-01843: not a valid month. Do I need to change the first line of the file set NLS_DATE_FORMAT=Mon dd YYYY HH:mi:ssAM ? In the .dat file created from the unload_script.bat, the data starts out 1275<EOFD>2007-05-11 00:00:00.000<EOFD>74.900000000000006<EOFD><EOFD><EORD>1275<EOFD>. So my questions is about the date_format - is that the same for all SQL Server databases or do I need to enter something based on MY database? I am definitely a newbie so this is probably a super easy question. Thanks so much for any help!

    Hello,
    There are two different date format in SQL Server.
    1] DateTime : 2010-08-03 12:48:15.170
    2] SmallDateTime: 2010-08-03 12:48:00     
    Both the date will be inserted in Oracle Date column.
    Is there any automated way to generate datamove script to tackle these differences? I've around 200 tables to be migrated and there may be many such cases.
    The issue with Oracle SQL Developer setting i.e. Tools >Preferences> (Under) Migration> Data Move Option, there are two masks we can specify, one for Date Mask and other for Timestamp. How can I set both of these for converting data into Date, not in timestamp.
    Below is my .CTL file, none of below fields are timestamp, but since incoming data in in timestamp format, it is applying timestamp mask and eventually failing to insert data into table
    load data
    infile '[PARTSORDER].dat'
    "str '<EORD>'"
    into table admin.PARTSORDER
    fields terminated by '<EOFD>'
    trailing nullcols
    ORDERID ,
    GenDate "TO_TIMESTAMP(:GenDate, 'YYYY-MM-DD.HH24.MI.SS.ff3')",
    Status "DECODE(:Status, CHR(00), ' ', :Status)",
    StatusBy ,
    StatusDate "TO_TIMESTAMP(:StatusDate, 'YYYY-MM-DD.HH24.MI.SS.ff3')",
    Approved ,
    ApprovedBy ,
    ApprovedDate "TO_TIMESTAMP(:ApprovedDate, 'YYYY-MM-DD.HH24.MI.SS.ff3')",
    TrackingNumber "DECODE(:TrackingNumber, CHR(00), ' ', :TrackingNumber)",
    SVOther "DECODE(:SVOther, CHR(00), ' ', :SVOther)",
    ShippedVia "DECODE(:ShippedVia, CHR(00), ' ', :ShippedVia)",
    ShippedBy "DECODE(:ShippedBy, CHR(00), ' ', :ShippedBy)",
    ShippedDate "TO_TIMESTAMP(:ShippedDate, 'YYYY-MM-DD.HH24.MI.SS.ff3')",
    CompletedBy "DECODE(:CompletedBy, CHR(00), ' ', :CompletedBy)",
    CompletedDate "TO_TIMESTAMP(:CompletedDate, 'YYYY-MM-DD.HH24.MI.SS.ff3')",
    ORDERType "DECODE(:ORDERType, CHR(00), ' ', :ORDERType)",
    RMAID ,
    RMANumber "DECODE(:RMANumber, CHR(00), ' ', :RMANumber)",
    BackOrdered ,
    XORDERID ,
    PARTSORDERSENT "DECODE(:PARTSORDERSENT, CHR(00), ' ', :PARTSORDERSENT)",
    SHIPMENTID "DECODE(:SHIPMENTID, CHR(00), ' ', :SHIPMENTID)"
    Any help in this regard will be highly appreciated!
    Thanks
    Vinod

  • Migrate SQL Server 7.0 to Oracle 8i - Any known issues??

    Hi,
    I am in the process of migrating SQL Server database to Oracle 8i for testing purpose. When I do migrate SQL Server database to Oracle 8i, am I doing any harm to the exiting SQL Server database? Would the users be able to use SQL Server database as usual?? Are there any known issues in this regard?
    Please reply.
    Thanks.
    Ramesh

    The Migration Workbench copys the information it requires from the source database and stores it in the Migration Workbench Repository, which is separate from the Source database. So, to answer your question, yes, the users can continue to use the SQL Server database. The data move may cause some system performance degradation. It may also be an idea to replicate the SQL Server database, in case any complication should arise.
    Hope this helps
    Dan

  • Concept between MS SQL and Oracle

    hi, everyone, i am very new for Oracle. Reading some books and confuse about some base concepts:
    in MS SQL world, you can install multiple INSTANCE on a physical server, inside each INSTANCE, you can create multiple DATABASEs, each DATABASE has it owned data\transaction log file on disk.
    In the Oracle world, my understand is, INSTANCE = memory structure + physical database file (which pretty close to MS SQL identification). similar to MS SQL, you can have multiple INSTANCEs on each physical server. but which one is the 'DATABASE' in oracle world? The closest one i think is TABLESPACE. I can assign one or multiple physical data file for each TABLESPACE. but all the TABLESPACE place the redo log file inside the same undo TABLESPACE? also, for each application, i have to create one or more TABLESPACE inside a INSTANCE(that's what i usually do in MS SQL)?
    thank you for your help. please forgive me if my question is too silly.
    Edited by: user3614365 on Jun 14, 2012 2:57 PM

    please forgive me if my question is too silly.Firs of all, your questions are not silly at all. You can get better understanding of one product by setting analogies and comparisons with a product you are familiar with. I used same method when I learned about MS SQL comparing it with Oracle.
    So, welcome on Oracle board!
    in MS SQL world, you can install multiple INSTANCE on a physical server, you can have multiple instances of Oracle, belonging to same or separate Oracle Home on same physical machine.
    inside each INSTANCE, you can create multiple DATABASEs, In Oracle instance you can have only one database. That is how it is.
    each DATABASE has it owned data\transaction log file on disk.Even in MS SQL there can be multiple data files per database.
    >
    In the Oracle world, my understand is, INSTANCE = memory structure + physical database file (which pretty close to MS SQL identification). similar to MS SQL, you can have multiple INSTANCEs on each physical server.
    >
    yes
    >
    but which one is the 'DATABASE' in oracle world? The closest one i think is TABLESPACE. I can assign one or multiple physical data file for each TABLESPACE. but all the TABLESPACE place the redo log file inside the same undo TABLESPACE?
    >
    Here is little similarity between Oracle TABLESPACE and MS SQL database.
    In MS SQL Database has not only files associated with it, it has its own security and piece of data dictionary. It can have its own collation, you can detach it from one instance and attach to another, you can back it up separately, etc...
    I would say MS DB is more "standalone and self-containig" unit, comparing to Oracle TS.
    Oracle TS is a way of organizing data files and setting some default common storage properties for tables and other segments contained in TS.
    Oracle TS do not have separate security and data dictionary. Normally TS cannot be detached from one instance and attached to another. Though, there are special type of TS - transportable tablespace, which can be viewed as being a little bit close to what MS DB is.
    Anyway Oracle TS is not even close thing to MS DB.
    And it does not need to be. It has a totally different purpose.
    also, for each application, i have to create one or more TABLESPACE inside a INSTANCE(that's what i usually do in MS SQL)?You do not have to. But you better to do this way, from a data organization perspective. To make things look nicely organized.
    Sometimes one application may use multiple TS, for example when it needs different block size for some tables.
    You also can share TS between multiple apps, as you can do it with MS DB.
    What else is different?
    In Oracle there are no separation between logins and db users. It is one entity - USER. It has its security settings and may have its database objects.
    In Oracle can be only one schema per user, named same as user. Basically it is same thing - user and schema is same thing, and created and managed by same command CREATE/ALTER USER.
    However when we talk about storage and a place where objects belong to we say SCHEMA.
    When we talk about security and an owner where objects belong to - we say USER. :)
    Schema is like users Home in OS. What user creates belongs to its "home" - the schema. And the user is owner of it.
    If one user creates something in other's schema that thing will belong to that other's schema, and that another user will be owner, not to the user that called CREATE statement.
    However one user can change its current schema for the current session, just to avoid implicitly specifying another schema as a prefix for objects of that another schema.
    CONNECT scott
    SELECT * FROM joe.emp;
    ALTER SESSION SET CURRENT_SCHEMA = joe;
    SELECT * FROM emp;
    In MS SQL schemas are more similar to directories, there can be objects of different users in same schema, and objects of same user in different schemas.
    In Oracle there is DB Link which is similar to Linked Server.
    When called, DB Link is specified after the object name, separated by @.
    SELECT * FROM emp@anotherDB;
    That was most significant differences.
    Oh yes, Oracle is a versioning engine, and MS SQL is locking engine, though it can be any starting from recent.

  • Can Oracle Migration Workbench 2.0.2.0.0 be used to migrate SQL 7.0 to Oracle 8i?

    Hi,
    Does anyone know that can Oracle Migration Workbench 2.0.2.0.0
    be used to migrate SQL 7.0 to Oracle 8i? or the version
    2.0.2.0.0 can be only used for Oracle 9i?
    I failed to install Oracle Migration Workbench 2.0.2.0.0 onto my
    workstation(running Oracle 8.1.7), because it need Oracle 9i.
    Thanks
    Leo Siu

    One more question: where can I download the Oracle Migration
    Workbench 1.4.1.0.0 in order to migrate non-oracle database to
    Oracle 8i?
    Thanks

  • My Experiences re: Migrating SQL Server Database to Oracle

    I am using SQL Developer EA4 for thsi conversion, best attempt yet.
    I had numerous problems with this conversion.
    1. The wizard asked me to specify the new Oracle database; instead it just ignored this information and created an Oracle database similarly named as the SQL Server database. I also noticed a file name "Migration.out" was produced; it contained errors such as:
    Error starting at line 3 in command:
    CREATE USER Emulation IDENTIFIED BY Emulation DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP
    Error at Command Line:3 Column:36
    Error report:
    SQL Error: ORA-01031: insufficient privileges
    01031. 00000 - "insufficient privileges" and
    Error starting at line 4 in command:
    GRANT CREATE SESSION, RESOURCE, CREATE VIEW, CREATE MATERIALIZED VIEW, CREATE SYNONYM,CREATE PUBLIC SYNONYM TO Emulation
    Error report:
    SQL Error: ORA-01031: insufficient privileges
    01031. 00000 - "insufficient privileges" and
    Error starting at line 7 in command:
    CREATE USER dbo_COREv13 IDENTIFIED BY dbo_COREv13 DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP
    Error at Command Line:7 Column:38
    Error report:
    SQL Error: ORA-01031: insufficient privileges
    01031. 00000 - "insufficient privileges" and
    Error starting at line 8 in command:
    GRANT CREATE SESSION, RESOURCE, CREATE VIEW, CREATE MATERIALIZED VIEW, CREATE SYNONYM TO dbo_COREv13
    Error report:
    SQL Error: ORA-01031: insufficient privileges
    01031. 00000 - "insufficient privileges".
    I followed all of the steps listed in the "Help" section re: Migrations but still ended up with these errors.
    2. My schema consists of 1000+ tables; approximately 10 tables were NOT created. When I copied the SQL from Migration.sql making NO changes and pasted it into the new Oracle database it created without issues.
    3. While the conversion is taking place, different objects (constraints, indexes, foreign keys, etc) are shown to be copied; their appears to be ordering of these items. Shouln't a dependancy tree be established, and object converted based on this?
    4. Several tables, in my case about 250 tables did NOT get any data copied across. No reasons given.
    5. A log of all activities should be produced for review and completeness.
    6. I tried to use the "Migrate select tables" option but met with no success. Apparently, it makes an assumption that both the "source" and "target" databases wil be of the same type (ie both SQL Server or both Oracle); this does not make any sense to me since the point of the exercise is to migrate data from one database vendor to another. Obviously, different database vendors use differing datatypes for similar data (ie dates).
    7. I noticed in the "Migration" sql that the "Connect" statements are not correct; they were missing the "instance name" portion.
    8. Also, when I looked in the "MIGRATION" sql, I could not find any entries for the last step of the conversion - the movement of data from SQL Server to Oracle. Is this intentional or an oversight.
    I dont want to appear negative on this Migration; I have used SQL Developer since it inception; in my opinion this is the best attempt to date.
    Murray Sobol

    Hi Murray,
    Thanks for this feedback.
    There is a lot of questions here, I think some of it boils down to misunderstandings, which we should clarify in the doc.
    Hopefully Ill get a video of a migration online soon as well.
    But here is a brief break down.
    *1.*
    "The wizard asked me to specify the new Oracle database; instead it just ignored this information and created an Oracle database similarly named as the SQL Server database."
    So this relates to Step 7 of the Migration Wizard. Where you can select the target connection.
    SQL Developer doesn't ignore the Target Connection you selected, It just uses it to connect to the target database , not the target schema.
    SQL Developer generates a new target schema for the migrated objects. It standard approach is not to generate objects directly into an existing Schema.
    The Target Connection is used to create all the migrated objects (including new Oracle Schemas) in your target oracle database. So you should choose an Oracle Target Connection which has enough privileges to create new Schemas and Objects.
    But as you have found, it doesn't generate the migrate objects , like tables, ... , directly into your chosen Target Connection.
    From the errors you encountered it doesn't sound like the Target Connection (and the underling Oracle Schema) doesn't have the privileges to create other Schemas.
    If you use something like a connection to the SYSTEM schema on your target database, it should run OK.
    It wont create any objects in SYSTEM, rather it will use SYSTEM privileges to create a new schema (ex: dbo_Northwind) and populate it.
    You don't have to use SYSTEM, but you do need a schema with enough privileges to create other schemas.
    That is the straight forward way. But if you really need to generate into an existing schema the following steps can be taken.
    a)rename the schema under the Converted Database Objects
    b)Right click "Converted Databases Objects" and choose generate. it will kick off the Migration Wizard in the correct place
    *2.*
    My schema consists of 1000+ tables; approximately 10 tables were NOT created. When I copied the SQL from Migration.sql making NO changes and pasted it into the new Oracle database it created without issues.
    When you say Migration.sql , is the entire generation file , which can be found in your <outputspecified>/generated/<projectname.modelname>.sql ?
    When your say "pasted it into the new Oracle database" , are you running it in SQL Developers SQL Worksheet using the Target Connection.
    Basically your migration is all out of shape once the target Schemas are not created. So the above issues (insufficient privileges) has to be resolved first.
    Please post back if it is still an issue.
    *3.*
    While the conversion is taking place, different objects (constraints, indexes, foreign keys, etc) are shown to be copied; their appears to be ordering of these items. Shouln't a dependancy tree be established, and object converted based on this?
    Objects are converted in a particular order and their dependencies are persisted so that they can be generated in the correct order.
    Are you seeing an issue?
    *4.*
    Several tables, in my case about 250 tables did NOT get any data copied across. No reasons given.
    I'm surprised any tables were populated with data due to the target schema not being created.
    The online data move is pretty simple and it does not report or recover very well from issues.
    If you are having difficulties once item 1. is resolved, please post an example of the source table and I will give it a go.
    For better control of the data move with much more powerful tweaking, error handling, reporting and performance try the offline data move.
    SQL Developer can created a suite of scripts which use SQL Servers BCP tool to dump out the data to dat files, and Oracle SQL*Loader tool to insert the data in the dat file into Oracle.
    *5.*
    A log of all activities should be produced for review and completeness.
    The output/generated/<projectname.modelname>.out provides the output of running the generation script.
    The migration reports http://dermotoneill.blogspot.com/2010/11/migration-reports-30.html outline what happens during the migration.
    Apart from online data move issues, is there any other data missing?
    *6.*
    I tried to use the "Migrate select tables" option but met with no success. Apparently, it makes an assumption that both the "source" and "target" databases wil be of the same type (ie both SQL Server or both Oracle); this does not make any sense to me since the point of the exercise is to migrate data from one database vendor to another. Obviously, different database vendors use differing datatypes for similar data (ie dates).
    Do you mean "Copy To Oracle" ? This option is intended to migrate tables from non Oracle databases like SQL Server to Oracle.
    Can you give more details on what issue you are seeing.
    *7.*
    I noticed in the "Migration" sql that the "Connect" statements are not correct; they were missing the "instance name" portion.
    The generation script is meant to be run using SQL Developers SQL Worksheet. I think you only get this "instance name" issue if running from SQL*Plus.
    Can you confirm
    8. Also, when I looked in the "MIGRATION" sql, I could not find any entries for the last step of the conversion - the movement of data from SQL Server to Oracle. Is this intentional or an oversight.
    The online data move is performed separately from creating the objects. It is not script based, it uses JDBC to pump the data from the source database to the target database.
    In summary , I would
    a) Create a connection to your Target database using your SYSTEM schema
    b) Right click on your "Converted Database Objects" and choose "Generate Target"
    c) Choose your new "System" connection as the Target Connection
    d) Follow the Migration Wizard to the end.
    You will end up with a new target Schema and the migrated objects in it.
    Check the .out file to see the errors
    and the migration reports http://dermotoneill.blogspot.com/2010/11/migration-reports-30.html
    Regards,
    Dermot
    SQL Developer Team.

  • Help with SQL MODEL Clause

    I have the privilege of performing a very tedious task.
    We have some home grown regular expressions in our company. I now need to expand these regular expressions.
    Samples:
    a = 0-3
    b = Null, 0, 1
    Expression: Meaning
    1:5: 1,2,3,4,5
    1a: 10, 11, 12, 13
    1b: 1, 10, 11
    1[2,3]ab: 120, 1200, 1201, ....
    It get's even more inetersting because there is a possibility of 1[2,3]a.ab
    I have created two base queries to aid me in my quest. I am using the SQL MODEL clause to solve this problem. I pretty confident that I should be able to convert evrything into a range and the use one of the MODEL clause listed below.
    My only confusion is how do I INCREMENT dynamically. The INCREMENT seems to be a constant in both a FOR and ITERATE statement. I need to figure a way to increment with .01, .1, etc.
    Any help will be greatly appreciated.
    CODE:
    Reference:          http://www.sqlsnippets.com/en/topic-11663.html
    Objective:          Expand a range with ITERATE
    WITH t AS
    (SELECT '2:4' pt
    FROM DUAL
    UNION ALL
    SELECT '6:9' pt
    FROM DUAL)
    SELECT pt AS code_expression
    -- , KEY
    -- , min_key
    -- , max_key
    , m_1 AS code
    FROM t
    MODEL
    PARTITION BY (pt)
    DIMENSION BY ( 0 AS KEY )
    MEASURES (
                        0 AS m_1,
                        TO_NUMBER(SUBSTR(pt, 1, INSTR(pt, ':') - 1)) AS min_key,
                        TO_NUMBER(SUBSTR(pt, INSTR(pt, ':') + 1)) AS max_key               
    RULES
    -- UPSERT
    ITERATE (100000) UNTIL ( ITERATION_NUMBER = max_key[0] - min_key[0] )
    m_1[ITERATION_NUMBER] = min_key[0] + ITERATION_NUMBER
    ORDER BY pt, m_1
    Explanation:
    Line numbers are based on the assupmtion that "WITH t AS" starts at line 5.
    If you need detailed information regarding the MODEL clause please refer to
    the Refrence site stated above or read some documentation.
    Partition-
    Line 18:     PARTITION BY (pt)
                   This will make sure that each "KEY" will start at 0 for each value of pt.
    Dimension-
    Line 19:     DIMENSION BY ( 0 AS KEY )     
                   This is necessary for the refrences max_key[0], and min_key[0] to work.
    Measures-
    Line 21:      0 AS m_1
                   A space holder for new values.
    Line 22:     TO_NUMBER(SUBSTR(pt, 1, INSTR(pt, ':') - 1)) AS min_key
                   The result is '1' for '1:5'.
    Line 23:     TO_NUMBER(SUBSTR(pt, INSTR(pt, ':') + 1)) AS max_key                                        
                   The result is '5' for '1:5'.
    Rules-
    Line 26:     UPSERT
                   This makes it possible for new rows to be created.
    Line 27:     ITERATE (100000) UNTIL ( ITERATION_NUMBER = max_key[0] - min_key[0] )
                   This reads ITERATE 100000 times or UNTIL the ITERATION_NUMBER = max_key[0] - min_key[0]
                   which would be 4 for '1:5', but since the ITERATION_NUMBER starts at 0, whatever follows
                   is repaeted 5 times.
    Line 29:     m_1[ITERATION_NUMBER] = min_key[0] + ITERATION_NUMBER
                   m_1[ITERATION_NUMBER] means m_1[Value of Dimension KEY].
                   Thus for each row of KEY the m_1 is min_key[0] + ITERATION_NUMBER.
    Reference:          http://www.sqlsnippets.com/en/topic-11663.html
    Objective:          Expand a range using FOR
    WITH t AS
    (SELECT '2:4' pt
    FROM DUAL
    UNION ALL
    SELECT '6:9' pt
    FROM DUAL)
    , base AS
    SELECT pt AS code_expression
    , KEY AS code
    , min_key
    , max_key
         , my_increment
    , m_1
    FROM t
    MODEL
    PARTITION BY (pt)
    DIMENSION BY ( CAST(0 AS NUMBER) AS KEY )
    MEASURES (
                        CAST(NULL AS CHAR) AS m_1,
                        TO_NUMBER(SUBSTR(pt, 1, INSTR(pt, ':') - 1)) AS min_key,
                        TO_NUMBER(SUBSTR(pt, INSTR(pt, ':') + 1)) AS max_key,     
                        .1 AS my_increment     
    RULES
    -- UPSERT
              m_1[FOR KEY FROM min_key[0] TO max_key[0] INCREMENT 1] = 'Y'
    ORDER BY pt, KEY, m_1
    SELECT code_expression, code
    FROM base
    WHERE m_1 = 'Y'
    Explanation:
    Line numbers are based on the assupmtion that "WITH t AS" starts at line 5.
    If you need detailed information regarding the MODEL clause please refer to
    the Refrence site stated above or read some documentation.
    Partition-
    Line 21:     PARTITION BY (pt)
                   This will make sure that each "KEY" will start at 0 for each value of pt.
    Dimension-
    Line 22:     DIMENSION BY ( 0 AS KEY )     
                   This is necessary for the refrences max_key[0], and min_key[0] to work.
    Measures-
    Line 24:      CAST(NULL AS CHAR) AS m_1
                   A space holder for results.
    Line 25:     TO_NUMBER(SUBSTR(pt, 1, INSTR(pt, ':') - 1)) AS min_key
                   The result is '1' for '1:5'.
    Line 26:     TO_NUMBER(SUBSTR(pt, INSTR(pt, ':') + 1)) AS max_key                                        
                   The result is '5' for '1:5'.
    Line 27:     .1 AS my_increment     
                   The INCREMENT I would like to use.
    Rules-
    Line 30:     UPSERT
                   This makes it possible for new rows to be created.
                   However seems like it is not necessary.
    Line 32:     m_1[FOR KEY FROM min_key[0] TO max_key[0] INCREMENT 1] = 'Y'
                   Where the KE value is between min_key[0] and max_key[0] set the value of m_1 to 'Y'
    */

    Of course, you can accomplish the same thing without MODEL using an Integer Series Generator like this.
    create table t ( min_val number, max_val number, increment_size number );
    insert into t values ( 2, 3, 0.1 );
    insert into t values ( 1.02, 1.08, 0.02 );
    commit;
    create table integer_table as
      select rownum - 1 as n from all_objects where rownum <= 100 ;
    select
      min_val ,
      increment_size ,
      min_val + (increment_size * n) as val
    from t, integer_table
    where
      n between 0 and ((max_val - min_val)/increment_size)
    order by 3
       MIN_VAL INCREMENT_SIZE        VAL
          1.02            .02       1.02
          1.02            .02       1.04
          1.02            .02       1.06
          1.02            .02       1.08
             2             .1          2
             2             .1        2.1
             2             .1        2.2
             2             .1        2.3
             2             .1        2.4
             2             .1        2.5
             2             .1        2.6
             2             .1        2.7
             2             .1        2.8
             2             .1        2.9
             2             .1          3
    15 rows selected.--
    Joe Fuda
    http://www.sqlsnippets.com/

  • SQL*Modeler - creation of VARRAY or Collection Type of scalar type errors

    In SQl*Modeler 2.0.0 Build 584, I can create either VARRAY or Collections. These work fine for usre defined structured types but I encounter huge problems when I use a simple scalar type of number or varchar2.
    For instance I create a new collection type, give it a name, specify its a collection (or VARRAY, same problem) then click datatype. On the select Data type box I select logical type. A new window opens, I select VARCHAR from the drop down list.
    Enter the size 15, everything appears fine. I click OK, the select data type screen now shows a logical type of VARCHAR(15).
    So far I'm happy. I generate the DDL, everthing is fine, the DDL contains my collection of VARCHAR2(15).
    Now I save the model, close it and re-open the same model. My collection is now of VARCHAR so the next time I generate it will get an error because the syntax is wrong because it has no length. Same problem happens when selecting a NUMBER, looses the precision and scale but at least that command still works, just with a maximum numeric value.
    Ok, so lets try creating distinct types. Why we can't access domains when specifying types from here remains a mystery to me.
    So I create a distinct type Varchar2_15 which is of Logical type VARCHAR and give it a size. Similarly, create another distinct type of NUMERIC_22_0 precision 22 scale 0. This seems to get around the problem of losing the data but the DDL generated shows the datatype to be either VARCHAR (not VARCHAR2) and NUMERIC(22), not number(22). Now I know that VARCHAR currently maps to VARCHAR2 but isn't guaranteed to in the future (even though its been like that since V6) and NUMERIC is just an alias for NUMBER but its going to confuse a lot of java people and its totally inconsitent and just plain wrong.
    Any suggestions or workarounds will be gratefully received.
    Ian Bainbridge

    Hi Ian,
    I see a bug in save/load of collection types and as result no size or precision and scale information. It's fixed in new release.
    However I cannot reproduce the problem with distinct types - I have them generated as varchar2 and number (this is for Oracle).
    You can check:
    - database you use in DDL generation - I got varchar and numeric for MS SQL Server;
    - mapping of logical types VARCHAR and NUMERIC to native types in "Types Administration".
    Philip
    PS - I was able to reproduce it - I looked at wrong place - DDL generation for collection types is broken - it's ok for columns. I logged bug for that.
    Edited by: Philip Stoyanov on Jun 28, 2010 8:55 PM

  • SQL*Modeler generation DDL sequence

    SQL*Modeler Version 2.0.0. Build 584
    In my data model I have a dozen or so External tables and corresponding PUBLIC synonyms to each of them.
    The generated script from SQL*Modleler is sequenced by types, tables,views, sequences, synonyms(both public and private), directories, external tables, triggers (and probably some other things that I am not using).
    So at the end of running my generation script I always check for rows in DBA_OBJECTS for rows with status='INVALID', hoping for none of course. But because synonyms are created before my external tables the synonyms are invalid. No big deal, as soon as I access the synonym it will recompile anyway but it's a bit disconcerting for the DBA's implementing this model to have invalid objects.
    Is there a good reason why synonyms are generated before External tables or is this just an oversight?
    I also have a similar problem with types which are used cross schema because there is no way to grant the schema a privilege on a type ( I use an end of script option against the first table to do this but of course the types were invalid up until the point of granting execute on the parent type which recompiles the type but again leaves the synonym invalid). This could only be solved by having an option against the type to grant privileges as per tables. Would be nice to have.
    Regards
    Ian

    Hello,
    Is there a way to force Data Modeler (I am using version 4.0.2.840) to put a schema name in front of a table name that a trigger is defined on?
    Unfortunately there is not.  I've logged a bug on this.
    Thanks for reporting the problem.
    David

  • Sql*modeler loses size against a Structured Type.

    SQL*Modeler Version 2.0.0. Build 584
    I can create a structured type and save it. Then go back to that type and use the up and down down buttons to move an attribute from one place to another. After moving an attribute it loses the size or precision for the one you have been moving around. If you then cancel the changes the data is still lost.
    Similarly, when I click on a attribute I can see the size of say VARCHAR(4) in the left side of the window but in the right side it does not display any value in the size. If I change the name of the attribute then the size is lost.
    Seems like a little bug or two here me thinks......
    Regards
    Ian

    Thanks Ian,
    it's fixed.
    Regards,
    Philip

  • URGENT-- cannot see   sql modeler contents (xml file)

    All,
    I have tried to open up a model which has been developed with earlier versions of sql modeler.
    below, I have copied the contents of the calling XML file for your comments,.
    it seems like 2.xx version and somehow it shows empty.! I searched through the sub folders and there are 100s of xml files.
    I tried 1.5.x and latest version of sql modeler no luck so far. what am I missing or any workaround please..
    thanks
    ali
    ========================
    *<?xml version="1.0" encoding="UTF-8" ?>*
    *<model version="2.0">*
    *     <version version="3.2" design_id="C6FFE67F-9E2B-07CE-8B7A-C790E645720B" />*
    *     <object>*
    *          <comment></comment>*
    *          <notes></notes>*
    *          <alter type="created">*
    *               <user>hdai</user>*
    *               <timestamp>2009-05-31 08:30:30</timestamp>*
              </alter>
              <alter type="changed">
                   <user>hdai</user>
                   <timestamp>2009-06-22 10:17:09</timestamp>
              </alter>
         </object>
         <engineering_params delete_without_origin="false" engineer_coordinates="true" engineer_generated="true" show_engineering_intree="false" apply_naming_std="false" use_pref_abbreviation="true" upload_directory="" />
         <eng_compare show_sel_prop_only="true" not_apply_for_new_objects="true" exclude_from_tree="false">
              <entity_table>
                   <property name="Name" selected="true" />
                   <property name="Short Name / Abbreviation" selected="true" />
                   <property name="Comment" selected="true" />
                   <property name="Comment in RDBMS" selected="true" />
                   <property name="Notes" selected="true" />
                   <property name="TempTable Scope" selected="true" />
                   <property name="Table Type" selected="true" />
                   <property name="Structured Type" selected="true" />
                   <property name="Type Substitution (Super-Type Object)" selected="true" />
                   <property name="Min Volumes" selected="true" />
                   <property name="Expected Volumes" selected="true" />
                   <property name="Max Volumes" selected="true" />
                   <property name="Growth Percent" selected="true" />
                   <property name="Growth Type" selected="true" />
                   <property name="Normal Form" selected="true" />
                   <property name="Adequately Normalized" selected="true" />
              </entity_table>
              <attribute_column>
                   <property name="Name" selected="true" />
                   <property name="Data Type" selected="true" />
                   <property name="Data Type Kind" selected="true" />
                   <property name="Mandatory" selected="true" />
                   <property name="Default Value" selected="true" />
                   <property name="Use Domain Constraint" selected="true" />
                   <property name="Comment" selected="true" />
                   <property name="Comment in RDBMS" selected="true" />
                   <property name="Notes" selected="true" />
                   <property name="Source Type" selected="true" />
                   <property name="Formula Description" selected="true" />
                   <property name="Type Substitution" selected="true" />
                   <property name="Scope" selected="true" />
              </attribute_column>
              <key_index>
                   <property name="Name" selected="true" />
                   <property name="Comment" selected="true" />
                   <property name="Comment in RDBMS" selected="true" />
                   <property name="Notes" selected="true" />
                   <property name="Primary Key" selected="true" />
                   <property name="Attributes/Columns" selected="true" />
              </key_index>
              <relation_fk>
                   <property name="Name" selected="true" />
                   <property name="Comment" selected="true" />
                   <property name="Comment in RDBMS" selected="true" />
                   <property name="Notes" selected="true" />
              </relation_fk>
              <entityview_view>
                   <property name="Name" selected="true" />
                   <property name="Comment" selected="true" />
                   <property name="Comment in RDBMS" selected="true" />
                   <property name="Notes" selected="true" />
                   <property name="Structured Type" selected="true" />
                   <property name="Where" selected="true" />
                   <property name="Having" selected="true" />
                   <property name="User Defined SQL" selected="true" />
              </entityview_view>
         </eng_compare>
         <changerequests id="" />
         <design type="Data Types" id="2391D8C8-FEC6-9182-ED6C-6EAE53428D29" path_id="0" main_view_id="420C75F3-BD6B-8126-6EBA-050A1FC9BE54" should_be_open="true" is_visible="false">
              <name>DataTypes</name>
              <comment></comment>
              <notes></notes>
         </design>
         <design type="LogicalDesign" id="4A0EEC77-6A89-10AC-351F-172AA6998230" path_id="0" main_view_id="83AB3B8B-90C4-D6A9-291D-A65F781E85D9" should_be_open="true" is_visible="true">
              <name>Logical</name>
              <comment></comment>
              <notes></notes>
         </design>
         <design type="RelationalModel" id="1214B08E-6B1C-9449-2769-131F7637FD5C" path_id="1" main_view_id="11A685B9-D950-8186-6160-DDAD08DAC3C0" should_be_open="true" is_visible="false">
              <name>SMARTD</name>
              <comment></comment>
              <notes></notes>
         </design>
         <design type="RelationalModel" id="A61B461D-F897-0CBF-3924-4BC3D33F3D13" path_id="2" main_view_id="2F6C7BB5-3F13-8657-DD84-BAFEF664D2D8" should_be_open="true" is_visible="false">
              <name>SMARTD(2)</name>
              <comment></comment>
              <notes></notes>
         </design>
         <design type="Process Model" id="7B21085F-9F75-F895-17AA-32592475602A">
              <name>Process Model</name>
              <comment></comment>
              <notes></notes>
         </design>
         <design type="Business Information" id="C0C1E8B7-7CDE-F345-C446-412C87D12639" path_id="0" main_view_id="null" should_be_open="true" is_visible="false">
              <name>Business Information</name>
              <comment></comment>
              <notes></notes>
         </design>
         <domains>
              <domain name="defaultdomains" role="uses" />
         </domains>
    </model>

    Philip:
    here is the Log file ( running modeler 2.0). hope it helps.
    thx
    ali
    ================LOG file==========
    2009-12-02 13:53:34,312 [main] INFO ApplicationView - Oracle SQL Developer Data Modeler Version: 2.0.0 Build: 570
    2009-12-02 13:53:36,890 [main] WARN AbstractXMLReader - There is no file with default domains (path: domains name: defaultdomains)
    2009-12-02 13:54:58,390 [Thread-3] ERROR FileManager - getDataInputStream: Can not read data
    java.io.FileNotFoundException: D:\1D_data\LADPSS\docs\reference\data_model\data_model\relational\1214B08E-6B1C-9449-2769-131F7637FD5C.xml (The system cannot find the path specified)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(FileInputStream.java:106)
         at oracle.dbtools.crest.model.persistence.FileManager.getDataInputStream(Unknown Source)
         at oracle.dbtools.crest.model.persistence.FileManager.getDataInputStreamWithoutExtension(Unknown Source)
         at oracle.dbtools.crest.model.persistence.XMLPersistenceManager.getInputStreamFor(Unknown Source)
         at oracle.dbtools.crest.model.persistence.xml.AbstractXMLReader.getInputStreamFor(Unknown Source)
         at oracle.dbtools.crest.model.persistence.xml.AbstractXMLReader.recreateDesign(Unknown Source)
         at oracle.dbtools.crest.model.design.relational.RelationalDesign.load(Unknown Source)
         at oracle.dbtools.crest.model.design.Design.openDesign(Unknown Source)
         at oracle.dbtools.crest.swingui.ControllerApplication$OpenDesign$2.run(Unknown Source)
    2009-12-02 13:54:58,390 [Thread-3] ERROR AbstractXMLReader - Data inputstream is null (path: data_model/relational name: 1214B08E-6B1C-9449-2769-131F7637FD5C)
    2009-12-02 13:54:58,390 [Thread-3] ERROR FileManager - getDataInputStream: Can not read data
    java.io.FileNotFoundException: D:\1D_data\LADPSS\docs\reference\data_model\data_model\relational\A61B461D-F897-0CBF-3924-4BC3D33F3D13.xml (The system cannot find the path specified)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(FileInputStream.java:106)
         at oracle.dbtools.crest.model.persistence.FileManager.getDataInputStream(Unknown Source)
         at oracle.dbtools.crest.model.persistence.FileManager.getDataInputStreamWithoutExtension(Unknown Source)
         at oracle.dbtools.crest.model.persistence.XMLPersistenceManager.getInputStreamFor(Unknown Source)
         at oracle.dbtools.crest.model.persistence.xml.AbstractXMLReader.getInputStreamFor(Unknown Source)
         at oracle.dbtools.crest.model.persistence.xml.AbstractXMLReader.recreateDesign(Unknown Source)
         at oracle.dbtools.crest.model.design.relational.RelationalDesign.load(Unknown Source)
         at oracle.dbtools.crest.model.design.Design.openDesign(Unknown Source)
         at oracle.dbtools.crest.swingui.ControllerApplication$OpenDesign$2.run(Unknown Source)
    2009-12-02 13:54:58,390 [Thread-3] ERROR AbstractXMLReader - Data inputstream is null (path: data_model/relational name: A61B461D-F897-0CBF-3924-4BC3D33F3D13)
    2009-12-02 13:54:58,390 [Thread-3] ERROR FileManager - getDataInputStream: Can not read data
    java.io.FileNotFoundException: D:\1D_data\LADPSS\docs\reference\data_model\data_model\processmodel\7B21085F-9F75-F895-17AA-32592475602A.xml (The system cannot find the path specified)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(FileInputStream.java:106)
         at oracle.dbtools.crest.model.persistence.FileManager.getDataInputStream(Unknown Source)
         at oracle.dbtools.crest.model.persistence.FileManager.getDataInputStreamWithoutExtension(Unknown Source)
         at oracle.dbtools.crest.model.persistence.XMLPersistenceManager.getInputStreamFor(Unknown Source)
         at oracle.dbtools.crest.model.persistence.xml.AbstractXMLReader.getInputStreamFor(Unknown Source)
         at oracle.dbtools.crest.model.persistence.xml.AbstractXMLReader.recreateDesign(Unknown Source)
         at oracle.dbtools.crest.model.design.process.ProcessModel.load(Unknown Source)
         at oracle.dbtools.crest.model.design.Design.openDesign(Unknown Source)
         at oracle.dbtools.crest.swingui.ControllerApplication$OpenDesign$2.run(Unknown Source)
    2009-12-02 13:54:58,390 [Thread-3] ERROR AbstractXMLReader - Data inputstream is null (path: data_model/processmodel name: 7B21085F-9F75-F895-17AA-32592475602A)

  • Function Overloading concept in PL/SQL

    hi all,
    do we have Function Overloading concept in PL/SQL? If so, how to implement it? can anybody help me out with an example?

    Yep.
    SQL> create or replace
      2  package test_package as
      3
      4     function blah(param IN NUMBER) return number;
      5     function blah(param IN DATE) return number;
      6     function blah(param IN VARCHAR2) return number;
      7
      8     -- or
      9
    10     function blah(param IN NUMBER) return date;
    11     function blah(param IN NUMBER) return varchar2;
    12     function blah(param IN NUMBER) return char;
    13
    14  end test_package;
    15  /
    Package created.

Maybe you are looking for

  • Persuading a Deskjet 940c to work with Windows 7

    I have a Deskjet 940c with a parallel port connection. I have just upgraded my PC to Windows 7 (64-bit) and there are no available drivers for this combination. HP has ceased to update its software for this printer and Windows 7 does not have its own

  • External drive shows yellow

    I just attached a new external drive to my iMac.  I set it up to replace a drive I was using for backup.  I cleared off the old drive and want to use it to store/backup my photos.  It shows up as a yellow icon on my desktop and the other is green wit

  • 1280 X 720 29.97 FPS Setup

    Greeting, I'm starting up Premier Pro CS6 and I get this huge selection of formats I could setup for everything but what I "think" I need. What I Need Final output will be to YouTube but I want to set the file up for full res and then render from tha

  • Spotlight? Not even a glimmer in 10.4.7

    Spotlight has disappeared. The icon is still there on the menu bar, but nothing happens on clicking it. I have removed/replaced the Prefs with no result. This may have happened when I downloaded/installed (using Software Update) OSX10.4.7, but I can'

  • TS3750 100 page limit on photo books

    How do we plead and beg Apple to get with the times and be more competitive with other photo book companies. The 100 page (50 sheet) limit is so 5 years ago!!!  For those of us who create large albums like an annual family yearbook, this is not enoug