SE_table_add_column |
Adds a column to a DBMS table
LONG SE_table_add_column
(SE_CONNECTION connection,
const CHAR *table,
const SE_COLUMN_DEF
*column_def);
connection | The connection handle |
table | The name of the table |
column_def | An SE_COLUMN_DEF structure defining the column |
SE_table_add_column adds a column to a DBMS table. The column is defined by an SE_COLUMN_DEF structure. A column definition is defined by:
typedef struct {
CHAR column_name[SE_MAX_COLUMN_LEN]; /* The column name */
LONG sde_type; /* The SDE data type */
LONG size; /* The size of the column values */
SHORT decimal_digits; /* Number of digits after decimal */
BOOL nulls_allowed; /* Allow NULL values */
SHORT row_id_type; /* The column's row id type. This parameter
is read-only. ArcSDE sets it internally whenever
the table is described. */
} SE_COLUMN_DEF;
The allowed column types (sde_type) are:
SE_INT16_TYPE /* 2-byte integer */
SE_INT32_TYPE /* 4-byte integer */
SE_INT64_TYPE /* 8-byte integer */
SE_FLOAT32_TYPE /* 4-byte float */
SE_FLOAT64_TYPE /* 8-byte float */
SE_STRING_TYPE /* NULL-terminated character array */
SE_NSTRING_TYPE /* Unicode NULL-terminated character array */
SE_BLOB_TYPE /* Variable length data */
SE_CLOB_TYPE /* Character variable length data */
SE_NCLOB_TYPE /* Unicode character variable length data */
SE_UUID_TYPE /* Universal Unique ID */
SE_XML_TYPE /* XML document */
SE_DATE_TYPE /* Struct tm date */
The following geometry abstract data types are supported for DB2 and Informix databases, as well as when using ST_Geometry storage in Oracle and PostgreSQL databases. The only exceptions are SE_CURVE_TYPE, SE_MULTICURVE_TYPE, SE_SURFACE_TYPE, and SE_MULTISURFACE_TYPE, which are not supported in the Oracle and PostgreSQL implementations.
SE_POINT_TYPE
SE_CURVE_TYPE
SE_LINESTRING_TYPE
SE_SURFACE_TYPE
SE_POLYGON_TYPE
SE_GEOMETRYCOLLECTION_TYPE
SE_MULTIPOINT_TYPE
SE_MULTICURVE_TYPE
SE_MULTILINESTRING_TYPE
SE_MULTIPOLYGON_TYPE
SE_MULTISURFACE_TYPE
SE_GEOMETRY_TYPE
The following types have been deprecated at ArcSDE 9.0.
SE_SMALLINT_TYPE /* Synonym of SE_INT16_TYPE */
SE_INTEGER_TYPE /* Synonym of SE_INT32_TYPE */
SE_FLOAT_TYPE /* Synonym of SE_FLOAT32_TYPE */
SE_DOUBLE_TYPE /* Synonym of SE_FLOAT64_TYPE */
You cannot create a column of type SE_SHAPE_TYPE with this function. If you wish to create a shape column, create it as an SE_INTEGER_TYPE and use SE_layer_create to spatially enable it.
You can use this function to create a column of type SE_UUID_TYPE, or you can use SE_table_add_uuid_column to add it.
Several restrictions exist on the size and decimal_digits variables. The integer types require that decimal_digits value is equal to zero, while float type need a decimal_digits value of greater than zero. The size also has required ranges. The following sample definitions are Oracle-specific but are similar for other DBMSs. Following that are links to the ArcGIS Server help topics specific to each DBMS.
SE_INT16_TYPE NUMBER(4,0)
SE_INT32_TYPE* NUMBER(10,0)
SE_FLOAT32_TYPE NUMBER(6,2)
SE_FLOAT32_TYPE NUMBER(15,4)
SE_STRING_TYPE VARCHAR2(255)
SE_BLOB_TYPE LONG RAW
*If the SE_INT32_TYPE integer value is greater 2,147,483,648 or less than -2,147,483,647 an overflow error is returned.
A comparison of ArcGIS, ArcSDE, and DB2 data types
A comparison of ArcGIS, ArcSDE, and Informix data types
A comparison of ArcGIS, ArcSDE, and Oracle data types
A comparison of ArcGIS, ArcSDE, and PostgreSQL data types
A comparison of ArcGIS, ArcSDE, and SQL Server data types
While ArcSDE 9.0 and later releases can manage SE_INT64_TYPE columns, they cannot yet be used with ArcGIS.
If you set the size and decimal_digits parameters of the SE_COLUMN_DEF structure as zeroes, the default values for the data type are used.
The row_id_type member of the SE_COLUMN_DEF structure is read only. ArcSDE sets this whenever the table is described, to return the properties of the columns. The row id column is set with a call to SE_reginfo_set_rowid_column followed by SE_registration_create.
The row id types are:
SE_REGISTRATION_ROW_ID_COLUMN_TYPE_SDE
SE_REGISTRATION_ROW_ID_COLUMN_TYPE_USER
SE_REGISTRATION_ROW_ID_COLUMN_TYPE_NONE
SE_SUCCESS
SE_CONNECTION_IN_USE
SE_CONNECTION_LOCKED
SE_DB_IO_ERROR
SE_INVALID_COLUMN_DEF
SE_INVALID_COLUMN_TYPE
SE_INVALID_CONNECTION
SE_INVALID_POINTER
SE_NET_FAILURE
SE_SDE_NOT_STARTED