cancel
Showing results for 
Search instead for 
Did you mean: 

Database creation wizard - set Target DBMS

Contributor

Database creation wizard - set Target DBMS

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

2 REPLIES
MEGA

Re: Database creation wizard - set Target DBMS

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)

 

Jerome
Highlighted
Contributor

Re: Database creation wizard - set Target DBMS

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

message1.jpg

message2.jpg

message3.jpg

 

Here is the history of an object created

historique.jpg

 We can see the disconnect Oracle 10

 

What would be the solution to have Oracle 10 as target at creation ?

 

Regards

Stephane