|
SQLite Authors: Newman Ch Published year: 2004 Pages: 74-77/118 |
ANSI SQL Commands and Features Not SupportedThe SQL language implemented by SQLite is fairly comprehensive; however, a few commands and features of the ANSI-92 specification are not available. ALTER TABLESQLite does not allow the schema of a table to be changed, so the ALTER TABLE command is not supported. To add, remove, or modify columns in a table, you must drop the table and re-create it with the revised schema. The usual way to do this is with a temporary table to hold the data from the old table while it is being re-created. COUNT(DISTINCT column- name )The DISTINCT keyword cannot appear inside a COUNT function. Instead you must use a nested subquery. SELECT COUNT(DISTINCT mycol) FROM mytable; becomes SELECT COUNT(*) FROM ( SELECT DISTINCT mycol FROM mytable ); GRANT and REVOKEBecause access to SQLite databases takes place at the filesystem level, the only permissions that can be applied are those available to the underlying operating system. Therefore the GRANT and REVOKE commands are meaningless for SQLite. INSERT, UPDATE, and DELETE on ViewsSQLite does not allow write actions to be performed directly on a view, even if there is only one base table in the view. However, a trigger can be created on a view using the INSTEAD OF syntax, in which you can perform the appropriate INSERT , UPDATE , or DELETE on the underlying table(s). RIGHT OUTER JOINLEFT OUTER JOIN is implemented, but not RIGHT OUTER JOIN . Therefore the table order in your queries must allow outer joins to be performed in this direction. CHECK and FOREIGN KEY ConstraintsAlthough the SQL syntax allows CHECK and FOREIGN KEY clauses to be included, they are ignored. They may be implemented in a future version. Trigger LimitationsSQLite does not support the FOR EACH STATEMENT type of trigger, or INSTEAD OF TRiggers on tables. INSTEAD OF TRiggers can only be used on views. Nested TransactionsOnly one transaction can be active at a time. The name argument to BEGIN TRANSACTION is ignored. Variable SubqueriesSQLite evaluates subqueries only once and therefore they cannot refer to variables in the main queryalso known as correlated subqueries. |
Appendix D. PHP Interface ReferenceThis appendix lists the PHP functions that can be used to communicate with a SQLite database. Further information and examples of usage submitted by users can often be found in the annotated PHP manual at http://www.php.net/manual/en/ref.sqlite.php. |
Predefined ConstantsFunctions that return an array of results can take an optional result_type argument to determine what type of array is created. These are the valid constants:
If no constant is specified, SQLITE_BOTH is assumed. |
Runtime ConfigurationIn php.ini the sqlite.assoc_case value affects the case of column names used for key values in associative arrays. It can take the following values:
The default behavior is to use mixed-case keys reflecting the natural case of the column headings. Using a setting of 1 or 2 will cause the case of the keys to be converted to uppercase or lowercase respectively. Using this option incurs a slight performance penalty, but if case-folding of array keys is required, it is much faster to do so at this level than to implement it in your code. |
|
SQLite Authors: Newman Ch Published year: 2004 Pages: 74-77/118 |
![]() Using SQLite | ![]() The Definitive Guide to SQLite | ![]() Beginning Database Design: From Novice to Professional | ![]() Hello, Android: Introducing Google's Mobile Development Platform (Pragmatic Programmers) |