voltdb run sql file

Wesley13
• 阅读 610
  • Script files — You can run multiple queries or stored procedures in a single command using the file directive. The file directive takes a text file as an argument and executes all of the SQL queries and exec directives in the file as if they were entered interactively. Any showexplainrecall, or exit directives are ignored. For example, the following command processes all of the SQL queries and procedure invocations in the file myscript.sql:

    $ sqlcmd 1> file myscript.sql;

    If the file contains only data definition language (DDL) statements, you can also have the entire file processed as a batch by including the -batch argument:

    $ sqlcmd 1> file -batch myscript.sql;

    If a file or set of statements includes both DDL and DML statements, you can still batch process a group of DDL statements by enclosing the statements in afile -inlinebatch directive and the specified end marker. For example, in the following code the three CREATE PROCEDURE statements are processed as a batch:

    load classes myprocs.jar; file -inlinebatch END_OF_BATCH CREATE PROCEDURE FROM CLASS procs.AddEmployee; CREATE PROCEDURE FROM CLASS procs.ChangeDept; CREATE PROCEDURE FROM CLASS procs.PromoteEmployee; END_OF_BATCH

    Batch processing the DDL statements has two effects:

    • Batch processing can significantly improve performance since all of the schema changes are processed and distributed to the cluster nodes at one time, rather than individually for each statement.

    • The batch operates as a transaction, succeeding or failing as a unit. If any statement fails, all of the schema changes are rolled back.

  • Exit — When you are done with your interactive session, enter the exit directive to end the session and return to the shell prompt.

To run a sqlcmd command without starting the interactive prompt, you can pipe the command through standard input to the sqlcmd command. For example:

点赞
收藏
评论区
推荐文章
半臻 半臻
3年前
Python基础8——文件操作
16文件操作16.1文件操作的基本概念文件操作的步骤1.打开文件2.读、写文件3.关闭文件open函数,创建一个file对象,默认是以只读的方式打开read方法:一次性读取文件的所有内容write方法:将指定内容写入文件close方法:关闭文件file对象的属性flie.name文件的名称file.mode文件的访问模式file.closed
Wesley13 Wesley13
3年前
MySQL Load data
LOADDATALOW_PRIORITY|CONCURRENTLOCALINFILE'file_name.txt'REPLACE|IGNOREINTOTABLEtbl_nameFIELDSTERMINATE
Wesley13 Wesley13
3年前
P2P技术揭秘.P2P网络技术原理与典型系统开发
Modular.Java(2009.06)\.Craig.Walls.文字版.pdf:http://www.t00y.com/file/59501950(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fwww.t00y.com%2Ffile%2F59501950)\More.E
Stella981 Stella981
3年前
Context initialization failed
Contextinitializationfailedorg.springframework.beans.factory.BeanDefinitionStoreException:Invalidbeandefinitionwithname'dataSource'definedinURLjar:file:/G:/id
Stella981 Stella981
3年前
Apache Hive File
!(https://oscimg.oschina.net/oscnet/fb84aa43cd6d4fe8b2e4e1ef6869584a.jpg)ApacheHiveTM(文件存储格式)Hive文件存储格式主要包括以下几类:1、TEXTFILE2、SEQUENCEFILE3
Stella981 Stella981
3年前
Android蓝牙连接汽车OBD设备
//设备连接public class BluetoothConnect implements Runnable {    private static final UUID CONNECT_UUID  UUID.fromString("0000110100001000800000805F9B34FB");
Easter79 Easter79
3年前
This file has expired
错误如下:Fatalerror:Thisfilehasexpired.in/var/www/html/dispatch86/index.phponline0原因:该文件为Zend加密过得文件。ZendSafeguardStdio在加密文件的时候可以设置一个过期时间。解决方法:将文件重新加密。\
Stella981 Stella981
3年前
Cocos Creator 功能介绍
!file(https://oscimg.oschina.net/oscnet/up5c82e34c46fdacee075a4188f5cb754d.jpg"file")!file(https://oscimg.oschina.net/oscnet/up37362907f328bb3327eba4a7b22faf16.jpg"file")
Stella981 Stella981
3年前
File
一个磁盘路径为:D:\\A\\b,在类中书写路径的时候应该写成:D:\\\\A\\\\b,前面的/是帮后面的/转义。关于Java的File.separator在Windows下的路径分隔符和Linux下的路径分隔符是不一样的,当直接使用绝对路径时,跨平台会暴出“Nosuchfileordiretory”的异常。比如说要在temp目录下建立
Stella981 Stella981
3年前
Python计算大文件行数方法及性能比较
如何使用Python快速高效地统计出大文件的总行数,下面是一些实现方法和性能的比较。1.readline读所有行使用readlines方法读取所有行:defreadline_count(file_name):returnlen(open(file_name).readlines())