Is it possible to execute multiple views within a single stored procedure that feed off of each other? Here is an example.
I created following views:
CREATE OR REPLACE FORCE VIEW VIEW1 ( first_name, last_name, address )
AS Select First_Name, last_name, address from table1 Where Last_name=’SMITH’
CREATE OR REPLACE FORCE VIEW VIEW2 (names of columns....)
AS SELECT * FROM PEOPLE A WHERE EXISTS (SELECT * FROM VIEW1 B WHERE B.Address = A.Address);
There could be possible be a third view i.e. VIEW3 that could feed off of VIEW2 in the same store procedure.
My question is: How can I wrap 1,2,or 3 view in a single stored procedure that feed off each other?
Do I need to use Execute Immediate? If yes, what would be the syntax of this SP?
Thx,
Al
I created following views:
CREATE OR REPLACE FORCE VIEW VIEW1 ( first_name, last_name, address )
AS Select First_Name, last_name, address from table1 Where Last_name=’SMITH’
CREATE OR REPLACE FORCE VIEW VIEW2 (names of columns....)
AS SELECT * FROM PEOPLE A WHERE EXISTS (SELECT * FROM VIEW1 B WHERE B.Address = A.Address);
There could be possible be a third view i.e. VIEW3 that could feed off of VIEW2 in the same store procedure.
My question is: How can I wrap 1,2,or 3 view in a single stored procedure that feed off each other?
Do I need to use Execute Immediate? If yes, what would be the syntax of this SP?
Thx,
Al