SQLite中的.quit和.exit之间有区别吗?
我正在编写一个VBScript脚本来在SQLite shell中执行SQL查询,不知道是否需要使用.quit或.exit 当我在task scheduler中设置任务以运行此VBScript脚本时,SQLite shell不会正确退出/退出,因此每次运行task scheduler时都会创建一个新实例,这会导致SQL查询无法执行。当我双击VBScript脚本时,它运行良好,SQLite shell优雅地存在 我怎样才能解决这个问题 剧本:SQLite中的.quit和.exit之间有区别吗?,sqlite,task,scheduler,exit,Sqlite,Task,Scheduler,Exit,我正在编写一个VBScript脚本来在SQLite shell中执行SQL查询,不知道是否需要使用.quit或.exit 当我在task scheduler中设置任务以运行此VBScript脚本时,SQLite shell不会正确退出/退出,因此每次运行task scheduler时都会创建一个新实例,这会导致SQL查询无法执行。当我双击VBScript脚本时,它运行良好,SQLite shell优雅地存在 我怎样才能解决这个问题 剧本: Dim objShell Dim main_databa
Dim objShell
Dim main_database_file, main_output_file, main_sqlite_file
Dim TAB, LINE
' Set default values here if necessary
main_database_file = "G:\example\data\reporting\lastmonth"
main_sqlite_file = "G:\example\sqlite-shell.exe"
main_output_file="G:\example\scripts\display-time.csv"
Set objShell = createObject("Wscript.Shell")
sql = "select * from project;"
objShell.Run """"& main_sqlite_file &"""" & """"& main_database_file &""""
WScript.Sleep(500)
objShell.Sendkeys(".separator ,{ENTER}")
objShell.Sendkeys(".headers ON{ENTER}")
objShell.Sendkeys(".output '" & main_output_file &"'{ENTER}")
objShell.Sendkeys(sql & "{ENTER}")
WScript.Sleep(500)
objShell.Sendkeys(".quit{ENTER}")
Set objShell = Nothing
嗯,根据,退出和退出的描述都是“退出这个程序”,所以我不这么认为,不。嗯,根据,退出和退出的描述都是“退出这个程序”,所以我不这么认为,不。我认为唯一的区别是
。退出在某些Unix系统上不起作用。我认为唯一的区别是。退出在某些Unix系统上不起作用。我同意杰克的观点,文档中没有说明任何区别。
但是,为什么不将命令导入命令行处理器呢?您可以创建包含上述每个步骤的“SQL”文件,然后执行单次运行命令:
类似(未测试!)
SQL文件:
.separator ,
.headers on
etc..
然后以以下方式运行此文件:
shell.run "sqlite-clp.exe mydb.db < sqlfile.sql"
shell.run“sqlite-clp.exe mydb.db
不需要任意超时,也可以传入参数
PS:问题可能是sendkeys在计划任务的上下文中运行我同意Jack的说法,文档中没有说明任何区别。
但是,为什么不将命令导入命令行处理器呢?您可以创建包含上述每个步骤的“SQL”文件,然后执行单次运行命令:
类似(未测试!)
SQL文件:
.separator ,
.headers on
etc..
然后以以下方式运行此文件:
shell.run "sqlite-clp.exe mydb.db < sqlfile.sql"
shell.run“sqlite-clp.exe mydb.db
不需要任意超时,也可以传入参数
PS:问题可能是sendkeys在计划任务的上下文中运行请粘贴一些代码。vbscript如何将命令输入sqlite命令行exe(sqlite3.exe)?请粘贴一些代码。vbscript是如何将命令输入sqlite命令行exe(sqlite3.exe)的?有趣的是,我不知道这一点。FWIW,.quit
似乎可以在SUSE Enterprise上使用SQLite版本3.7.7.1。有趣的是,我不知道这一点。FWIW,.quit
似乎可以在SUSE Enterprise上与SQLite版本3.7.7.1一起使用。