Creates a new column in a database table. The column specification contains a column name, data type with an optional default and check constraint for the new column – 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 table to add the column to. |
| column$ | Mandatory | Text | Column specification for the new column. |
Examples:
SELECT create_column('mytable','notes text'); -- creates column 'notes' in table 'mytable'.
SELECT create_column('mytable','count int default 0'); -- creates column 'count' with a default value.
Tips:
- The star$columns view lists existing columns in each table
Comments
Article is closed for comments.