on 06-21-2019 8:33 AM
I'm trying to insert more than a single row into a table I have in HANA.
insert into TABLE ("NAME", "VALUE") values ('hi', 1), ('test', 42)
... is not working.
Any workarounds to this?
Thanks!
There is no syntax like you write it, but you could write it as following example:
create column table t1a (a integer);
insert into t1a (
select 0 from dummy
union
select 1 from dummy
);
Alternatively, you can use the batch interface for JDBC, like described here: https://stackoverflow.com/questions/41677436/is-it-possible-bulk-insert-in-hana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@sefan.linders2 Are there any limitations on the "insert into/select dummy/union" approach shown above in terms of number of rows or columns supported? Can anyone point me to an example that inserts at least 3 multi-column rows into a table?
The standard "insert into/values" SQL structure posted by danielbelfort has the distinct advantage of explicitly specifying which values map to which columns, which makes it less brittle in the face of multiple evolving environments.
Hi,
HANA does not support INSERT/UPDATE batching via a single SQL command.
Split your sintax:
INSERT INTO TABLE ("NAME", "VALUE") values ('hi', 1);
INSERT INTO TABLE ("NAME", "VALUE") values ('test', 42);
Regards.
Umberto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.