Forum: Managing VoltDB

Post: sqlcmd scripting

sqlcmd scripting
Nov 25, 2015
Hi, is there a good way to run some sqlcmd statements from a shell script?
I want to do something like the following in one script, to start and prepare a Volt server with my schema:

voltdb create --host= .... etc...
sqlcmd --servers=myserver --port=51234
LOAD CLASSES myClasses.jar;
FILE schema.sql;

Any thoughts gratefully received...
Nov 25, 2015
We have a voter example that does this already:
Please feel free to use what you need to achieve your goals.

Specifically, the two options you'll want to take a look at is: server : start the server init : compile stored procedures and load the schema and stored procedures
Peter Zhao
Nov 27, 2015
Thanks Peter, that works fine:

sqlcmd --servers=myserver --port=50261 < myschema.sql

which will simply read the commands from the myschema.sql file.
But it looks like it will be faster with the -inlinebatch option in the myschema.sql file, which means we will have to upgrade from our current 5.0 version of VoltDB...