Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insert multiple rows as single statement #282

Open
sebastian-alfers opened this issue Nov 28, 2023 · 0 comments
Open

Insert multiple rows as single statement #282

sebastian-alfers opened this issue Nov 28, 2023 · 0 comments

Comments

@sebastian-alfers
Copy link

I am trying to insert something like this:

insert into table(id, db_timestamp) values (1, SYSDATETIME()), (2,SYSDATETIME());

Looking at the two rows, they have the same timestamp. When I do the same in code, the timestamps are different:

val insertSql = "insert into table(id, db_timestamp) values(@id, SYSDATETIME())"
connection
     .createStatement(insertSql)
     .bind("@id", 1).add()
     .bind("@id", 2).add()
     .execute()

Is it possible that the code above creates two separate statements, instead of combining them into a single insert with multiples values?

Any idea how to achieve this?

@sebastian-alfers sebastian-alfers changed the title Insert multiple rows Insert multiple rows as single statement Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant