Salesforce

DataViewToDataSource (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

DataViewToDataSource (Magic xpa 3.x)

Adds the current data view to a data source.

Syntax:

DataViewToDataSource (generation, task var names, destination data source number, destination data source name, destination columns names)

Parameters:

generation: Numeric. A number that represents the task's hierarchic position in the runtime task tree. 0 represents the current task, 1 its immediate ancestor, and so on.

task var names: Alpha. A comma-delimited list of all the names of the variables that will be exported. The variable names are the names referred to in the Field Description property of the column. These are case sensitive. Only variables from the current task can be used. An empty string means that all the task variables will be used.

destination data source number: Numeric. A number that represents the data source's sequence number in the Data repository, such as '3'DSOURCE.

destination data source name: This parameter is used as an alternative to number. If not needed, enter '' (two single quotation marks). If needed, enter an alpha string that represents the table specification. The string may contain a path. If the path is not indicated, Magic xpa assumes the current directory.

destination columns names: String. A comma-delimited list of all the names of the columns that will be updated in the destination data source.

  • This is the Magic column name, not the DB column name.

  • An empty string means that the same names defined in the task var names parameter will be used.

Returns:

Logical. Returns TRUE if the current data view was added to the data source and FALSE if it was not added.

If no records exist in the source table, the function returns TRUE.

Usage:

You can use this function in any of the following ways:

  1. In a Rich Client interactive task that browses the data – if you want to export the current data view.

  2. In a Rich Client non-interactive task – if you want to export data without browsing it.

    In this case, since the function itself generates and scans the data view, the task that holds the data view definition can end without scanning the records. This task can be defined as follows:

  1. Define the Main Data Source with the data source and ranges on columns according to the data you want to export.

  2. Call the function in the Task Suffix logic unit.

  3. Set the End task condition to Yes and the Evaluate condition to Before entering record. This way the task will not scan all of the records.

Note:

  • This function is supported for Rich Client tasks only.

  • The main data source and the destination data source cannot both be on the same side. This means that they cannot both be a server-side data source or both be a client-side data source.

  • If the destination data source does not exist, it will be created.

  • If a record exists in the destination data source, it will be updated. The retrieval of the record in the destination data source is done according to the destination data source position's unique index. If the position index is not a unique index, then it is done according to the first unique index.

  • When using this function, a unique index must be defined in the destination data source and all of the segments of the unique index must be selected.

  • When updating the server data source, the updates are done in a new physical transaction.

  • When updating a local data source:

    a. If there is no open transaction on the destination data source's database, a transaction will be opened before the insert begins and closed once the function is finished.
    b. If there is an opened transaction on the destination data source's database, the changes will be part of the transaction and they will be committed once the transaction is closed.

Exceptions:

This function is not supported for Web Service databases.

See also:

The Rich Client Samples project (program RRP02b and RDS01)

Since version:

2.4b

Reference
Attachment 
Attachment