cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

"Generation of database" via api (vbscript)

Solved
Highlighted
Contributor

"Generation of database" via api (vbscript)

Hi,
I'm using Hopex v1R3, desktop app.
I'm writing a vbscript to scan some environments/repositories for databases, and then generate all ddl.
I'm stuck on the "generation of database" part.

I'm sure it is possible to start this generation from the database object, in this vbscript (with parameters on where to save the ddl).
Can someone help me with the command and syntax?


(Attached a "visual" for clarification.)

Thx a lot.
Danny

3 Replies
Highlighted
Contributor

Re: "Generation of database" via api (vbscript)

I tried this from the script-editor

 

set oRep = GetRoot
Set oDbs = oRep.GetCollection("Database")
Set oDb = oDbs.Item(1)
Set oRules = oRep.GetSelection("select [generation rule] where [name] ='DB2 OS 390 V8::Database'")
Set oRule = oRules.Item(1)
print oDb.Name + " - " + oRule.Name
oDb.GenerateCode oRule,"C:\Temp\", true

 

 

No errors on executing, but this doesn't seem to do anything.
Any thoughts?

 

Highlighted
MEGA

Re: "Generation of database" via api (vbscript)

Hi,

you don't have to use Generation rule 'DB2 OS 390 V8::Database'" directly...

try with this sample:

 

set oRep = GetRoot
Set oDbs = oRep.GetCollection("Database")
Set oDb = oDbs.Item(1)
Set oRule = oRep.GetObjectFromId("~WIENN6s(tO30[Database Container RootLevel]")
print oDb.Name + " - " + oRule.Name
oDb.GenerateCode oRule,"C:\Temp\", true

 

Sny

Highlighted
Contributor

Re: "Generation of database" via api (vbscript)

Yes, This works. Thanks a lot for this. Very helpfull.