Creates a new database table. The column specification contains a column name, data type with an optional default and check constraint for each column in the table; with each column separated by a comma – using the same syntax as the column specification in a SQL CREATE TABLE statement.
Available in a network database and requires the star$define role.
Parameters:
| Name | Optional | Type | Description |
| table$ | Mandatory | Text | The name of the database table to be created. |
| columns$ | Mandatory | Text | Column specification for the table. |
| scope$ | Mandatory | Char | Scope of the table. |
Examples:
SELECT create_table('mytable','id int,name text','L'); -- creates local table 'mytable' with two columns.
Tips:
- The star$tables view indicates which tables already exist and their scope
- Qualify a table name with a schema if required in a specific schema
- The scope$ parameter must have a value of L, G or C (for local, global or central scope)
- The specification for a column is <name> <type> [<null>] [<default>] [<check>]
Comments
Article is closed for comments.