Toad World® Forums

Scripting the Schemas and Sequences


#1

TDM (3.4.10.2)

Hi,

I’ve created a few scripts that eases the modelling process quote a lot, but I’m in need of a little help regarding Schemas and Sequences.

Sequences: The first problem I have is that I just want to log Sequences that are longer in Length than (30) characters, but testing with only 2 Characters, but nothing is getting logged, just says that the script is finished successfully… Attached is my Script.

With regards to the Schemas, I need more help here, because I keep on getting the error that the Entity.Schema object is not an object, so I can’t use Entity.Schema.Name for instance. I’m aiming to clear the schemas I’ve entered on all my entities.

Thanks in advance for the help.

Regards
Rudi
image005.png


#2

Hi Rudi,

I’d like to ask you for patience. We have a bank holiday here and our script experts are not available.
We will get back to you on Tuesday. I hope it’s not too late.

Thanks for your patience.

Regards,

Vladka


#3

Hi Rudi,

I think your test for length should use;

Seq.Name.length

instead of

Seq.Name.Length

i.e. length with a lowercase “l”

Your script works on my model if I make that change.

regards
Malcolm


#4

Hi Malcolm

Thanks, making the “L” lowercase worked. Now it’s just the Schemas and the then there’s one more scripting issue, I want to remove all the “Used Sequences” from my Attributes with a script (basically in the same way I want to remove the Schemas from the Entities). If someone can assist me with these last two scripts, it will be much appreciated.

Thanks in advance.

Regards
Rudi


#5

Hi Malcolm

My script for removing the sequences now works as well, attached you’ll find the script I used to perform this task. I’m still having trouble though with the Schemas.

Thanks
Rudi
Oracle_RemoveSequencesFromAttributes.js (382 Bytes)


#6

Hi Rudi,

I think the User/Schema is accessed as
Entity.DbOwner

so you can get the name as Entity.DbOwner.Name

HTH
Malcolm


#7

Hi,

DbOwner also gives the same problem. “Must be an Object”

Rudi


#8

Hello Rudi and Malcolm,

Please find attached our script version.

If you have any questions, please write us back.

Thanks for your patience once again.

Regards,

Vladka + Mario
script.js (641 Bytes)


#9

Thank you very much, this script runs like a dream.


#10

Perfect! Thanks.

Vladka