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

"Generation of database" via api (vbscript)

dvanhoegaerden
Super Contributor

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

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

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

dvanhoegaerden
Super Contributor

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?