博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
voltdb run sql file---run script files
阅读量:5870 次
发布时间:2019-06-19

本文共 1910 字,大约阅读时间需要 6 分钟。

hot3.png

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

    $ sqlcmd1> 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:

    $ sqlcmd1> 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_BATCHCREATE 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:

转载于:https://my.oschina.net/u/2308739/blog/734979

你可能感兴趣的文章
HTML5游戏引擎排行榜
查看>>
BC 2015在百度之星程序设计大赛 - 预赛(1)(矩形区域-旋转卡)
查看>>
ServletContentLIstener接口演示ServletContext的启动和初始化
查看>>
限时授权复制文件 1.0(2015.9.2更新)
查看>>
C++ 'dynamic_cast' and Java 'instanceof' 使用对比
查看>>
Android Studio 初探
查看>>
Jquery插件easyUi表单验证提交
查看>>
edge 浏览器中数字显示为链接
查看>>
MySQL命令执行sql文件的两种方法
查看>>
Python大数据依赖包安装
查看>>
均方根值(RMS)+ 均方根误差(RMSE)+标准差(Standard Deviation)
查看>>
Linux高性能server规划——处理池和线程池
查看>>
【Win10 应用开发】实现数据的增量加载
查看>>
mysql指定某行或者某列的排序
查看>>
关于网站备案的44个问题
查看>>
(android 源码下开发应用程序) 如何在 Android 各 level ( 包含 user space 與 kernel space ) 使用dump call stack的方法...
查看>>
loadrunner取出字符串的后面几位
查看>>
window 平台上面解决不能动态php_mysqli.dll
查看>>
MySQL 数据库双向同步复制
查看>>
@JVM内存模型(运行时数据区)
查看>>