Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

alternative for start with using where clause

ora_1978Mar 27 2018 — edited Mar 28 2018

with data as (select 31059 parent,12345 child from dual union all select null,31059 from dual union all select 31059,41953 from dual union all select null,112 from dual ) select :input input,child   from data start with child = :input  The above query is perfectly working. No doubt that. I need something like below: with data as (select 31059 parent,12345 child from dual union all select null,31059 from dual union all select 31059,41953 from dual union all select null,112 from dual ) select parent,child   from data connect by prior child = parent where child = 31509. ---  is it possible to use the :input in the where clause instead of having it  here.  because the view gets called from the client side and the standard is to pass values from UI layer.  There are some restrictions to use in start with . so i am asking the condition in where clause instead of start with input: 31059 output 31059, 12345 null, 31059 31059, 41953 input : 112 o/p : null, 112

This post has been answered by Etbin on Mar 27 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 25 2018
Added on Mar 27 2018
9 comments
622 views