Class OCommandExecutorSQLResultsetAbstract

All Implemented Interfaces:
OCommandDistributedReplicateRequest, OCommandExecutor, OIterableRecordSource, Iterable<OIdentifiable>
Direct Known Subclasses:
OCommandExecutorSQLEarlyResultsetAbstract, OCommandExecutorSQLSelect, OCommandExecutorSQLTraverse

public abstract class OCommandExecutorSQLResultsetAbstract extends OCommandExecutorSQLAbstract implements OCommandDistributedReplicateRequest, Iterable<OIdentifiable>, OIterableRecordSource
Executes a TRAVERSE crossing records. Returns a List containing all the traversed records that match the WHERE condition.

SYNTAX: TRAVERSE * FROM WHERE

In the command context you've access to the variable $depth containing the depth level from the root node. This is useful to limit the traverse up to a level. For example to consider from the first depth level (0 is root node) to the third use: TRAVERSE children FROM #5:23 WHERE $depth BETWEEN 1 AND 3. To filter traversed records use it combined with a SELECT statement:

SELECT FROM (TRAVERSE children FROM #5:23 WHERE $depth BETWEEN 1 AND 3) WHERE city.name = 'Rome'

Author:
Luca Garulli (l.garulli--(at)--orientdb.com)