Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Update Top x rows of a table

$
0
0

Hello,

i need to update a ton or rows in a table and am trying to determine the fastest way to do this.

i'm looking at doing it in chunks but can't seem to get the syntax to work.

 

when i try the syntax that SAP suggests in the below article i get a Syntax error near top

 

UPDATE - SAP HANA SQL and System Views Reference - SAP Library

 

 

 

create local temporary table #testtab

(updated int,

request varchar(10),

idk varchar(5));

 

 

 

 

 

insert into #testtab values(0,'xxx','ter');

insert into #testtab values(0,'xxx','ter');

insert into #testtab values(0,'xxx','ter');

insert into #testtab values(0,'xxx','ter');

insert into #testtab values(0,'xxx','ter');

insert into #testtab values(0,'xxx','ter');

insert into #testtab values(0,'xxx','ter');

insert into #testtab values(0,'xxx','ter');

insert into #testtab values(0,'xxx','ter');

insert into #testtab values(0,'xxx','ter');

insert into #testtab values(0,'xxx','ter');

insert into #testtab values(0,'xxx','ter');

 

 

update top 5 #testtab set updated = 1 where request = 'XXX' and updated = 0

 

 

Could not execute 'update top 5 #testtab set updated = 1 where request = 'XXX' and updated = 0' in 19 ms 242 µs .

SAP DBTech JDBC: [257] (at 8): sql syntax error: incorrect syntax near "top": line 1 col 8 (at pos 8)


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>