Skip to Content
avatar image
Former Member

HANA Changing the type of a column

Hi All,

Can we change the data type of a column using any function in HANA using a calculated column...

There is a function called Date() which changes a date type of a field which is loaded from SLT into HANA(The fields loaded from SLT are by default given type as Nvarchar), but this function does not change the type of the field.

Is there a way to change the type of a field.

Thanks,

Sneha

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Jul 04, 2013 at 03:16 PM

    Do you mean to alter the type in the table?

    If so, you could use the ALTER command, check the alter_column_clause:

    http://help.sap.com/hana/html/sql_alter_table.html#alter_table_alter_column_clause

    CREATE TABLE t (a INT, b INT);ALTER TABLE t ALTER (b INT DEFAULT 10);

    If, alternatively, you mean to change the type just in the view, then you can achieve that in the calculated column.

    Note that you actually define the calculated column's type, so you can have the output in any format you want.

    Best regards,

    Henrique.

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 04, 2013 at 10:43 AM

    Hi Sneha,

    you can't modify the "deep" structure of a table (Names, SQL Data Types an Column Store Data Types).

    Cheers,

    Riccardo

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 04, 2013 at 02:07 PM

    Hi Sneha,

    The functions which you are referring to are the Conversion Functions that can be found under the 'Calculated Columns'.

    These functions actually create a new column in the views-NOT in the persistence layer(actual tables).

    These functions will just create a new column with the datatype you want.

    --Shreepad

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 04, 2013 at 02:19 PM

    If you wish to change the data type in the base tables, you may also go for changing the type in SAP LT configurations as well

    Refer the SAP LT configuration guides here http://help.sap.com/hana_appliance/

    Add comment
    10|10000 characters needed characters exceeded

  • May 24, 2016 at 01:15 AM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded