PartiQL Reserved Keywords
The PartiQL language uses reserved keywords to parse and understand PartiQL statements.
In PartiQL language grammar reserved keywords cannot be used as non-delimited identifiers.
Example 1 shows queries that result in Syntax Error because FROM
is a Reserved Keyword in PartiQL:
SELECT t.FROM FROM <<{'ID': 1, 'FROM': 'NA'}, {'ID': 2, 'FROM': 'SA'}>> AS t;
-- Output: Syntax Error
-- A reference to a Reserved Keyword is case-insensitive
SELECT t.from FROM <<{'ID': 1, 'FROM': 'NA'}, {'ID': 2, 'FROM': 'SA'}>> AS t;
-- Output: Syntax Error
In order to use reserved keywords in your PartiQL statements, use quoted identifiers as Example 2 shows:
SELECT t."FROM" FROM <<{'ID': 1, 'FROM': 'NA'}, {'ID': 2, 'FROM': 'SA'}>> AS t;
-- Output: <<{'FROM': 'NA'}, {'FROM': 'SA'}>>
Note: In PartiQL, a Quoted Identifier is case-sensitive; because of this rule, no result will get returned from the query shown in Example 3 in the absence of schemas in the environment.
SELECT t."FROM" FROM <<{'ID': 1, 'from': 'NA'}, {'ID': 2, 'from': 'SA'}>> AS t;
-- Output: <<{}, {}>>
Reserved Keywords
Reserved keywords are yet to be formally defined in PartiQL Specification, therefore there may be some differences in different PartiQL implementations. |
ABSOLUTE |
ACTION |
ADD |
ALL |
ALLOCATE |
ALTER |
AND |
ANY |
ARE |
AS |
ASC |
ASSERTION |
AT |
AUTHORIZATION |
AVG |
BEGIN |
BETWEEN |
BIT |
BIT_LENGTH |
BY |
CAN_CAST |
CAN_LOSSLESS_CAST |
CASCADE |
CASCADED |
CASE |
CAST |
CATALOG |
CHAR |
CHARACTER |
CHARACTER_LENGTH |
CHAR_LENGTH |
CHECK |
CLOSE |
COALESCE |
COLLATE |
COLLATION |
COLUMN |
COMMIT |
CONFLICT |
CONNECT |
CONNECTION |
CONSTRAINT |
CONSTRAINTS |
CONTINUE |
CONVERT |
CORRESPONDING |
COUNT |
CREATE |
CROSS |
CURRENT |
CURRENT_DATE |
CURRENT_TIME |
CURRENT_TIMESTAMP |
CURRENT_USER |
CURSOR |
DATE |
DATE_ADD |
DATE_DIFF |
DEALLOCATE |
DEC |
DECIMAL |
DECLARE |
DEFAULT |
DEFERRABLE |
DEFERRED |
DELETE |
DESC |
DESCRIBE |
DESCRIPTOR |
DIAGNOSTICS |
DISCONNECT |
DISTINCT |
DO |
DOMAIN |
DOUBLE |
DROP |
ELSE |
END |
END-EXEC |
END_EXEC |
ESCAPE |
EXCEPT |
EXCEPTION |
EXCLUDED |
EXEC |
EXECUTE |
EXISTS |
EXPLAIN |
EXTERNAL |
EXTRACT |
FALSE |
FETCH |
FIRST |
FLOAT |
FOR |
FOREIGN |
FOUND |
FROM |
FULL |
GET |
GLOBAL |
GO |
GOTO |
GRANT |
GROUP |
HAVING |
IDENTITY |
IMMEDIATE |
IN |
INDEX |
INDICATOR |
INITIALLY |
INNER |
INPUT |
INSENSITIVE |
INSERT |
INT |
INTEGER |
INTERSECT |
INTERVAL |
INTO |
IS |
ISOLATION |
JOIN |
KEY |
LAG |
LANGUAGE |
LAST |
LATERAL |
LEAD |
LEFT |
LET |
LEVEL |
LIKE |
LIMIT |
LOCAL |
LOWER |
MATCH |
MAX |
MIN |
MISSING |
MODIFIED |
MODULE |
NAMES |
NATIONAL |
NATURAL |
NCHAR |
NEW |
NEXT |
NO |
NOT |
NOTHING |
NULL |
NULLIF |
NULLS |
NUMERIC |
OCTET_LENGTH |
OF |
OFFSET |
OLD |
ON |
ONLY |
OPEN |
OPTION |
OR |
ORDER |
OUTER |
OUTPUT |
OVER |
OVERLAPS |
OVERLAY |
PAD |
PARTIAL |
PARTITION |
PIVOT |
PLACING |
POSITION |
PRECISION |
PREPARE |
PRESERVE |
PRIMARY |
PRIOR |
PRIVILEGES |
PROCEDURE |
PUBLIC |
READ |
REAL |
REFERENCES |
RELATIVE |
REMOVE |
REPLACE |
RESTRICT |
RETURNING |
REVOKE |
RIGHT |
ROLLBACK |
ROWS |
SCHEMA |
SCROLL |
SECTION |
SELECT |
SESSION |
SESSION_USER |
SET |
SHORTEST |
SIZE |
SMALLINT |
SOME |
SPACE |
SQL |
SQLCODE |
SQLERROR |
SQLSTATE |
SUBSTRING |
SUM |
SYSTEM_USER |
TABLE |
TEMPORARY |
THEN |
TIME |
TIMESTAMP |
TO |
TRANSACTION |
TRANSLATE |
TRANSLATION |
TRIM |
TRUE |
UNION |
UNIQUE |
UNKNOWN |
UNPIVOT |
UPDATE |
UPPER |
UPSERT |
USAGE |
USER |
USING |
VALUE |
VALUES |
VARCHAR |
VARYING |
VIEW |
WHEN |
WHENEVER |
WHERE |
WITH |
WORK |
WRITE |