public final class SQLiteSyntax
extends java.lang.Object
COLUMN_NOT_FOUND
= -1DELETE_ALL
= "1"
DELETE_FAILED
= -1INSERT_FAILED
= -1LREPLACE_FAILED
= -1LSELECT_ALL
= null
UPDATE_ALL
= "1"
UPDATE_FAILED
= -1SQL_ADD_COLUMN
= " ADD COLUMN "
SQL_ALTER_TABLE
= "ALTER TABLE "
SQL_COLUMN_DEFAULT
= " DEFAULT "
SQL_COLUMN_DEFAULT_NULL
= " DEFAULT NULL"
SQL_COLUMN_IS_KEYLIKE
= " UNIQUE NOT NULL"
SQL_COLUMN_NULLABLE
= " NULL"
SQL_COLUMN_NOT_NULLABLE
= " NOT NULL"
SQL_DELETE_FROM
= "DELETE FROM "
SQL_FROM
= " FROM "
SQL_GROUP_BY
= " GROUP BY "
SQL_HAVING
= " HAVING "
SQL_INSERT_INTO
= "INSERT INTO "
SQL_LIMIT
= " LIMIT "
SQLITE_NULL
= "NULL"
SQL_ORDER_BY
= " ORDER BY "
SQL_ORDER_ASC
= "ASC"
SQL_ORDER_DESC
= "DESC"
SQL_SELECT
= "SELECT "
SQL_SELECT_ALL_COLUMNS
= "*"
SQL_SET
= " SET "
SQL_UPDATE
= "UPDATE "
SQLITE_VAR
= "?"
SQL_WHERE
= " WHERE "
Note: SQL_COLUMN_DEFAULT
should not be used in conjunction
with SQL_COLUMN_DEFAULT_NULL
, which also includes the SQL
DEFAULT
keyword. Similarly, SQL_COLUMN_NOT_NULLABLE
should
not be used with SQL_COLUMN_IS_KEYLIKE
, which includes the same SQL
NOT NULL
clause.
SQLITE_TYPE_INT
= "INTEGER"
SQLITE_TYPE_TEXT
= "TEXT"
SQLITE_TYPE_REAL
= "REAL"
The static constants and methods that support marshalling of Boolean
values as integers in SQLite are not defined here; they are defined in
SQLitePortal
to keep the constants and methods in one place.
Modifier and Type | Field and Description |
---|---|
static int |
COLUMN_NOT_FOUND
Magic value returned by
Cursor.getColumnIndex(java.lang.String)
when a column doesn't exist. |
static java.lang.String |
DELETE_ALL
Magic value to be passed to
SQLiteDatabase.delete(java.lang.String, java.lang.String, java.lang.String[]) when we want the
method to return a count of the number of rows deleted. |
static int |
DELETE_FAILED
Similar to the standard magic number returned when an insertion query
fails (see
INSERT_FAILED , this return value from the execution
methods of
DeletionBuilder
indicates that the delete operation could not be carried out because of
an exception. |
static long |
INSERT_FAILED
Magic value returned by
SQLiteDatabase.insert(java.lang.String, java.lang.String, android.content.ContentValues) and related methods
when a row insertion fails. |
static long |
REPLACE_FAILED
Magic value returned by
SQLiteDatabase.replace(java.lang.String, java.lang.String, android.content.ContentValues) and related
methods when a row replacement fails. |
static java.lang.String |
SELECT_ALL
Magic value to be passed to
SQLiteDatabase.query(boolean, java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String) and related
methods when we want to select all rows, not the actual SQL syntax
to specify "all columns" in a SELECT statement. |
static java.lang.String |
SQL_ADD_COLUMN
Begins a SQL
ADD COLUMN clause in an ALTER TABLE
statement. |
static java.lang.String |
SQL_ALTER_TABLE
Begins a SQL
ALTER TABLE statement. |
static java.lang.String |
SQL_COLUMN_DEFAULT
Sets up the part of a column definition clause in which the default value
is specified
|
static java.lang.String |
SQL_COLUMN_DEFAULT_NULL
Defines a column with a null default value.
|
static java.lang.String |
SQL_COLUMN_IS_KEYLIKE
Defines a column as "key-like" — unique and not nullable.
|
static java.lang.String |
SQL_COLUMN_NOT_NULLABLE
Defines a column as not nullable.
|
static java.lang.String |
SQL_COLUMN_NULLABLE
Defines a column as nullable.
|
static java.lang.String |
SQL_DELETE_FROM
Begins a SQL
DELETE FROM statement. |
static java.lang.String |
SQL_FROM
Begins a
FROM clause in a SQL SELECT statement. |
static java.lang.String |
SQL_GROUP_BY
Begins a
GROUP BY clause in a SQL SELECT statement. |
static java.lang.String |
SQL_HAVING
Begins a
HAVING clause in a SQL SELECT statement. |
static java.lang.String |
SQL_INSERT_INTO
Begins a SQL
INSERT statement. |
static java.lang.String |
SQL_LIMIT
Begins a
LIMIT clause in a SQL SELECT statement. |
static java.lang.String |
SQL_ORDER_ASC
Specifies that a column should be ordered ascending.
|
static java.lang.String |
SQL_ORDER_BY
Begins an
ORDER BY clause in a SQL SELECT statement. |
static java.lang.String |
SQL_ORDER_DESC
Specifies that a column should be ordered descending.
|
static java.lang.String |
SQL_SELECT
Begins a SQL
SELECT operation. |
static java.lang.String |
SQL_SELECT_ALL_COLUMNS
SQL syntax to specify that all columns should be returned by a
SELECT statement. |
static java.lang.String |
SQL_SET
SQLite keyword for
INSERT and UPDATE queries that set
explicit column sets. |
static java.lang.String |
SQL_UPDATE
Begins a SQL
UPDATE operation. |
static java.lang.String |
SQL_WHERE
Begins a
WHERE clause in an SQL statement. |
static java.lang.String |
SQLITE_NULL
The string to be used in an SQLite statement to represent a null value.
|
static java.lang.String |
SQLITE_TYPE_INT
The data type token representing integer columns in SQLite.
|
static java.lang.String |
SQLITE_TYPE_REAL
The data type token representing decimal-numeric columns in SQLite.
|
static java.lang.String |
SQLITE_TYPE_TEXT
The data type token representing text columns in SQLite.
|
static java.lang.String |
SQLITE_VAR
The character that stands in for a variable value in the Android format
string that is passed to
SQLiteDatabase
query methods. |
static java.lang.String |
UPDATE_ALL
Magic value to be passed to
SQLiteDatabase.update(java.lang.String, android.content.ContentValues, java.lang.String, java.lang.String[]) and related
methods when we want to indiscriminately update all rows, and get a count
of the number of rows that were updated. |
static int |
UPDATE_FAILED
Similar to the standard magic number returned when an insertion query
fails (see
INSERT_FAILED , this return value from the execution
methods of
UpdateBuilder
indicates that the delete operation could not be carried out because of
an exception. |
public static final int COLUMN_NOT_FOUND
Cursor.getColumnIndex(java.lang.String)
when a column doesn't exist. (A column index of -1
indicates an
invalid state.)public static final java.lang.String DELETE_ALL
SQLiteDatabase.delete(java.lang.String, java.lang.String, java.lang.String[])
when we want the
method to return a count of the number of rows deleted. (A literal value
of 1
always matches as true
in a WHERE
clause.)
The Android documentation implies that passing null
as the
WHERE
clause will not return a count.public static final int DELETE_FAILED
INSERT_FAILED
, this return value from the execution
methods of
DeletionBuilder
indicates that the delete operation could not be carried out because of
an exception.public static final long INSERT_FAILED
SQLiteDatabase.insert(java.lang.String, java.lang.String, android.content.ContentValues)
and related methods
when a row insertion fails. (A value of -1
as the row ID
indicates an error state.)public static final long REPLACE_FAILED
SQLiteDatabase.replace(java.lang.String, java.lang.String, android.content.ContentValues)
and related
methods when a row replacement fails. (A value of -1
as the row
ID indicates an error state.)public static final java.lang.String SELECT_ALL
SQLiteDatabase.query(boolean, java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String)
and related
methods when we want to select all rows, not the actual SQL syntax
to specify "all columns" in a SELECT
statement.SQL_SELECT_ALL_COLUMNS
public static final java.lang.String UPDATE_ALL
SQLiteDatabase.update(java.lang.String, android.content.ContentValues, java.lang.String, java.lang.String[])
and related
methods when we want to indiscriminately update all rows, and get a count
of the number of rows that were updated. (A literal value of 1
always matches as true
in a WHERE
clause.)public static final int UPDATE_FAILED
INSERT_FAILED
, this return value from the execution
methods of
UpdateBuilder
indicates that the delete operation could not be carried out because of
an exception.public static final java.lang.String SQL_ADD_COLUMN
ADD COLUMN
clause in an ALTER TABLE
statement.public static final java.lang.String SQL_ALTER_TABLE
ALTER TABLE
statement.public static final java.lang.String SQL_COLUMN_DEFAULT
public static final java.lang.String SQL_COLUMN_DEFAULT_NULL
public static final java.lang.String SQL_COLUMN_IS_KEYLIKE
public static final java.lang.String SQL_COLUMN_NULLABLE
public static final java.lang.String SQL_COLUMN_NOT_NULLABLE
public static final java.lang.String SQL_DELETE_FROM
DELETE FROM
statement.public static final java.lang.String SQL_FROM
FROM
clause in a SQL SELECT
statement.public static final java.lang.String SQL_GROUP_BY
GROUP BY
clause in a SQL SELECT
statement.public static final java.lang.String SQL_HAVING
HAVING
clause in a SQL SELECT
statement.public static final java.lang.String SQL_INSERT_INTO
INSERT
statement.public static final java.lang.String SQL_LIMIT
LIMIT
clause in a SQL SELECT
statement.SelectionBuilder.NO_LIMIT
,
Constant Field Valuespublic static final java.lang.String SQLITE_NULL
public static final java.lang.String SQL_ORDER_BY
ORDER BY
clause in a SQL SELECT
statement.public static final java.lang.String SQL_ORDER_ASC
public static final java.lang.String SQL_ORDER_DESC
public static final java.lang.String SQL_SELECT
SELECT
operation.public static final java.lang.String SQL_SELECT_ALL_COLUMNS
SELECT
statement. This is the usual SQL asterisk wildcard
(*
), not the magic Android/SQLite parameter that would be
passed to a SQLiteDatabase.query(boolean, java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String)
invocation.SELECT_ALL
,
Constant Field Valuespublic static final java.lang.String SQL_SET
INSERT
and UPDATE
queries that set
explicit column sets.public static final java.lang.String SQL_UPDATE
UPDATE
operation.public static final java.lang.String SQLITE_VAR
SQLiteDatabase
query methods.public static final java.lang.String SQL_WHERE
WHERE
clause in an SQL statement.public static final java.lang.String SQLITE_TYPE_INT
public static final java.lang.String SQLITE_TYPE_TEXT
public static final java.lang.String SQLITE_TYPE_REAL