on 03-14-2013 9:50 PM
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?
Closing this one due to no action of the OP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kevin,
nope - HANA does not support INSERT/UPDATE batching via a single SQL command.
However, you can create command batches via JDBC (and I assume also ODBC, but haven't tested that).
- Lars
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This Jun 21, 2019 at 08:21 AM comment indicates that this sort of insert/update batching is now supported. If it is now supported, when did that change?
I'm using JDBC and would prefer to use prepared statements for these inserts. Unfortunately that is not an option due to performance problems.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.