02-06-2016 01:27 PM
Hello,
Today I have modified the DataBase creation wizard to do some work after database creation like for example creation other objects, define the Target DBMS, ... (I put the code in the OnWizTerminate function).
All is working well except fot theTarget DBMS.
When debugging the macro I saw that the Oracle 10 is set correctly in the function but after it's replaced by "SQL ANSI/ISO 9075:1992"
I had a look to the Target DBMS LegAttribute linked to the database MetaClass and saw that there is a _LegUpdateTool named "DatabaseDbmsVersionUpdateTool". I supposed it's that component which replace Oracle 10 by the SQL Ansi.
A solution would be to unlink the updatetool from the _LegAttribute.
But would it be the right solution ?
Thanks for your help
Regards,
Stephane
02-06-2016 03:26 PM - edited 02-06-2016 03:34 PM
Jerome,
I already tried the same code as you provided and it works but in the case of running it through a creation wizard the link created by the macro is replaced by the SQL Ansi.
I tried with the UpdateTool disconnected but I have the same result. Still have Oracle 10 replaced by SQL Ansi as DBMS Target.
Here is my code
'MegaContext(Fields,Types) 'Uses(Components) Option Explicit ' OnWizTerminate is called when pressing the finish button (or OK if only one page is displayed). ' to be implemented if you need some processings on the proceed action Sub OnWizTerminate(mwctxManager As MegaWizardContext) dim mObject as MegaObject dim mRoot as MegaRoot ' Récupération de l'objet créé set mObject = mwctxManager.Template ' Récupération du MegaRoot set mRoot = mwctxManager.Template.GetRoot ' Base SIPI ' Création du TableSpace "_D" mObject.getcollection("~WNxL8dbCl850[Groupement de données]").Add(mobject.getprop("Nom court") & "_D") ' Création du TableSpace "_X" mObject.getcollection("~WNxL8dbCl850[Groupement de données]").Add(mobject.getprop("Nom court") & "_X") ' Définition du SGBD Cible (Oracle 10) msgbox "before connect ==> nb RDBMS Target" & mObject.getcollection("~7LmfgYRJx0R0[SGBD cible]").count mObject.getcollection("~7LmfgYRJx0R0[SGBD cible]").add(mRoot.GetCollection("~4Mmf(XQJxe20[Version SGBD]").Item("Oracle 10")) msgbox "after connect ==> nb RDBMS Target" & mObject.getcollection("~7LmfgYRJx0R0[SGBD cible]").count msgbox mObject.getcollection("~7LmfgYRJx0R0[SGBD cible]")(1).Name End Sub
When creating a new Db, I saw those messages
Here is the history of an object created
We can see the disconnect Oracle 10
What would be the solution to have Oracle 10 as target at creation ?
Regards
Stephane
02-06-2016 02:32 PM
Hello Stephane
You can try to disconnect it temporarily and check if this has an effect.
However, I am not sure of that.
Note that the UdateTool does not prevent the update of the link 'Target DBMS' using API script.
Example (VB script)
Set oTargetDBMS = GetRoot.GetObjectFromId("~DySM6eLB9z00[Oracle 11]") Set cDatabase = GetCollection("Database") Set oDatabase = cDatabase.Add("MyDatabase") oDatabase.GetCollection("~7LmfgYRJx0R0[Target DBMS]").Add(oTargetDBMS)