1 person found this helpful
The problem description is not quite clear for me.
From what I understand is you want to add additional information to a Data Modeler design. This information is kept in some tables in a database.
What you can do is write a java script which creates the pk and fk on tables in DM. You can several examples on java script in this forum.
Once you have the java script for one pk/fk, you can generate a java script for all pk/fk's based on the database tables containing this information.
I have been looking for documentation and examples on how to write the Java script that may be able to import our information.
However, I haven't been able to find documentation on the subject.
Is there any place that is known that has samples of scripts, and documentation on the Oracle Data Modeler API?
1 person found this helpful
You can find the API in the installation directory of Data Modeler in datamodeler\datamodeler\xmlmetadata\doc\index.html.
On the Data Modeler forum you can search for 'transformation script' and you will find several discussions on this topic.
There is also a tutorail on: http://download.oracle.com/otn_hosted_doc/sqldev/UserDefinedDesignRules/UserDefinedDesignRules.html
I hope this enough to start with.
Data Modeler also provides Discover Foreign Keys functionality. You can call it by right-clicking on the node for the Relational Model in the Browser tree, and selecting Discover Foreign Keys from the drop-down menu.
This can be used to find hidden foreign key relationships in the model, based on column names, and create the relevant Foreign Key. There's more detail on the discovery options in the Help for the "Create discovered foreign keys" panel.
We have tried the discover foreign keys option. It didn't work.
It seems to work off the Metadata, which we don't have populated in out databases (with the exception of 20 tables that all show the correct infromation).
Import from database should import foreign keys that are defined in the database.
The Discover Foreign Keys option is intended to help you to find additional foreign key relationships that are not explicitly defined in the database.
I can see that the Discover Foreign keys may be able to find foreign keys if you select a column name.
However, with over 3000 tables, this becomes a cumbersom proctice.
We already have the Foreign key data, but it is in a form that the data modeler can't recognise.
Thus writing a script that would pul in the information and set it on the display seems the most likely of ways to do this.
You shouldn't call from java script a procedure which returns data.
So for looping through all fk's, you fill out each time the template. The filled out templates you send to a file, and this file you process in Data Modeler using the transformation tool.
How then do I get the FK information (child table name, child column name) etc, when that information is in a seperate SQL table that is accesed through a stored procedure.
I cannot fill in the FK or PK fields without accessing the database,
So you have a stored procedure which delivers you the FK information. For each fk which is returned from this procedure you fill out the template as described before.
You can do this in a plsql or java program.
A Java program may be exactly what we need.
Our other option is to write an external program that would update the metadata, however we may not want to do that (changing customer databases may not be desired).
Is there any documentation on making a filter script (as an example) that is a Java executible?
It seems I can't make you clear what you should do. Put your email in the forum and I will send you a diagram of steps to follow.
I also have not found anything in the Oraacle documentation that mentions how to implement a Java app in the Data Modeler.
My email is firstname.lastname@example.org