Creating a view using the START WITH / CONNECT BY PRIOR clause
Hi all,
I hope osmeone can help me out or point me into the correct direction here.
I created the following view...
My goal is to do a 'select * from VIEW1 where <something> = 1000000000' Making this so that the <something> gets placed into the START WITH clause.
Is this even possible ?
CREATE OR REPLACE FORCE VIEW "CPT_P2"."VIEW1" ("PART_ID", "PART_VERSION", "PROJ_REF", "MODEL_REF", "UNIT", "AS_MNT_REF", "I_LEVEL", "POS_NO", "QUANTITY", "C_ID_1", "C_ID_2")
AS
SELECT T_MASTER_DAT.PART_ID PART_ID,
T_MASTER_DAT.PART_VERSION PART_VERSION,
T_CMG_MCO_DAT.PROJ_REF PROJ_REF,
T_CMG_MCO_DAT.MODEL_REF MODEL_REF,
T_CMG_MCO_DAT.UNIT UNIT,
T_CMG_MCO_DAT.AS_MNT_REF AS_MNT_REF,
LEVEL I_LEVEL,
T_CMG_MCO_STR.POS_NO POS_NO,
T_CMG_MCO_STR.QUANTITY QUANTITY,
T_CMG_MCO_STR.C_ID_1 C_ID_1,
T_CMG_MCO_STR.C_ID_2 C_ID_2
FROM T_MASTER_DAT,
T_CMG_MCO_DAT,
T_CMG_MCO_STR
WHERE t_master_dat.edb_id = t_cmg_mco_dat.as_mnt_ref
AND t_cmg_mco_dat.c_id = t_cmg_mco_str.c_id_2
AND (t_master_dat.art_typ <> 'A'
AND t_master_dat.art_typ <> 'R')
START WITH t_cmg_mco_str.C_ID_1 = 1000000000
CONNECT BY prior t_cmg_mco_str.C_ID_2 = t_cmg_mco_str.C_ID_1
ORDER SIBLINGS BY t_cmg_mco_str.pos_no;
Thanks in advance for pointing me into the correct way.
Regards, Luc