SSC-EWI-OR0038

Search clause removed from the with element statement.

Severity

Low

Description

The search_clause is employed to define the order in which rows are processed in a SELECT statement. This functionality allows for a customized traversal of the data, ensuring that the results are returned in a specific sequence based on the specified criteria. It is important to note, however, that this behavior, characterized by the search_clause, is not supported in Snowflake.

In databases such as Oracle, the search_clause is commonly used in conjunction with recursive queries or common table expressions (CTEs) to influence the sequence in which hierarchical data is explored. By designating a particular column or set of columns in the search_clause, you can control the depth-first or breadth-first traversal of the hierarchy, impacting the order in which rows are processed.

In Snowflake, search_clause message will be generated, and the search_clause is subsequently eliminated.

Example Code

Input Code:

IN -> Oracle_01.sql
WITH dup_hiredate(eid, emp_last, mgr_id, reportLevel, hire_date, job_id) AS 
(SELECT aValue from atable) SEARCH DEPTH FIRST BY hire_date SET order1 SELECT aValue from atable;

Output Code:

OUT -> Oracle_01.sql
WITH dup_hiredate(eid, emp_last, mgr_id, reportLevel, hire_date, job_id) AS
(
SELECT aValue from
atable
) !!!RESOLVE EWI!!! /*** SSC-EWI-OR0038 - SEARCH CLAUSE REMOVED FROM THE WITH ELEMENT STATEMENT ***/!!!
SELECT aValue from
atable;

Recommendation

Last updated