voltdb run sql file

  • 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:

点赞
收藏

评论区

加载中...

相关推荐

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

Python基础8——文件操作

16文件操作16.1文件操作的基本概念文件操作的步骤1.打开文件2.读、写文件3.关闭文件open函数,创建一个file对象,默认是以只读的方式打开read方法:一次性读取文件的所有内容write方法:将指定内容写入文件close方法:关闭文件file对象的属性flie.name文件的名称file.mode文件的访问模式file.closed

MySQL Load data

LOADDATALOW_PRIORITY|CONCURRENTLOCALINFILE'file_name.txt'REPLACE|IGNOREINTOTABLEtbl_nameFIELDSTERMINATE

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

Context initialization failed

Contextinitializationfailedorg.springframework.beans.factory.BeanDefinitionStoreException:Invalidbeandefinitionwithname'dataSource'definedinURLjar:file:/G:/id

Apache Hive File

!(https://oscimg.oschina.net/oscnet/fb84aa43cd6d4fe8b2e4e1ef6869584a.jpg)ApacheHiveTM(文件存储格式)Hive文件存储格式主要包括以下几类:1、TEXTFILE2、SEQUENCEFILE3