sqlite 쉘에서 sql 쿼리를 실행하기 위해 vbscript를 작성 중이며 .quit 또는 .exit를 사용해야하는지 궁금합니다. 이 vbscript를 실행하기 위해 작업 스케줄러에서 작업을 설정할 때 sqlite 쉘은 작업 스케줄러가 실행될 때마다 생성 된 새 인스턴스를 얻고 이로 인해 SQL 쿼리가 실행되지 않도록 적절하게 종료/종료하지 않습니다. vbscript를 두 번 클릭하면 정상적으로 실행되고 sqlite 셸이 정상적으로 존재합니다.sqlite에서 .quit와 .exit 사이에 차이점이 있습니까?
누군가 도와 드릴 수 있습니까?
VBScript를 :
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
코드를 붙여주십시오. vbscript는 sqlite 명령 줄 exe (sqlite3.exe)에 명령을 어떻게 입력합니까? –
@Tom, 코드는 다음과 같습니다. – eLearner