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!

passing parameter to view.

ora_1978Mar 27 2018 — edited Mar 29 2018

I am opening another thread for the same functionality which i need to achieve using view.

view: create or replace view vw_1 as 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 * from data; select * from vw_1 where child = 31059;

DATA:

PARENT
CHILD
3105912345
NULL31059
3105941953
NULL112

expected o/p:

select * from vw_1 where child = 31059 :

parent
child
3105912345
null31059
3105941953
null112

select * from vw_1 where child = 12345 :

o/p:First record with child 12345

select * from vw_1 where child = 41953

o/p:

Only third record

select * from vw_1 where child = 112

o/p:

only last  record.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 26 2018
Added on Mar 27 2018
11 comments
380 views