Published on InterSystems Developer Community (https://community.intersystems.com)

Home > ALTER TABLE ALTER COLUMN RENAME Syntax

Question
Oleksandr Kyrylov · Feb 2, 2022

ALTER TABLE ALTER COLUMN RENAME Syntax

Hi everyone, i cant understand what is wrong in my query: 

ALTER TABLE MyNamespace.MyTable ALTER COLUMN CurrentColumnName RENAME NewColumnName

I just want to rename column name using sql.

I could not find any life example using this syntax.

SQLCODE for this query is -25:

-25 Input encountered after end of query

Quote from documentation:

  • Rename the column using the syntax ALTER TABLE tablename ALTER COLUMN oldname RENAME newname. Renaming a column changes the SQL field name. It does not change the corresponding persistent class property name. ALTER COLUMN oldname RENAME newname replaces oldfield name references in trigger code and ComputeCode.'
#SQL #InterSystems IRIS

Source URL:https://community.intersystems.com/post/alter-table-alter-column-rename-syntax