cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

In MySQL, I can insert multiple rows of data with one insert statement by simply comma separating the VALUES part of the statement. How can I batch/bulk/multiple row insert into HANA with one INSERT statement?

0 Likes
View Entire Topic
Ravi_Channe
Active Contributor
0 Likes

Hi Kevin,

I don't think currently this feature is available in HANA, but you can use INSERT INTO .. SELECT statement for multiple rows insert.

May be as a work around you can use something like:

INSERT INTO ..

    (SELECT ... from dummy

     UNION

     SELECT... from dummy

     UNION

     SELECT... from dummy

      )

Regards,

Ravi

0 Likes

I just tried this with a HANA DB Version:

1.00.82.00.394270

where it works.

-Richard

lbreddemann
Active Contributor
0 Likes

Hi Richard,

the INSERT INTO (SELECT... ) approach always worked.

What's not possible with SAP HANA is something like this:

insert into users (user_name, user_id) values (('LARS', 1), ('PETER', 2));

Such multi-inserts are not supported by SAP HANA.

In case you do have a working example where this actually works, please share

- Lars

0 Likes

Ah, then I misunderstood your comment downthread. I considered the statement above to be a single SQL command, which may be wrong from a referential point of view. I am not too experienced in SQL therefore maybe the misunderstanding.