on 02-19-2014 11:57 AM
Hi,
I have created a table in hana through hana studio and inserted data.
Later I have added one more new column to that table,
Now I want to insert values only to that new column
What is the syntax for that.
Can any one help me in this.
Thanks In Advance
Hi All,
I tried in this way and it solved my problem.
I took whole table data in to excel and deleted the records in table.
Now I added new column to this excel and copied the data for it into the excel and then reloaded the data into table using flat file.
I got the required data in to my table.
But this went well as I have only few thousand records in my table.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kala,
For the Insertion :
create column table x ( a int, b int );
insert into x values (1,1);
insert into x values (2,2);
create column table y ( a int, b int );
insert into y values (1,1);
insert into y values (2,2);
For Update:
<update_column_name_list>> ::= ( <column_name>[{, <column_name>}...] ).
Try this as well.
Thanks.
Rajesh Bikkasani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please understand that in the relational world, if the table already contains data, then any additional column needs to be UPDATED. You can "insert" data only in one column in a table which already contains data using "update table" operation.
As mentioned, you can do one thing.. create another table dept_b with key columns and the additional columns like dept_id and salary and insert the data in the dept_b table. Then update your original DEPT table for the salary from dept_b table comparing the dept_id from both the tables.
As mentioned please refer to the syntax on the link mentioned below. It will help you learn HANA more effectively rather than asking for the "readymade" answer on the forum.
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please UPDATE the table with the data for the new column. So you need to do something like:
UPDATE DEPT set SALARY = value where DEPT_ID = dept_id_value;
UPDATE - SQL Reference - SAP Library
There are multiple ways to update. Refer to the documentation and use the appropriate option.
Regards,
Ravi
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.