cancel
Showing results for 
Search instead for 
Did you mean: 

Alter Command in SQLScript SAP HANA

shivamshukla12
Contributor
0 Kudos

Hello Everyone,

I am trying the execute Alter command using SQL Console to change the Column type from NVARCHAR to SMALLINT in SAP HANA but i am getting the below error -

ALTER TABLE "TEST_TAB" ALTER (ID SMALLINT);

SAP DBTech JDBC: [7]: feature not supported: cannot modify column type from nvarchar to smallint: ID: line 1 col 31 (at pos 30)

is there any way out to rectify the above . SAP HANA Version SPS09.

Thanks,

Shivam

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor
0 Kudos

Hello Shivam,

in general altering the table column type from nvarchar to smallint is possible in case the values of the column can be converted to smallint (e.g. no characters, integers in smallint integer range, ...).

But it is not possible if the column is a key column. In that case the type conversion is not possible. As your column is called "ID" i assume that you try to change the type of a primary key column which is not possible.

Regards,

Florian

shivamshukla12
Contributor
0 Kudos

Hi Florian ,

Thanks for your reply , i executed the alter command on non key columns and find it working as i want ,

As you said if its convertible to smallint then only it will execute else it will throw attribute modify error .

Thanks a lot .

Thanks,

Shivam

Answers (0)