From: danielk1977
You can read from and write to an attached database and you can modify the schema of the attached database. This is a new feature of SQLite version 3.0. In SQLite 2.8, schema changes -to attached databases were not allows.
+to attached databases were not allowed.You cannot create a new table with the same name as a table in an attached database, but you can attach a database which contains @@ -345,8 +345,7 @@ all CREATE INDEX statements are read from the sqlite_master table and used to regenerate SQLite's internal representation of the index layout.
-Indexes cannot be added on tables in attached databases. -Indexes are removed with the DROP INDEX +
Indexes are removed with the DROP INDEX command.
} @@ -359,7 +358,7 @@ CREATE [TEMP | TEMPORARY] TABLE If a
The optional conflict-clause following each constraint allows the specification of an alternative default constraint conflict resolution algorithm for that constraint. @@ -463,8 +468,7 @@ The text of CREATE TEMPORARY TABLE statements are stored in the
Tables are removed using the DROP TABLE -statement. Non-temporary tables in an attached database cannot be -dropped.
+statement. } @@ -628,7 +632,7 @@ attached database. Section {CREATE VIEW} {createview} Syntax {sql-command} { -CREATE [TEMP | TEMPORARY] VIEWIf the "TEMP" or "TEMPORARY" keyword occurs in between "CREATE" +and "TABLE" then the table that is created is only visible to the +process that opened the database and is automatically deleted when +the database is closed.
+ + If a
You cannot COPY, DELETE, INSERT or UPDATE a view. Views are read-only in SQLite. However, in many cases you can use a TRIGGER on the view to accomplish the same thing. Views are removed @@ -705,7 +720,7 @@ command.
Section {DROP TABLE} droptable Syntax {sql-command} { -DROP TABLEThe syntax for the ON CONFLICT clause is as shown above for -the CREATE TABLE, CREATE INDEX, and BEGIN TRANSACTION commands. -For the COPY, INSERT, and UPDATE commands, the keywords -"ON CONFLICT" are replaced by "OR", to make the syntax seem more -natural. But the meaning of the clause is the same either way.
+the CREATE TABLE and CREATE INDEX commands. For the COPY, INSERT, and +UPDATE commands, the keywords "ON CONFLICT" are replaced by "OR", to make +the syntax seem more natural. But the meaning of the clause is the same +either way.The ON CONFLICT clause specifies an algorithm used to resolve constraint conflicts. There are five choices: ROLLBACK, ABORT, @@ -1195,33 +1210,8 @@ value, then the ABORT algorithm is used.
statisfy a constraint, it does not invoke delete triggers on those rows. But that may change in a future release. - - - --The conflict resolution algorithm can be specified in three places, -in order from lowest to highest precedence: -
- --On individual constraints within a CREATE TABLE or CREATE INDEX -statement. -
-On a BEGIN TRANSACTION command. -
-In the OR clause of a COPY, INSERT, or UPDATE command. -
The algorithm specified in the OR clause of a COPY, INSERT, or UPDATE -overrides any algorithm specified on the BEGIN TRANSACTION command and -the algorithm specified on the BEGIN TRANSACTION command overrides the -algorithm specified in the a CREATE TABLE or CREATE INDEX. +overrides any algorithm specified in a CREATE TABLE or CREATE INDEX. If no algorithm is specified anywhere, the ABORT algorithm is used.
} @@ -1605,10 +1595,11 @@ inserts and deletes can leave the database file structure fragmented, which slows down disk access to the database contents. The VACUUM command cleans -the database by copying its contents to a temporary database file and +the main database by copying its contents to a temporary database file and reloading the original database file from the copy. This eliminates free pages, aligns table data to be contiguous, and otherwise cleans -up the database file structure. +up the database file structure. It is not possible to perform the same +process on an attached database file.This command will fail if there is an active transaction. This command has no effect on an in-memory database.