加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

shell – 从批处理文件自动创建SQLite数据库

发布时间:2020-12-15 21:50:49 所属栏目:安全 来源:网络整理
导读:在 Windows平台上,我有以下内容: schema.sql(包含sql脚本) sqlite3.exe(sqlite的命令shell – 从sqlite.org下载) build.bat:包含以下行的批处理文件:sqlite3.exe -init schema.sql default.db3 当我运行build.bat时,数据库按预期创建,但是,sqlite shell不
在 Windows平台上,我有以下内容:

> schema.sql(包含sql脚本)
> sqlite3.exe(sqlite的命令shell – >从sqlite.org下载)
> build.bat:包含以下行的批处理文件:sqlite3.exe -init schema.sql default.db3

当我运行build.bat时,数据库按预期创建,但是,sqlite shell不会自动终止.那么如何让批处理文件自动运行并终止sqlite命令shell呢?

例如.输出:

C:WorkXDatabase>sqlite3.exe -init schema.sql default.db3  
  -- Loading resources from schema.sql  
  SQLite version 3.7.4  
  Enter ".help" for instructions  
  Enter SQL statements terminated with a ";"  
  sqlite>

解决方法

试着这样称呼它:

echo .quit | sqlite3.exe

或者将.quit放在文件的末尾.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读