0
而不是創建,然後在sqlite3中刪除一個表,我想創建一個臨時表,當您結束會話時會破壞它。是否可以合併下面的命令,以便臨時表不被分號破壞?結合多個shell命令在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'); \"")
完美,謝謝。 – adayzdone 2012-04-06 17:23:31