Toad World® Forums

JScript: How to understand the object structure and find out possible property names

Hallo,

I try to do some scripting to automatic clearing the “Using Index Property” of Oracle primary keys. So I dowloaded some JScript examples and take a look at the “Reference Guide” under “Expert Mode”. Until now I did not find out, how to easily walk along the object tree. I even do not now the Object Names and a call to Key.SupportsProperty(“Using Index Properties”) (Key is Entitie.Key) does never return true.

So where to find a documentation or a way to get the technical names of Objects and Properties.

Regards

Frank

Hi Frank,

to quickly clear the Index Properties:

  1. Enable Expert Mode in settings

  2. Click Expert Mode | Scripting Window...

  3. In the Scripting Window select your model and move it to right side, change Name in Script to Model.

  4. Run the script that iterates indexes in your entities and sets the IndexProp to empty value.

indexprop.png

Object types, properties and methods are available in Reference Guide. Click Expert Mode | Reference Guide to open the documentation.

Index properties are part of PERIndexOR class (PER = physical ER model, OR = Oracle specific)

I hope it helps,

Vaclav

[View:~/cfs-file.ashx/__key/communityserver-discussions-components-files/31/script_2D00_remove_2D00_indexprop.txt:550:0]

Hallo Vaclv,
thank your for your advice. Here are two things to clearify:

First, i did not mean the index properties, i meant the key properties.

TDMKeyProp.png

As you know, in oracle primary key and index are nearly the same. So in my case, I just want to clear the storage and logging clause.

The PK_ANSCHRIFT is not listed in the index list, it is listed in the key list!

Second: I knew the “Reference Guide” but find it hard to read. So i.e. the indexes. How to know, that from the index view, tab “Index Properties” the jScript IndexProp="" only cleares the free text (STORAGE CLAUSE i.e.) and not the tablespace or other entries?

A bit more example code on the web side would be great. And there is missing a list of valid values for the PropertyValueByName ParamName parameter.

Hi,

OK, my apologies. I modified the script.

[View:~/cfs-file.ashx/__key/communityserver-discussions-components-files/31/script_2D00_remove_2D00_pkusingindexprop.txt:550:0]

It is necessary to iterate Keys in every entity. Tablespaces will remain untouched.

The following screenshot shows how to use PropertyValueByName: You can pass there supported property name and its value will be returned.

Regards,

Vaclav

Hallo Vaclav,

thx a lot. Main problem was, that the GUI did not name the textfield, that contains the storage clause. So in jScript I thought that I have to walk to something named “UsingIXClause” or “UsingIndexClause” an so forth and than iterate through that to get to the textfield entry. I did not now and could not find in the documentation that it is ordered that way. Maybe I was blind or a bit confused. Thank so far.

Regards

Frank

You are welcome. I am glad I could help you. In case you need more information, feel free to post your questions here. The documentation cannot cover all possible customization tasks.

Regards,

Vaclav