Creating a View Table

Spectrum Spatial™ Manager allows you to create a view table. A view table is a named table that is a query on one or more named tables. There are two ways in which you can create view tables. The first is Simple tab that allows you selecting a subset of columns from a single named table. You can rename them using aliases. The other way is using the Advanced tab. This is useful when you want to use an MI SQL query to return a particular view of the table.

Switching between the tabs mid-way is possible. The Spectrum Spatial™ Manager retains the data when you switch. For example, if you have selected a reference table in the Simple tab, you can see the corresponding query in the Advance tab and vice versa.

To create a view table in Spectrum Spatial™ Manager, Click View Table from the Create menu.

Select Simple or Advanced. The following sections describe each of these methods:

Using Simple Tab

Select the Simple tab and do the following:

  1. Click in the Reference Table to specify the reference table to be used in the view table MISQL query using the named resource picker dialog box.
  2. Select the column to be included in the view table. This list is populated only when the reference table is selected in the first step. Geometry type and and Style type columns are selected by default.
    Note:
    1. You can specify the alias names for each of the columns. You cannot use an alias name that is already in use.
    2. Alias cannot contain the following characters:
      ( " )
  3. Enter the desired View Table Name in the New View Table Name under Repository Info.
  4. Click in the Repository Folder under Repository Info. The pop up that opens allows you to pick an existing folder or create a new folder. Select a folder and then click Select.
  5. Click Create to complete the process.
Using Advanced Tab

Select the Advanced tab and do the following:

  1. Enter the MISQL query in the MISQL. Since the query contains a named table, you can create view tables for any datasource. The named table can have a datasource of different types such as TAB, XY, Oracle, SQL Server. Following is an example MISQL query:
    select Country, Capital, Obj from "/Samples/NamedTables/WorldcapTable" where Country='INDIA'
    For more information about MISQL commands and functions, refer to MapInfo SQL Language Reference. You can specify the alias names for the columns in the MISQL query. The alias needs to have double quotes.
  2. Click Validate to test the query. A message confirms if the query was executed successfully.
  3. Enter a suitable name for the view table in the New View Table Name. If the name you entered already exists, an error is displayed. Names are case sensitive and cannot contain the following characters:
    / \ : [ ] | * { } "
  4. Click in the Repository Folder under Repository Info. The pop up that opens allows you to pick an existing folder or create a new folder. Select a folder and then click Select.
  5. Click Create to complete the process.
Note:
  • If you entered a complex query in the Advance tab and switched to Simple tab, the Spectrum Spatial™ Manager displays a warning message. The query is retained by the Spectrum Spatial™ Manager. A complex query may contain ‘group by’, ‘order by’, ‘limit’ and ‘offset’, ‘MISQL functions’, ‘where clause’, ‘join’, and so on.
  • The Spectrum Spatial™ Manager does not warn you if your query is breaking the rendering of a layer or map when the view table does not contain the Obj (spatial) column in the query.