From: danielk1977
The LIKE operator does a pattern matching comparison. The operand +to the right contains the pattern, the left hand operand contains the +string to match against the pattern. +} +puts "A percent symbol [Operator %] in the pattern matches any +sequence of zero or more characters in the string. An underscore +[Operator _] in the pattern matches any single character in the +string. Any other character matches itself or it's lower/upper case +equivalent (i.e. case-insensitive matching). (A bug: SQLite only +understands upper/lower case for 7-bit Latin characters. Hence the +LIKE operator is case sensitive for 8-bit iso8859 characters or UTF-8 +characters. For example, the expression 'a' LIKE 'A' +is TRUE but 'æ' LIKE 'Æ' is FALSE.).
" + +puts { +If the optional ESCAPE clause is present, then the expression +following the ESCAPE keyword must evaluate to a string consisting of +a single character. This character may be used in the LIKE pattern +to include literal percent or underscore characters. The escape +character followed by a percent symbol, underscore or itself matches a +literal percent symbol, underscore or escape character in the string, +respectively. The infix LIKE operator is implemented by calling the +user function like(X,Y).
+} + +puts {The LIKE operator does a wildcard comparison. The operand to the right contains the wildcards.} puts "A percent symbol [Operator %] in the right operand matches any sequence of zero or more characters on the left. An underscore [Operator _] on the right matches any single character on the left." -puts {The LIKE operator is -not case sensitive and will match upper case characters on one -side against lower case characters on the other. + +puts { +The LIKE operator is not case sensitive and will match upper case +characters on one side against lower case characters on the other. (A bug: SQLite only understands upper/lower case for 7-bit Latin -characters. Hence the LIKE operator is case sensitive for -8-bit iso8859 characters or UTF-8 characters. For example, -the expression 'a' LIKE 'A' is TRUE but -'æ' LIKE 'Æ' is FALSE.). The infix -LIKE operator is identical the user function +characters. Hence the LIKE operator is case sensitive for 8-bit +iso8859 characters or UTF-8 characters. For example, the expression +'a' LIKE 'A' is TRUE but +'æ' LIKE 'Æ' is FALSE.). The infix LIKE +operator is identical the user function like(X,Y).
@@ -1067,13 +1097,20 @@ characters is returned, not the number of bytes.PRAGMA count_changes;
+
PRAGMA count_changes = 0 | 1;
Query or change the count-changes flag. Normally, when the + count-changes flag is not set, INSERT, UPDATE and DELETE statements + return no data. When count-changes is set, each of these commands + returns a single row of data consisting of one integer value - the + number of rows inserted, modified or deleted by the command. The + returned change count does not include any insertions, modifications + or deletions performed by triggers.
+PRAGMA default_cache_size;
PRAGMA default_cache_size = Number-of-pages;
PRAGMA default_synchronous;
-
PRAGMA default_synchronous = FULL; (2)
-
PRAGMA default_synchronous = NORMAL; (1)
-
PRAGMA default_synchronous = OFF; (0)
Query or change the setting of the "synchronous" flag in - the database. The first (query) form will return the setting as an + +
PRAGMA empty_result_callbacks;
+
PRAGMA empty_result_callbacks = 0 | 1;
Query or change the empty-result-callbacks flag.
+The empty-result-callbacks flag affects the sqlite3_exec API only. + Normally, when the empty-result-callbacks flag is cleared, the + callback function supplied to the sqlite3_exec() call is not invoked + for commands that return zero rows of data. When empty-result-callbacks + is set in this situation, the callback function is invoked exactly once, + with the third parameter set to 0 (NULL). This is to enable programs + that use the sqlite3_exec() API to retrieve column-names even when + a query returns no data. +
+ + +PRAGMA encoding;
+
PRAGMA encoding = "UTF-8";
+
PRAGMA encoding = "UTF-16";
+
PRAGMA encoding = "UTF-16le";
+
PRAGMA encoding = "UTF-16be";
In it's first form, if the main database has already been + created, then this pragma returns the text encoding used by the + main database, one of "UTF-8", "UTF-16le" (little-endian UTF-16 + encoding) or "UTF-16be" (big-endian UTF-16 encoding). If the main + database has not already been created, then the value returned is the + text encoding that will be used to create the main database, if + it is created by this session.
+The second and subsequent forms of this pragma are only useful if + the main database has not already been created. In this case the + pragma sets the encoding that the main database will be created with if + it is created by this session. The string "UTF-16" is interpreted + as "UTF-16 encoding using native machine byte-ordering".
+Databases created by the ATTACH command always use the same encoding + as the main database.
+PRAGMA full_column_names;
+
PRAGMA full_column_names = 0 | 1;
Query or change the full-column-names flag. This flag affects
+ the way SQLite names columns of data returned by SELECT statements
+ when the expression for the column is a table-column name or the
+ wildcard "*". Normally, such result columns are named
+
If both the short-column-names and full-column-names are set, + then the behaviour associated with the full-column-names flag is + exhibited. +
+PRAGMA page_size;
+
PRAGMA page_size = bytes;
Query or set the page-size of the database. The page-size + may only be set if the database has not yet been created. The page + size must be a power of two greater than or equal to 512 and less + than or equal to 8192. The upper limit may be modified by setting + the value of macro SQLITE_MAX_PAGE_SIZE during compilation. +
+PRAGMA full_column_names;
+
PRAGMA full_column_names = 0 | 1;
Query or change the short-column-names flag. This flag affects
+ the way SQLite names columns of data returned by SELECT statements
+ when the expression for the column is a table-column name or the
+ wildcard "*". Normally, such result columns are named
+
If both the short-column-names and full-column-names are set, + then the behaviour associated with the full-column-names flag is + exhibited. +
+PRAGMA synchronous;
+
PRAGMA synchronous = FULL; (2)
+
PRAGMA synchronous = NORMAL; (1)
+
PRAGMA synchronous = OFF; (0)
Query or change the setting of the "synchronous" flag. + The first (query) form will return the setting as an integer. When synchronous is FULL (2), the SQLite database engine will pause at critical moments to make sure that data has actually been written to the disk surface before continuing. This ensures that if @@ -148,57 +244,8 @@ puts { crashes or the computer loses power before that data has been written to the disk surface. On the other hand, some operations are as much as 50 or more times faster with synchronous OFF. -
-This pragma changes the synchronous mode persistently. Once changed, - the mode stays as set even if the database is closed and reopened. The - synchronous pragma does the same - thing but only applies the setting to the current session. -
PRAGMA default_temp_store;
-
PRAGMA default_temp_store = DEFAULT; (0)
-
PRAGMA default_temp_store = MEMORY; (2)
-
PRAGMA default_temp_store = FILE; (1)
Query or change the setting of the "temp_store" flag stored in - the database. When temp_store is DEFAULT (0), the compile-time value - of the symbol TEMP_STORE is used for the temporary database. - When temp_store is MEMORY (2), an in-memory database is used. - When temp_store is FILE (1), a temporary database file on disk will be used. - It is possible for the library compile-time symbol TEMP_STORE to override - this setting. The following table summarizes this:
- -| TEMP_STORE | temp_store | temp database location |
|---|---|---|
| 0 | any | file |
| 1 | 0 | file |
| 1 | 1 | file |
| 1 | 2 | memory |
| 2 | 0 | memory |
| 2 | 1 | file |
| 2 | 2 | memory |
| 3 | any | memory |
This pragma changes the temp_store mode for whenever the database - is opened in the future. The temp_store mode for the current session - is unchanged. Use the - temp_store pragma to change the - temp_store mode for the current session.
PRAGMA synchronous;
-
PRAGMA synchronous = FULL; (2)
-
PRAGMA synchronous = NORMAL; (1)
-
PRAGMA synchronous = OFF; (0)
Query or change the setting of the "synchronous" flag affecting - the database for the duration of the current database connection. - The synchronous flag reverts to its default value when the database - is closed and reopened. For additional information on the synchronous - flag, see the description of the - default_synchronous pragma.
-PRAGMA temp_store; @@ -211,14 +258,41 @@ puts { is closed and reopened. For additional information on the temp_store flag, see the description of the default_temp_store pragma. Note that it is possible for - the library compile-time options to override this setting. See - PRAGMA temp_store_directory - for further temporary storage options when FILE is specified.
+ the library compile-time options to override this setting. -When the temp_store setting is changed, all existing temporary - tables, indices, triggers, and viewers are immediately deleted. -
-PRAGMA temp_store;
+
PRAGMA temp_store = DEFAULT; (0)
+
PRAGMA temp_store = MEMORY; (2)
+
PRAGMA temp_store = FILE; (1)
Query or change the setting of the "temp_store" parameter. + When temp_store is DEFAULT (0), the compile-time value of the + symbol TEMP_STORE is used for the temporary database. When + temp_store is MEMORY (2), an in-memory database is used. + When temp_store is FILE (1), a temporary database file on disk + will be used. See PRAGMA + temp_store_directory for further temporary storage options when + FILE is specified. When the temp_store setting is changed, + all existing temporary tables, indices, triggers, and viewers are + immediately deleted.
+ +It is possible for the library compile-time symbol + TEMP_STORE to override this setting. The following table summarizes + this:
+ +| TEMP_STORE | temp_store | temp database location |
|---|---|---|
| 0 | any | file |
| 1 | 0 | file |
| 1 | 1 | file |
| 1 | 2 | memory |
| 2 | 0 | memory |
| 2 | 1 | file |
| 2 | 2 | memory |
| 3 | any | memory |
PRAGMA temp_store_directory;