而不是创建,然后在 sqlite3 中删除一个表,我想创建一个临时表,该表在您结束会话时被销毁。是否可以组合下面的命令,以便临时表不会被分号破坏?
set databaseName to "test.db"
set tableName to "tempTable"
do shell script ("mkdir -p ~/Documents/Databases/ ; sqlite3 ~/Documents/Databases/" & databaseName & " \"create table if not exists " & tableName & "(First, Last); \"")
do shell script ("sqlite3 ~/Documents/Databases/" & databaseName & " \"insert into " & tableName & " (First, Last) values('John', 'Doe'); \"")
我将如何实现它的这个版本?
set databaseName to "test.db"
set tableName to "tempTable"
do shell script ("mkdir -p ~/Documents/Databases/ ; sqlite3 ~/Documents/Databases/" & databaseName & " \"create temp table " & tableName & "(First, Last); \"")
do shell script ("sqlite3 ~/Documents/Databases/" & databaseName & " \"insert into " & tableName & " (First, Last) values('John', 'Doe'); \"")