|
Calling Sequence
|
|
GetAll(connection, cond1, cond2, ...)
GetKeys(connection, cond1, cond2, ...)
Count(connection, cond1, cond2, ...)
|
|
Parameters
|
|
connection
|
-
|
PersistentTable object created with the Open command
|
cond1, cond2, ...
|
-
|
expression sequence of conditions involving the column names of connection
|
|
|
|
|
Description
|
|
•
|
The GetAll command retrieves all rows from a PersistentTable object that satisfy all of the specified conditions. The result is a set of lists, one for each row. Each such list contains all values for one row.
|
•
|
The GetKeys command retrieves all rows from a PersistentTable object that satisfy all of the specified conditions. The result is a set of lists, one for each row. Each such list contains the primary key values for one row. This can be considerably faster than the GetAll command if there are many columns outside the primary key and many rows in the result.
|
•
|
The Count command counts all rows from a PersistentTable object that satisfy all of the specified conditions. The returned value is the number of such rows.
|
•
|
Each condition must have one of the following forms:
|
•
|
expr1 = expr2, expr1 <> expr2, expr1 < expr2, expr1 > expr2, expr1 <= expr2, expr1 >= expr2
|
|
where expr1 and expr2 are polynomial expressions in the column names of connection of types integer or float. These conditions are evaluated in the SQLite database engine, so Maple's standard rules for precision in floating-point arithmetic are not followed.
|
|
where c is a column name of connection of type anything or boolean. Boolean columns can only be compared to the constants true and false.
|
•
|
If you expect a particular query to occur frequently, it can be very beneficial to add a suitable index. See the Open command for how to do that.
|
|
|
Thread Safety
|
|
•
|
Persistent tables are in general thread safe as of Maple 2021; see the Thread Safety section of the PersistentTable overview page for more details and caveats.
|
|
|
Examples
|
|
| (1) |
>
|
|
| (2) |
If we omit all conditions, then all rows of the table are part of the result.
| (7) |
| (8) |
Here we demonstrate a simple equality condition.
>
|
|
| (10) |
>
|
|
>
|
|
More complicated conditions.
>
|
|
| (13) |
>
|
|
| (14) |
>
|
|
|
|
Compatibility
|
|
•
|
The PersistentTable[GetAll], PersistentTable[GetKeys] and PersistentTable[Count] commands were introduced in Maple 2021.
|
|
|
|