Я пытаюсь скопировать данные из одной таблицы в другую в той же базе данных db2, используя эту команду:
INSERT INTO SCH.TAB1 (SOMEPK, GEOM)
SELECT SOMEPK, db2gse.ST_Geometry(GEOM) FROM SCH.TAB2
2 таблицы идентичны, за исключением того, что столбец TAB2 GEOM имеет тип данных st_geometry, в то время кактот же столбец в TAB1 - это VAR-CHAR, однако я хочу преобразовать данные в столбце GEOM
из текста в формат st_geometry
при копировании, но я получаю следующую ошибку:
SQL0408N A value is not compatible with the data type of its assignment target. Target name is "GEOM ".
Explanation:
The data type of the value to be assigned to the column, parameter, SQL
variable, or transition variable by the SQL statement is incompatible
with the declared data type of the assignment target.
The statement cannot be processed.
User response:
Examine the statement and possibly the target table or view to determine
the target data type. Ensure the variable, expression, or literal value
assigned has the proper data type for the assignment target.
For a user-defined structured type, also consider the parameter of the
TO SQL transform function defined in the transform group for the
statement as an assignment target.
sqlcode: -408