Purpose
Applies all changes made to a table (all rows or as specified in the Where clause) in its parent workspace to a workspace in the database (Oracle 9i or later). You can issue this statement from the MapBasic window in MapInfo Pro.
Syntax
Server Workspace Refresh
Table TableName
[ Where WhereClause ]
[ { Interactive | Automatic merge_keyword } ]
TableName is the name (alias) of an open MapInfo table from an Oracle9i or later server. The table contains rows to be refreshed using values from its parent workspace.
WhereClause identifies the rows to be refreshed from the parent workspace. The clause itself should omit the WHERE keyword.
merge_keyword is a string representing keyword(s) that limit the Automatic refresh behavior.
Description
This statement only applies to Oracle9i or later. It applies to workspace all changes in rows that satisfy the WhereClause in the table in the parent workspace from the time the workspace was created or last refreshed. If there are conflicts between the workspace being refreshed and its parent workspace, this operation provides user options on how to solve the conflict. The refresh operation is executed only after all the conflicts are resolved. A table cannot be refreshed in the LIVE workspace (because that workspace has no parent workspace). A table cannot be merged or refreshed if there is an open database transaction affecting the table.
Refer to the Oracle9i Application Developer's Guide - Workspace Manager for more information.
WhereClause identifies the rows to be refreshed from the parent workspace. The clause itself should omit the WHERE keyword. For example, MI_PRINX = 20. Only primary key columns can be specified in the Where clause. The Where clause cannot contain a subquery. If WhereClause is not specified, all rows in TableName are refreshed.
If there are conflicts between the workspace being refreshed and its parent workspace, the user must resolve conflicts first in order for refreshing to succeed. MapInfo Pro allows the user to resolve the conflicts first and then to perform the refreshing within the process. The Interactive and Automatic clauses let you control what happens when there is a conflict. These clauses has no effect if there is no conflict between the workspace being refreshed and its parent workspace.
If the Interactive clause is specified, MapInfo Pro displays the Conflict Resolution dialog box in the event of a refresh conflict. The conflicts will be resolved one by one or all together based on user choices. After all the conflicts are resolved, the table is refreshed into its parent based on the user's choices.
The following table shows the possible values for merge_keyword used with the Automatic setting.
merge_keyword value | Description |
---|---|
StopOnConflict | In the event of a conflict, MapInfo Pro will stop here. (This is also the default behavior if the statement does not include an Interactive clause or an Automatic clause.) |
RevertToBase | In the event of a conflict, MapInfo Pro reverts to the original (base) values. (it causes the base rows to be copied to the child workspace but not to the parent workspace. However, the conflict is considered resolved; and when the child workspace is merged to it parent, the base rows will be copied to the parent workspace.) Note that BASE is ignored for insert―insert conflicts where a base row does not exist; in this case the Automatic parameter must be followed by UseParent or UseCurrent.) |
UseCurrent | In the event of a conflict, MapInfo Pro uses the child workspace values. |
UseParent | In the event of a conflict, MapInfo Pro uses the parent workspace values. |
Examples
The following example refreshes MIUSER by applying changes made to GWMUSA2 where MI_PRINX=60 in its parent workspace.
Server Workspace Refresh
Table "GWMUSA2"
Where "MI_PRINX = 60"
Automatic UseParent
See Also:
Server Workspace Merge statement