尝试通过PowerShell运行.sql文件

发布于 2025-02-08 11:02:22 字数 316 浏览 2 评论 0原文

您好,我正在尝试通过我的EX0.DB运行.sql文件,还添加了SQLite3 -echo,以便我可以看到哪些语句运行及其产生的内容。但是它不断给我这个错误...

命令:sqlite3 -echo -init ex7.sql ex0.db

ps c:\ users \ sasaz \ sasaz \ sqlite_driver \ sql_exes> sqlite3 -init -echo ex7.sql ex0.db 无法打开:“ -echo” 错误:在准备中,靠近“ ex0”:语法错误 ex0.db ^---错误,

但在一本书中,我正在从这个命令中学习完美工作

hello I am trying to run .sql file through my ex0.db and also I’m adding the sqlite3 -echo so I can see what statements run and what they produce. But it keeps giving me this error...

command: sqlite3 -echo -init ex7.sql ex0.db

PS C:\Users\sasaz\sqlite_driver\sql_exes> sqlite3 -init -echo ex7.sql ex0.db
cannot open: "-echo"
Error: in prepare, near "ex0": syntax error
ex0.db
^--- error here

but in a book i am learning from this command work perfectly

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

您已经在错误的示例中错误地添加了-echo在错误的位置。

正确命令:

sqlite3 -echo -init ex7.sql ex0.db

哪个根据手册将以这些参数读取:

  • > code >> -echo - 执行前打印命令
  • -init ex7.sql - 读取/处理文件“ ex7.sql”
  • ex0.db - sqlite的名称数据库

不正确命令:

sqlite3 -init -echo ex7.sql ex0.db

读取为:

  • -Init -echo - 读取/处理文件“ -echo”
  • ex7.sql - SQLITE数据库的名称
  • > ex0.db -sql执行

You've added the -echo in the wrong place by mistake in the example that's giving an error.

Correct command:

sqlite3 -echo -init ex7.sql ex0.db

Which according to the manual will be read as these arguments:

  • -echo - print commands before execution
  • -init ex7.sql - read/process the file "ex7.sql"
  • ex0.db - the name of an SQLite database

Incorrect command:

sqlite3 -init -echo ex7.sql ex0.db

Which is read as:

  • -init -echo - read/process the file "-echo"
  • ex7.sql - the name of an SQLite database
  • ex0.db - SQL to execute
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文