Generate Customized a Data Model or Data Dictionary

bhaskarc1289447

11-08-2019

I am using this code to Generate a data model. But here you get the data model for the whole database. Is there any way to get a data model out of a selective tables from DB

var strXslt = "nl:dbdToOdt.xsl"

var strTemplate = installDirectory("datakit/nl/dbd-template.odt")

var strOutputFile = "database-description.odt"

var sql = xtk.sqlSchema.create()

sql.Generate() //-----------> tables from whole database is taken. Can it be customized to take only a few tables

var strDbXml = db = sql.toXML().toXMLString()

var strOdt = applyXsl(strXslt, strDbXml)

strOdt = strOdt.replace(/^<\?xml .*\?>\r?\n/, '\r\n')

var mbContent = new MemoryBuffer

mbContent.fromString(strOdt, "utf-8")

var zip = new ZipFile(strTemplate)

zip.open()

zip.setEntry("content.xml", mbContent)

zip.save(strOutputFile)

Accepted Solutions (1)

Accepted Solutions (1)

Answers (3)

Answers (3)

bhaskarc1289447

19-11-2019

Thank you for your help.

i want to generate for 3-4 schemas in a single pdd. How to include those? Can the schemas be separated by comma? Also xtk.sqlSchema.create() generates WPPobject. Is it possible to generate WPPobject the for 3-4 schemas?

bhaskarc1289447

12-08-2019

Sorry, I used the wrong line as reference. i should have used this line

var sql = xtk.sqlSchema.create()

Here as we can see the whole of xtk.sqlSchema is used. Is there anyway that i can use my custom schemas to create the the object sql. I only need my custom schemas in that variable.Is it possible?

Is there any way I can pass the namespace in xtk.sqlSchema.create()?