Customising Generate script


Having had success with Customising RE by following your movie, I thought I’d try to customise some Generation;

I want to create my own versions of CreateTrigger() and CreateTriggerView() to force the use of CREATE OR REPLACE.

I’ve done the following;

  1. create new package extending Generations for Oracle 9i
  2. added PERCodeGeneratorOR9 (2027), a new class PERCodeGeneratorOR9mss (2027) and a generalisation into the meta model
  3. created methods CreateTrigger() and CreateTriggerView() both with;
    parameter 1 Trigger Dispatch
    parameter 2 Flag Integer
    return String
  4. put the modified code into the skeleton functions
  5. restarted TDM

… but my code isn’t being run.

I’m sure I’m missing something obvious, but I can’t see what.

Any ideas?


Hello Malcolm,

I’m bringing good news. - CR # 47 555 to add CREATE or REPLACE option for triggers has already been done.
(I refer to the thread at:

It should be implemented in next Beta. So, I’d like to ask you for patience.

At the moment, our developers are very busy resolving issues on memory consumption, which has high priority. Unfortunately, we need their help to be able to make the documentation on the customization of script generation. So, after they finish their tasks, we will make the documentation and movie on how to customize the scripts.
Thanks for your patience again.

Have a nice day.

Vladka + TDM Team

Thanks Vladka,

We’re just too impatient.
Will a patch to Commercial version be available?
Kind regards

Yes, a patch will be available.

Unfortunately, at the moment, I’m not able to tell you when exactly it is released.

For now, we can write you a quick way how to make the change in system package/system script. With the patch installation then, the system package will be overwritten by the new system package where the fix will be included.
Would this be acceptable for you?

If so, just let us know.



Message was edited by: vladka

Hi Vladka,

For now, we can write you a quick way how to make the change in systempackage/system script. With the patch installation then, the systempackage will be overwritten by the new system package where the fixwill be included.
Would this be acceptable for you?

This would be really helpful.

Hello Malcolm,

Please take the following steps:

  1. Find a location where you store system packages. Default location:
    C:\Program Files\Quest Software\Toad Data Modeler 3\Packages\System
  2. Find the package GenerationsOR.txg.
  3. In the package properties, disable the Read Only property.
  4. Launch TDM3 and open Script Explorer (Tools menu).
  5. In the Script Explorer, Generation folder, find the PERCodeGeneratorOR script and double-click it to open it in Script Editor.
  6. Find function CreateTrigger.
  7. In the CreateTrigger function, replace this line:
    text = "CREATE "

with this text:

  1. Press Commit to save the changes in the script.
  2. Make the same change in function CreateTriggerView.
  3. Now you can generate the script to see the changes.
  4. If you like to save the changed script in the package, open the Package Explorer, select the package and save it. (Or simply close TDM3, the package will be saved automatically.)

If you have any questions, please feel free to write us back. Thanks.


Vladka + Mario

Great, thanks.
I thought that would be the place, I just wanted confirmation from the experts

Any information on addressing the initial problem? I’m also trying write my own Generations package that will override the way DDL is generated for SQL Server 2005. I want to include addtional extended properties.

Hello Michael,

Still working on memory related issues and optimization (high priority tasks). We will make a movie and appropriate doc as soon as it’s possible.

Thanks very much for your patience.