Get Table Definition Operation (Magic xpa 2.x)
The Getdef operation is used to load data source definitions directly from an SQL table or an XML schema (XSD) into Magic xpa's Data repository.
When loading an SQL table, the operation has the following parameters:
Getdef, <database name>, <table name>, [<switches>]
database name – The name of the database that determines the table definition. This name should be defined in Magic xpa's Database settings.
table name – The full table name, including the owner name.
switches (optional) – The name of the folder where the table is created.
For example: Getdef, Mssql, dbo.GA_table, FolderName = folder1
When loading an XML schema, the operation has the following parameters:
Getdef, <XML Database>, <Schema URL>, [FolderName=<folder>] , [SchemaRoot=<global element>], [MainViewNode=<view element>], [All= <Y/N>]
Schema URL: Alphanumeric – Can be of any of the allowed protocols as in the online get-def (http, https, file system).
Global element: Alphanumeric – The name of a global element in the given schema.
View element: Alphanumeric – A path of a complex element or a repeatable simple element below the global element.
All: [Y] / N – When set to Y, all includable fields will be included in the view, such as ‘Address’ in the example below.
For example, the following operation:
GETDEF, Default XML Database, Store.xsd, FolderName = “MyFolder”, SchemaRoot=”Store”, MainViewNode=”\Store\Book”, All=” Y”
will generate a new view on the Book element below the Store global element into the Data repository, with all includable fields: Author (of Book) and Address (of Store).