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
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.
Hi Sneha,
you can't modify the "deep" structure of a table (Names, SQL Data Types an Column Store Data Types).
Cheers,
Riccardo
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
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 a comment