cancel
Showing results for 
Search instead for 
Did you mean: 

Add column to temporary table in hana

Dears

I have create and temporary table, and I need to alter this table to add a new column after a certain condition, is it possible to add column or no

I used this statement to alter

ALTER TABLE #TEMP add abc int;

when I execute the procedure this error appear

SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near "abc"

any help please is it possible to add new column to the temporary table or no.

thanks

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor
0 Kudos

First the syntax you used is incorrect. The columns to be added needs to be enclosed in brackets. E.g. ALTER TABLE myTable ADD ( abc int);

But in case for a local temporary table as you are using, an ALTER is not possible at all (for a global temporary table it would be possible). Check the list of the supported operations on global and local tempoary tables in the sections for global and local temporary tables within the official documentation for the CREATE TABLE statement.

Regards,
Florian

Answers (0)