Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

bulk insert in hana

0 Likes
3,127
  • SAP Managed Tags

Is it possible bulk insert in hana like

INSERTINTO tbl_name (a,b,c)VALUES(1,2,3),(4,5,6),(7,8,9);
2 REPLIES 2
Read only

Vitaliy-R
Developer Advocate
Developer Advocate
0 Likes
1,009
  • SAP Managed Tags

It is not in HANA's SQL syntax afaik.

But if you do it from Python, then you can do `executemany` (https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.04/en-US/d0c010fa5c4e4e4cba7b791cd1...)

Something like [there might be some syntax mistake in below snippet, but should give the idea]

rows = ((1,2,3),(4,5,6),(7,8,9))
parms = '?,?,?'
sql = 'INSERT INTO "tbl_name" VALUES ({})'.format(parms)
cursor.executemany(sql, rows)

Regards.

Read only

0 Likes
1,009
  • SAP Managed Tags

witalij I am using java / spring boot. One by one query is executing even I run batch statement.