Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Create_Table subroutine ====== ==== Description ==== Creates native tables and their dictionaries. ==== Syntax ==== **Create_Table**(//locationlist, tablename, dictflag, databaseID, tableattributeslist, protectflag//) ==== Parameters ==== The Create_Table subroutine has the following parameters. ^Parameter^Description^^^ |//locationlist//|States the location of the existing table. Can be specified in either of the following ways:\\ \\ [ //location// ]\\ [ //location//, //table_type// ]\\ [ //location//, //table_type//, //control_table_path// ]//\\ volume_pointer_name//||| |//tablename//|The table or tables to create at the specified location.\\ \\ Do not attempt to create just a dictionary portion, by prefacing a table name with "DICT ". Use //dictflag//, below.||| |//Dictflag//|Set to true, in order to create only the dictionary part of a table. You can set up the structure of the dictionary before creating the data portion of the table.||| |//databaseID//|Specifies the database to which the table belongs. If null, //databaseID// defaults to the current database.||| |//tableattributeslist//|Table type-specific attributes passed as an @FM-delimited list.\\ \\ The following form specifies the file attributes for a Linear Hash table:\\ \\ [ //numrows//, //avgsize//, //numentries//, //framesize//, //resizethreshold// ]||| ||__Attribute__|__Description__|| ||//numrows//|Estimate of the number of rows in the table.|| ||//avgsize//|Average number of characters in a row, including the key (this does not set a maximum).|| ||//numentries//|Estimate of the number of dictionary rows (in other words, columns in the data table).|| ||//framesize//|Size of each frame in bytes. Default is 1024 bytes.|| ||//resizethreshold//|Percentage of how full primary space must be before the table is re-sized.|| |//protectflag//|If true, then control features (PROTECT.MFS) are added to the table. See also Control_On.\\ ||| |||||| ==== Remarks ==== You can use Create_Table to define alternate table attributes, but you cannot use it to define the table structure. Use [[get_status|Get_Status()]] to check for an error creating the table. If the user creating a table is not a database owner (System Administrator), then his name is prefixed to the table name, to identify the table as being owned by that user and therefore not available to everyone. To create a table using the toolset, use the table builder. If you must create a table programmatically: 1. Call Create_Table to create only the dictionary portion of a table. 2. Call Create_Table again, this time to create the data portion of the table. ==== See Also ==== [[alias_table|Alias_Table]], [[attach_table|Attach_Table]], [[copy_table|Copy_Table]] ==== Example ==== <code> /* Creates a Linear Hash table, CONTACTS, at the location defined by the volume pointer name MY_DATA on the CUSTOMERS database. The table attributes are set to an estimated 1,000 rows, an average row size of 400 bytes, an estimated 25 columns, a framesize of 1,024 bytes, and a resize threshold of 80 percent. */ Declare Subroutine Create_Table AttribList = "1000,400,25,1024,80" Convert "," to @FM in AttribList Create_Table ("MY_DATA", "CONTACTS", "", "CUSTOMERS", AttribList, "") </code> guides/programming/programmers_reference_manual/create_table.txt Last modified: 2024/06/19 20:20by 127.0.0.1