Groups
Groups
Sign in
Groups
Groups
H2 Database
Conversations
About
Send feedback
Help
How to execute SQL commands from standard input
36 views
Skip to first unread message
Martin Lichtin
unread,
Mar 28, 2018, 10:50:08 AM
3/28/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to H2 Database
Is there a way using either Shell or RunScript to execute SQL commands coming from standard input?
Pavel Goloborodko
unread,
Feb 15, 2020, 1:29:41 PM
2/15/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to H2 Database
This is how I do it:
cat script.sql | tail +6 | java -cp ~/Downloads/h2/bin/h2-1.4.200.jar org.h2.tools.RunScript -url "jdbc:h2:~/dev/app/db/h2tmp;MAX_MEMORY_UNDO=0;MAX_OPERATION_MEMORY=0;WRITE_DELAY=0;LOG=0;LOCK_MODE=0;UNDO_LOG=0;REFERENTIAL_INTEGRITY=FALSE" -user sa -script '/dev/stdin'
(I need to skip a few top lines from the backup for some reason)
Reply all
Reply to author
Forward
0 new messages