Skip to Content
0

Issue with Update Statement: Changing the row Position

Dec 05, 2016 at 08:49 AM

57

avatar image

Hi All,

Issue with Update Statement: Changing the row from the current position to Last Position After Update

I am performing a simple Update statement in HANA Table.
Before Update in my table i have values like below

SNO SVALUE
1 One
2 Two

Now am trying to update One with One-One using below syntax
update tablename set SVALUE = "One-One" where SNO = 1.

Now the table is updating like below
SNO SVALUE
2 Two
1 One-One.

Now my issue is the value is updating to the row which i want to apply.But the order of rows in the table is changing after update.

I am using HANA SPS 11 version of HANA System
Could anybody please help me to solve my issue.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Robert Waywell
Dec 07, 2016 at 07:49 PM
0

If you want the rows returned in a specific order, then you need to use an ORDER BY clause on you query.

Look for the <order_by_clause> section in the SELECT Statement documentaiton:

http://help.sap.com/saphelp_hanaplatform/helpdata/en/20/fcf24075191014a89e9dc7b8408b26/content.htm?frameset=/en/2e/1ef8b4f4554739959886e55d4c127b/frameset.htm¤t_toc=/en/2e/1ef8b4f4554739959886e55d4c127b/plain.htm&node_id=272

Share
10 |10000 characters needed characters left characters exceeded
Mantri Shekar Dec 12, 2016 at 10:21 AM
0

Hi Robert,

Yeah while fetching the records i can write order by to get the data.It is pretty clear.

Now my issue is why the rows in the table are changing their order while doing update or bulk insert.

I am facing this issue from along time.

Even while importing data from hana studio from an excel file it is importing all the data.But the order of rows in csv file and HANA Table are not matching.

But it is mandatory for our requirement to match the order of csv file and HANA Table.

For your information am importing 40 k plus records in a single go.

Regards,

Shekar

Share
10 |10000 characters needed characters left characters exceeded