Making SQLITESQLITE3 executable scripts

Making SQLITESQLITE3 executable scripts,第1张

概述Use "here document" statements to build complex script files with embedded SQL statements via the sqlite/sqlite3 utility. #! /usr/bin/env bash# execute some bash scripting commands heresqlite3 myd Use "here document" statements to build complex script files with embedded sql statements via the sqlite/sqlite3 utility.

#! /usr/bin/env bash# execute some bash scripting commands heresqlite3 mydatabase <<sql_ENTRY_TAG_1SELECT *   FROM mytable   WHERE somecondition='somevalue';sql_ENTRY_TAG_1# execute other bash scripting commands heresql_ENTRY_TAG_2SELECT *  FROM myothertable  WHERE someothercondition='someothervalue';sql_ENTRY_TAG_2

Note that being in a bash script means that you can expand $-variables insIDe the sql code directly. This is,however,not advised unless you can be sure that only trusted,competent people will run your code. Otherwise you'll be facing sql injection attacks. 总结

以上是内存溢出为你收集整理的Making SQLITE/SQLITE3 executable scripts全部内容,希望文章能够帮你解决Making SQLITE/SQLITE3 executable scripts所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/sjk/1176375.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-02
下一篇2022-06-02

发表评论

登录后才能评论

评论列表(0条)

    保存