plsql-cop-cli icon indicating copy to clipboard operation
plsql-cop-cli copied to clipboard

Parse error when using graph_table with source or destination predicates

Open PhilippSalvisberg opened this issue 1 year ago • 0 comments

The following example works without parse errors:

select *
  from graph_table (students_graph
          match (p1 is person) -[e is friends]- (p2 is person)
          where p1.name = 'Mary'
          columns (
             e.friendship_id,
             e.meeting_date
          )
       )
 order by friendship_id;

However, parser errors are produced with source/destination predicates as in the next example:

select *
  from graph_table (students_graph
          match (p1 is person) -[e is friends]- (p2 is person)
          where p1.name = 'Mary'
          columns (
             e.friendship_id,
             e.meeting_date,
             case 
                when p1 is source of e then 
                   p1.name 
                else
                   p2.name 
             end as from_person,
             case 
                when p1 is destination of e then
                   p1.name
               else
                   p2.name 
             end as to_person
          )
       )
 order by friendship_id; 

PhilippSalvisberg avatar Jul 01 '24 13:07 PhilippSalvisberg