put_="column"

<do action_="sql" put_="column" schema_="[SCHEMA]" table_="[TABLE]" objname_="[COLUMN]" data_="{...}"/> updates a column with the specified properties.

Description

put_="column" updates the table properties specified in data_, and only those properties. The caller must be an admin of the schema [SCHEMA].

Syntax

<dynamic>
    <do action_="sql" put_="column"
     schema_="[SCHEMA]"
     table_="[TABLE]"
     objname_="[COLUMN]"
     rename_="[NEW_NAME]"
     data_="{...}r"/>
</dynamic>

Attributes for put_="column"

schema_
The schema where the table/column is located.
table_
The table where the column is located.
objname_
The column to update.
rename_
The new name of the column. This option is valid only if you have rename_schema or drop_schema privileges.
data_
The dictionary specified in data_ is the same format as returned by get_="column" and may contain any of the following keys.
name
The name of the column. The name cannot be blank or the same name as [COLUMN].
col
The MDB column name from the underlying table.
utype
The basic MDB datatype of the underlying column. utype can be one of the following values:
  • i (integer)
  • f (float)
  • a (alphanumeric)
  • j (bigint)
  • n (other)
type
Indicates the SQL datatype of the column. type can be one of the following values:
  • integer
  • double
  • bigint
  • varchar
  • text
  • date
  • timestamp
  • time
  • intervalytm
  • intervaldts
  • boolean
  • json
  • jsonb
unique
A boolean value. unique=1 if each value in the column is known to be unique (it is a key). Otherwise, unique=0.
sorted
A boolean value. sorted=1 if each value in the column is known to be sorted. Otherwise, sorted=0.
indexed
A boolean value. indexed=1 if the column is indexed. Otherwise, indexed=0.
width
An integer, which may be 0N (NA), and indicates the width of the column if known. This might be reported in metadata queries.
case
A boolean value. case=1 if the column should be treated as case-insensitive. Otherwise, case=0 (case-sensitive). This field may be 0N (NA) for numeric fields.
null
A boolean value. null=1 if the column may contain null (NA) entries. Otherwise, null=0 (null entries not permitted).
card
An approximation to the cardinality of the column, or the number of unique values in the column.

Additional information

The parameters for put_="schema", put_="table", or put_="column" may be specified in a package via the data_ attribute, or may be specified directly as attributes to the <do> action. For example, <do action_="sql" put_="schema" objname_=”foo” users_=”bar,baz”/> changes the user list of the schema. This is equivalent to <do action_=”sql” put_=”schema” objname_=”foo” data_=”{users:{'bar','baz'}}”/>).