User Guide > Creating and Querying Tables > Tables and Structures
  

Tables and Structures
As noted previously, a table is represented as an array of structures. Although it is not necessary to understand or use structures to use table functions, this section gives a brief overview of their relationship. For more information on structures, see Chapter 6: Working with Structures the PV‑WAVE Programmer’s Guide.
The basic syntax of structures is:
{Structure_name, Tag_Name1 : Tag_Def1 , ..., 
Tag_Namen : Tag_Defn }
The simplest way to refer to a field in a structure is:
Variable_Name.Tag_Name
When you create a table with BUILD_TABLE, the name of the table becomes the Variable_Name, and the columns are Tag_Names for the underlying structure. The actual name of the structure, Structure_Name, is assigned by the system. You can see this name when you list the table’s structure with the INFO command. (In the example shown in "Using INFO to View the Table Structure", this name is TABLE_0.)
You could print the values of one column of phone_data with the command:
PRINT, phone_data.EXT
To print the first fifteen phone extensions, you could enter the command:
PRINT, phone_data(0:14).EXT
Column names must be expressed in structure notation when used in the UNIQUE function. For example:
dates = UNIQUE(phone_data.DATE)
The UNIQUE function is described in the PV‑WAVE Reference.

Version 2017.1
Copyright © 2019, Rogue Wave Software, Inc. All Rights Reserved.