Toad World® Forums

TDM generated names for system constraints


#1

Hi,
When I RE Oracle 9i with “Don’t load system generated names …” option selected, TDM generates names. These are of the form NN_

_.
Since both <table_name> and <attribute_name> may be up to 30 characters in length the generated name exceeds the Oracle 30 character limit.
How can I get TDM to generate a unique (but recognisable) name that does not exceed the maximum length?
I wanted to replace the Oracle Designer generated names with ones that indicate which table they belong to.
Regards
Malcolm

#2

Hello Malcolm,

Please find attached a script that should help you.

Run the script in Scripting Window (Tools menu).
The script will go through all NotNull attributes and will set their notnull constraint name in format NN_nameoftable_number. For names exceeding 30 characters, it will truncate the NN_nameoftable part.

Malcom, please let us know whether the script meets your requirements. Thanks in advance.

Regards,

Vladka + Mario
Rename_NN_Constraint_Name.zip (629 Bytes)


#3

That seems to do what we require. Many thanks. Malcolm


#4

Great! Thanks for letting us know.
I’ll add the script to the Scripts section (Library).

Have a nice weekend!

Vladka


#5

Just a quick note: The script, including description + instructions on how to execute it, is available at:
http://modeling.inside.quest.com/entry.jspa?externalID=1361&categoryID=35

Vladka