...
Info |
---|
$Database.ExportToXml, and ,$Database.ImportFromXml, methods requires a unique primary key field on database table and data model. |
Map Function
Map function is used to transform values before saving. For example; encrypting a password before saving to database. See $Database.ImportFromXml for more details.
...
Code Block | ||
---|---|---|
| ||
$Database.ExportToXml({ TargetSchema : 'MySchema', TargetTable : 'Accounts', XPath : 'Accounts/Account', // map values whose names are not identical to SQL column names Map : function (accountXml) { thisaccountXml.SetValue('Password = 'Enc:' + ', this.Password; // mark as encrypted ); this.AccountType = accountXml.EvaluateSetValue('Type/Code', this.AccountType); // map values whose names are not identical to SQL column names } }); |
Example
Exporting database content into XML
...
Code Block | ||
---|---|---|
| ||
// Export corporations with the subcorporations Database$Database.ExportToXml({ Parameters : { TargetSchema : 'Evrak', TargetTable : 'Kurum' }, XPath : 'Corporations/Corporation', SubQueries : [ {Name : 'SubCorporations'} ] }); |
...