Page 1 of 1

Oracle reverse engineering

PostPosted: Mon Oct 08, 2018 10:27 am
by tsf_ssg

I open this post because I have some problems when I use Cameo Data Modeler plugin to reverse from my Oracle database (DB).

Firstly, I created an Oracle DDL engineering set.
Then, I configured it to reverse data from my DB.
After that, I made a right-click on the created element and "reverse".
At the end of the process, I have my model with all my tables/views/functions.

Problem no1:
The members of primary/unique keys and index are unknown.
Indeed, Magicdraw knows that, for a table, there is a primary/unique key or an index but it doesn't know which column is member of that.

I have a table "ALARMES".
This table has a PK "PK_ALARMES".
When I open the properties of this PK, I find out that the property "Members" is empty. So I don't know what columns are affected by this constraint in my generated model.

However, when I reverse from a DDL file, the property "Members" for the same PK is not empty. It contains the reference of all columns which are part of the PK.

Problem no2:
At the end of the reversing process, I discovered that all the apostrophes " ' " were missing from the description of all my tables/columns.

For example:
In DB, I have this comment on a column: "C'est une alarme" (comments are in french)
In MD, after reversing, the same comment becomes: "Cest une alarme". The character " ' " disappear.

This problem occurs even if I reverse from DDL files.

I tried to change the driver class and driver files but it's not better.
I also tried to change the default encoding in project options but it hasn't no consequences on my problems.
So I'm not in the right way..

Please, can anyone help me by giving me some hints to find out the origin of these problems.


Re: Oracle reverse engineering

PostPosted: Tue Oct 09, 2018 2:28 am
by gedkvi

What is the version of MD that you are using?

I think that both of the issues are connected and they are related to quotes or double quotes interpretation.
1) Is it possible that the members contain quotes in their names? There was a fix in MD 19.0 that would deal with problems like in the example below. Although that was also visible in reversing from DDL.
Code: Select all
   "zzz" NUMBER,


2) As for the second issue, comments are currently stripped of all quotes, double quotes etc. in order to reverse them correctly. I don't really see how you were able to reverse the comment "C'est une alarme" using DDL without any warnings. Could you please attach this sample DDL?(it can contain only a few lines)

No Magic Customer Support

Re: Oracle reverse engineering

PostPosted: Tue Oct 09, 2018 3:45 am
Thank you for your reply.
In my company, we are currently using MagicDraw and Cameo Data Modeler v18.4.

1) That is an example of what I have when I generate a DDL file for one table (with a PK) from Oracle SQL Developer before importing it into MagicDraw:
Code: Select all
CREATE TABLE owner.lst_msg (
    id_msg    NUMBER NOT NULL,
    message   VARCHAR2(500 BYTE) NOT NULL

CREATE UNIQUE INDEX owner.lst_msg_pk ON
    owner.lst_msg ( id_msg ASC );

ALTER TABLE owner.lst_msg
    ADD CONSTRAINT lst_msg_pk PRIMARY KEY ( id_msg )
        USING INDEX owner.lst_msg_pk;

In that case, I have all informations about members of indexes and PKs in the model generated by MagicDraw.

But when I reverse directly from database and not by using a DDL file generated by Oracle SQL Developer, I haven't informations about these members.

In the DDL code generated by Oracle SQL Developer there are no quotes in object's name.
So maybe it can be related to quotes like you say.

In fact, like I say, I cannot reverse correctly a comment with an apostrophe ('). It's because, like you say, they are removed during the reversing process.
And I can't not only reverse correctly from the database but also from DDL files generated by another software like Oracle SQL Developer. In all cases this character is removed.

This is an extract of DDL generated by Oracle SQL Developer for a table which contains comments with an apostrophe:
Code: Select all
CREATE TABLE owner.day_alim_status (
    day_to_feed   DATE NOT NULL,
    status        NUMBER(*,0) DEFAULT 0 NOT NULL

COMMENT ON COLUMN owner.day_alim_status.day_to_feed IS
    'Journée concernée par l''alimentation';

COMMENT ON COLUMN owner.day_alim_status.status IS
    'Statut d''alimentation pour ce jour'

So when Oracle SQL Developer detects a comment with an apostrophe in DB, it adds a second apostrophe in the DDL file to indicate that it's not a quote.

Thank you in avance for your reply

Re: Oracle reverse engineering

PostPosted: Thu Oct 11, 2018 8:39 am
by gedkvi

Could we please continue with these issues in our support system? Following steps may require sensitive information
Please write an email to and a ticket will be automatically created.

This way both of the issues can be investigated more deeply.

No Magic Customer Support