Home » SQL & PL/SQL » SQL & PL/SQL » A challenging question (Oracle 9i,Windows XP)
A challenging question [message #381699] Mon, 19 January 2009 05:52 Go to next message
rakeshramm
Messages: 175
Registered: September 2006
Location: Oracle4u.com
Senior Member


create table DESIGN
(  MSLINK     NUMBER(10) not null,
  DEV_NAME   CHAR(25),
  DEV_TYPE   NUMBER(2),
  HSE_CNT    NUMBER(3),
  PREV_DEV   NUMBER(10),
  NEXT_DEV1  NUMBER(10),
  NEXT_DEV2  NUMBER(10),
  NEXT_DEV3  NUMBER(10),
  NEXT_DEV4  NUMBER(10) );

create index DESIGN_IDX_DSN_NEXT_DEV1 on DESIGN (NEXT_DEV1);
create index DESIGN_IDX_DSN_NEXT_DEV2 on DESIGN (NEXT_DEV2);
create index DESIGN_IDX_DSN_NEXT_DEV3 on DESIGN (NEXT_DEV3);
create index DESIGN_IDX_DSN_NEXT_DEV4 on DESIGN (NEXT_DEV4);
create index DESIGN_IDX_DSN_PREV_DEV on DESIGN (PREV_DEV);

 
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490108, 'FFT8-14K', 4, 8, 1004490107, 
    1004490402, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490110, 'FFT8-10TK', 4, 8, 1004490126, 
    0, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490111, '500 P3', 1, NULL, 1004490104, 
    1004490112, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490112, '500 P3', 1, NULL, 1004490111, 
    1004490113, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490113, 'FFT4-15.5K', 4, 4, 1004490112, 
    1004490114, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490114, 'SSP-7K', 2, NULL, 1004490113, 
    1004490115, 1004490116, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490115, 'OUTPUT1', 0, 0, 1004490114, 
    1004490117, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490116, 'OUTPUT2', 0, 0, 1004490114, 
    1004490119, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490117, '500 P3', 1, NULL, 1004490115, 
    1004490118, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490118, 'FFT8-10TK', 4, 8, 1004490117, 
    0, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490119, '500 P3', 1, NULL, 1004490116, 
    1004490120, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490120, 'FFT2-4TK', 4, 2, 1004490119, 
    0, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490121, 'SSP-7K', 2, NULL, 1004490106, 
    1004490122, 1004490123, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490122, 'OUTPUT1', 0, 0, 1004490121, 
    1004490126, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490123, 'OUTPUT2', 0, 0, 1004490121, 
    1004490124, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490124, '500 P3', 1, NULL, 1004490123, 
    1004490125, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490125, 'FFT4-7TK', 4, 4, 1004490124, 
    0, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490126, '500 P3', 1, NULL, 1004490122, 
    1004490110, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490127, '500 P3', 1, NULL, 1004490007, 
    1004490128, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490128, 'FFT8-17K', 4, 8, 1004490127, 
    1004490129, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490129, 'Tap', 9, NULL, 1004490128, 
    0, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490130, '500 P3', 1, NULL, 1004490371, 
    1004490368, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490134, 'FFT2-14K', 4, 2, 1004490375, 
    1004490135, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490135, '500 P3', 1, NULL, 1004490134, 
    1004490136, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490136, 'FFT2-12K', 4, 2, 1004490135, 
    1004490137, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490137, 'FFT8-10TK', 4, 8, 1004490136, 
    0, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490138, '500 P3', 1, NULL, 1004490369, 
    1004490139, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490139, 'SSP-3-636K', 3, NULL, 1004490138, 
    1004490140, 1004490141, 1004490142, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490140, 'OUTPUT1', 0, 0, 1004490139, 
    1004490169, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490141, 'OUTPUT2', 0, 0, 1004490139, 
    1004490183, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490142, 'OUTPUT3', 0, 0, 1004490139, 
    1004490143, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490143, 'BLE-7-750SH', 8, NULL, 1004490142, 
    1004490144, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490144, 'OUTPUT1', 0, 0, 1004490143, 
    1004490172, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490161, 'FFT8-10TK', 4, 8, 1004490180, 
    0, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490164, 'FFT8-20K', 4, 8, 1004490181, 
    1004490165, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490165, 'Tap', 9, NULL, 1004490164, 
    0, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490168, 'FFT8-10TK', 4, 8, 1004490182, 
    0, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490169, '500 P3', 1, NULL, 1004490140, 
    1004490170, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490170, 'FFT4-14K', 4, 4, 1004490169, 
    1004490171, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490171, 'FFT8-10TK', 4, 8, 1004490170, 
    0, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490172, 'SSP-12K', 2, NULL, 1004490144, 
    1004490173, 1004490174, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490173, 'OUTPUT1', 0, 0, 1004490172, 
    1004490182, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490174, 'OUTPUT2', 0, 0, 1004490172, 
    1004490175, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490175, '500 P3', 1, NULL, 1004490174, 
    1004490176, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490176, '500 P3', 1, NULL, 1004490175, 
    1004490177, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490177, 'SSP-9K', 2, NULL, 1004490176, 
    1004490178, 1004490179, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490178, 'OUTPUT1', 0, 0, 1004490177, 
    1004490181, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490179, 'OUTPUT2', 0, 0, 1004490177, 
    1004490180, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490180, '500 P3', 1, NULL, 1004490179, 
    1004490161, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490181, '500 P3', 1, NULL, 1004490178, 
    1004490164, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490182, '500 P3', 1, NULL, 1004490173, 
    1004490168, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490183, '500 P3', 1, NULL, 1004490141, 
    1004490184, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490184, '500 P3', 1, NULL, 1004490183, 
    1004490185, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490185, 'BTD-750H-SX', 8, NULL, 1004490184, 
    1004490186, 1004490187, 1004490188, 1004490189);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490186, 'OUTPUT1', 0, 0, 1004490185, 
    1004490190, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490187, 'OUTPUT2', 0, 0, 1004490185, 
    1004490223, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490188, 'OUTPUT3', 0, 0, 1004490185, 
    1004490381, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490189, 'OUTPUT4', 0, 0, 1004490185, 
    1004490387, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490190, '500 P3', 1, NULL, 1004490186, 
    1004490191, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490191, '500 P3', 1, NULL, 1004490190, 
    1004490192, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490192, '500 P3', 1, NULL, 1004490191, 
    1004490193, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490193, 'SSP-3K', 2, NULL, 1004490192, 
    1004490194, 1004490195, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490194, 'OUTPUT1', 0, 0, 1004490193, 
    1004490282, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490195, 'OUTPUT2', 0, 0, 1004490193, 
    1004490196, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490196, '500 P3', 1, NULL, 1004490195, 
    1004490197, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490197, 'FFT4-10K', 4, 4, 1004490196, 
    1004490198, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490003, NULL, NULL, NULL, NULL, 
    NULL, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490004, 'LA60V', NULL, NULL, NULL, 
    NULL, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490005, 'SG4000', 8, NULL, 0, 
    1004490006, 1004490007, 1004490008, 1004490009);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490006, 'OUTPUT1', 0, 0, 1004490005, 
    1004490010, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490007, 'OUTPUT2', 0, 0, 1004490005, 
    1004490127, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490008, 'OUTPUT3', 0, 0, 1004490005, 
    1004490371, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490009, 'OUTPUT4', 0, 0, 1004490005, 
    1004490401, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490010, '750 P3', 1, NULL, 1004490006, 
    1004490011, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490011, 'Express', 17, NULL, 1004490010, 
    1004490012, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490012, '500 P3', 1, NULL, 1004490011, 
    1004490013, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490013, 'FFT8-14K', 4, 8, 1004490012, 
    1004490014, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490014, '500 P3', 1, NULL, 1004490013, 
    1004490015, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490015, 'BLE-7-750SH', 8, NULL, 1004490014, 
    1004490016, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490016, 'OUTPUT1', 0, 0, 1004490015, 
    1004490017, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490017, 'SSP-12K', 2, NULL, 1004490016, 
    1004490018, 1004490019, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490018, 'OUTPUT1', 0, 0, 1004490017, 
    1004490024, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490019, 'OUTPUT2', 0, 0, 1004490017, 
    1004490020, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490020, 'FFT4-14K', 4, 4, 1004490019, 
    1004490021, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490021, '500 P3', 1, NULL, 1004490020, 
    1004490022, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490022, 'FFT2-10K', 4, 2, 1004490021, 
    1004490023, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490023, 'FFT8-10TK', 4, 8, 1004490022, 
    0, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490024, '500 P3', 1, NULL, 1004490018, 
    1004490025, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490025, 'FFTK-23K', 4, 4, 1004490024, 
    1004490026, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490026, '500 P3', 1, NULL, 1004490025, 
    1004490027, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490027, 'SSP-12K', 2, NULL, 1004490026, 
    1004490028, 1004490029, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490028, 'OUTPUT1', 0, 0, 1004490027, 
    1004490030, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490029, 'OUTPUT2', 0, 0, 1004490027, 
    1004490060, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490030, 'BLE-7-750SH', 8, NULL, 1004490028, 
    1004490031, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490031, 'OUTPUT1', 0, 0, 1004490030, 
    1004490032, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490032, 'FFT8-26K', 4, 8, 1004490031, 
    1004490033, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490033, 'SSP-3K', 2, NULL, 1004490032, 
    1004490034, 1004490035, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490034, 'OUTPUT1', 0, 0, 1004490033, 
    1004490040, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490035, 'OUTPUT2', 0, 0, 1004490033, 
    1004490036, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490036, 'SSP-3-636K', 3, NULL, 1004490035, 
    1004490037, 1004490038, 1004490039, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490037, 'OUTPUT1', 0, 0, 1004490036, 
    1004490058, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490038, 'OUTPUT2', 0, 0, 1004490036, 
    1004490054, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490039, 'OUTPUT3', 0, 0, 1004490036, 
    1004490052, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490040, '500 P3', 1, NULL, 1004490034, 
    1004490041, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490041, '500 P3', 1, NULL, 1004490040, 
    1004490042, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490042, 'FFT4-20K', 4, 4, 1004490041, 
    1004490043, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490043, 'SSP-3K', 2, NULL, 1004490042, 
    1004490044, 1004490045, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490044, 'OUTPUT1', 0, 0, 1004490043, 
    1004490046, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490045, 'OUTPUT2', 0, 0, 1004490043, 
    1004490049, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490046, '500 P3', 1, NULL, 1004490044, 
    1004490047, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490047, 'FFT2-12K', 4, 2, 1004490046, 
    1004490048, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490048, 'FFT8-10TK', 4, 8, 1004490047, 
    0, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490049, '500 P3', 1, NULL, 1004490045, 
    1004490050, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490050, 'FFT2-12K', 4, 2, 1004490049, 
    1004490051, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490051, 'FFT8-10TK', 4, 8, 1004490050, 
    0, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490052, '500 P3', 1, NULL, 1004490039, 
    1004490053, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490053, 'FFT8-10TK', 4, 8, 1004490052, 
    0, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490054, '500 P3', 1, NULL, 1004490038, 
    1004490055, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490055, 'FFT8-14K', 4, 8, 1004490054, 
    1004490056, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490056, '500 P3', 1, NULL, 1004490055, 
    1004490057, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490057, 'FFT8-10TK', 4, 8, 1004490056, 
    0, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490058, '500 P3', 1, NULL, 1004490037, 
    1004490059, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490059, 'FFT8-10TK', 4, 8, 1004490058, 
    0, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490060, '500 P3', 1, NULL, 1004490029, 
    1004490061, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490061, '500 P3', 1, NULL, 1004490060, 
    1004490062, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490062, '500 P3', 1, NULL, 1004490061, 
    1004490063, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490063, 'SSP-7K', 2, NULL, 1004490062, 
    1004490064, 1004490065, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490064, 'OUTPUT1', 0, 0, 1004490063, 
    1004490088, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490065, 'OUTPUT2', 0, 0, 1004490063, 
    1004490066, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490066, 'BLE-7-750SH', 8, NULL, 1004490065, 
    1004490067, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490067, 'OUTPUT1', 0, 0, 1004490066, 
    1004490068, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490068, 'SSP-3-636K', 3, NULL, 1004490067, 
    1004490069, 1004490070, 1004490071, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490069, 'OUTPUT1', 0, 0, 1004490068, 
    1004490072, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490070, 'OUTPUT2', 0, 0, 1004490068, 
    1004490076, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490071, 'OUTPUT3', 0, 0, 1004490068, 
    1004490084, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490072, '500 P3', 1, NULL, 1004490069, 
    1004490404, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490076, 'SSP-3K', 2, NULL, 1004490070, 
    1004490077, 1004490078, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490077, 'OUTPUT1', 0, 0, 1004490076, 
    1004490081, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490078, 'OUTPUT2', 0, 0, 1004490076, 
    1004490079, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490079, '500 P3', 1, NULL, 1004490078, 
    1004490080, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490080, 'FFT8-10TK', 4, 8, 1004490079, 
    0, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490081, '500 P3', 1, NULL, 1004490077, 
    1004490082, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490082, 'FFT2-12K', 4, 2, 1004490081, 
    1004490083, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490083, 'FFT8-10TK', 4, 8, 1004490082, 
    0, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490084, 'FFT4-20K', 4, 4, 1004490071, 
    1004490085, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490085, '500 P3', 1, NULL, 1004490084, 
    1004490086, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490086, 'FFT8-14K', 4, 8, 1004490085, 
    1004490087, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490087, 'FFT8-10TK', 4, 8, 1004490086, 
    0, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490088, '500 P3', 1, NULL, 1004490064, 
    1004490089, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490089, '500 P3', 1, NULL, 1004490088, 
    1004490090, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490090, 'BLE-7-750SH', 8, NULL, 1004490089, 
    1004490091, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490091, 'OUTPUT1', 0, 0, 1004490090, 
    1004490092, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490092, 'SSP-12K', 2, NULL, 1004490091, 
    1004490093, 1004490094, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490093, 'OUTPUT1', 0, 0, 1004490092, 
    1004490103, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490094, 'OUTPUT2', 0, 0, 1004490092, 
    1004490095, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490095, 'FFT4-14K', 4, 4, 1004490094, 
    1004490096, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490096, '500 P3', 1, NULL, 1004490095, 
    1004490097, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490097, 'FFT8-10TK', 4, 8, 1004490096, 
    0, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490098, '500 P3', 1, NULL, 1004490406, 
    1004490099, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490099, 'FFT8-10TK', 4, 8, 1004490098, 
    0, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490100, '500 P3', 1, NULL, 1004490405, 
    1004490101, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490101, 'FFT8-14K', 4, 8, 1004490100, 
    1004490102, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490102, 'FFT8-10TK', 4, 8, 1004490101, 
    0, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490103, 'SSP-3-636K', 3, NULL, 1004490093, 
    1004490104, 1004490105, 1004490106, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490104, 'OUTPUT1', 0, 0, 1004490103, 
    1004490111, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490105, 'OUTPUT2', 0, 0, 1004490103, 
    1004490107, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490106, 'OUTPUT3', 0, 0, 1004490103, 
    1004490121, 0, 0, 0);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490107, '500 P3', 1, 0, 1004490105, 
    1004490108, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490198, '500 P3', 1, NULL, 1004490197, 
    1004490199, NULL, NULL, NULL);
Insert into DESIGN
   (MSLINK, DEV_NAME, DEV_TYPE, HSE_CNT, PREV_DEV, 
    NEXT_DEV1, NEXT_DEV2, NEXT_DEV3, NEXT_DEV4)
 Values
   (1004490199, '500 P3', 1, NULL, 1004490198, 
    1004490200, NULL, NULL, NULL);
COMMIT;



what i want is ; i want the prev,next1,next2,next3 and next4 of mslink pf a

particular mslink say 1004490103 which ends with dev_type=1 but i can take

devtype=0 and again if there are prev,next1,next2,next3 and next4 for the

corresponding mslinks of 1004490103 and

if i give input as 1004490103 output want is those mslinks
--------------------

VC_MSLINKS

1004490089,1004490090,1004490091,1004490093,1004490095,
1004490096,1004490094,1004490092,1004490106,1004490121,1004490122,
004490124,1004490126,1004490123,1004490104,1004490111,1004490105,1004490107
Re: A challenging question [message #381703 is a reply to message #381699] Mon, 19 January 2009 06:00 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I don't understand the question.
Please explain in details each line of your output.

Regards
Michel
Re: A challenging question [message #381713 is a reply to message #381703] Mon, 19 January 2009 06:51 Go to previous messageGo to next message
rakeshramm
Messages: 175
Registered: September 2006
Location: Oracle4u.com
Senior Member

select replace(replace(substr(links,2,length(links)),',1004490103'),1004490103) links,
   stat, dev_type from (
      
select * from (SELECT * FROM
 (select SYS_CONNECT_BY_PATH (t.mslink,',') links ,
 length(SYS_CONNECT_BY_PATH (t.mslink,',')) len , 'PRE' STAT,
 SYS_CONNECT_BY_PATH (t.dev_type,',') dev_type
 from design t where (t.mslink =1004490103    )
 start with t.dev_type= 1 
 connect by prior  t.mslink= t.prev_dev )  order by len ASC )where rownum=1
 
 union 
 
select * from (select * from
 (select SYS_CONNECT_BY_PATH (t.mslink,',') links ,
 length(SYS_CONNECT_BY_PATH (t.mslink,',')) len ,'ND1' STAT, 
 SYS_CONNECT_BY_PATH (t.dev_type,',') dev_type
 from design t where t.mslink =1004490103   
 start with t.dev_type= 1
 connect by prior  t.mslink= t.next_dev1 )  order by len ASC )where rownum=1
 
  union 
 
select * from (select * from
 (select SYS_CONNECT_BY_PATH (t.mslink,',') links , 
 length(SYS_CONNECT_BY_PATH (t.mslink,',')) len ,'ND2' STAT, 
 SYS_CONNECT_BY_PATH (t.dev_type,',') dev_type
 from design t where t.mslink =1004490103
 -- start with t.dev_type= 1 
 connect by prior  t.mslink= t.next_dev2 )  order by len desc )where rownum=1
 
  union 
 
select * from (select * from
 (select SYS_CONNECT_BY_PATH (t.mslink,',') links ,
 length(SYS_CONNECT_BY_PATH (t.mslink,',')) len ,'ND3' STAT, 
 SYS_CONNECT_BY_PATH (t.dev_type,',') dev_type
 from design t where (t.mslink =1004490103 )
 -- start with t.dev_type=1
 connect by prior  t.mslink= t.next_dev3 )  order by len desc )where rownum=1
 
  union 
 
select * from (select * from
 (select SYS_CONNECT_BY_PATH (t.mslink,',') links ,
 length(SYS_CONNECT_BY_PATH (t.mslink,',')) len ,'ND4' STAT, 
 SYS_CONNECT_BY_PATH (t.dev_type,',') dev_type
 from design t where t.mslink =1004490103
-- start with t.dev_type= 1
 connect by prior  t.mslink= t.next_dev4 )  order by len desc )where rownum=1)

LINKS					               STAT  DEV_TYPE

1004490089,1004490090,1004490091,1004490092,1004490093 PRE  1,8,0,2,0,3	
						       ND4  ,3	
1004490105					       ND2  ,0,3	
1004490106					       ND3  ,0,3	
1004490111,1004490104				       ND1  ,1,0,3	

This is the query that i wrote but in this it is giving only the just prev_dev,next_dev1,next_dev2,next_dev3 and
next_dev4 of the mslink 1004490103 ,but what i want is if there is value for
prev_dev,next_dev1,next_dev2,next_dev3 and next_dev4 for any of those values in links (field in my query)
i want to get those prev_dev,next_dev1,next_dev2,next_dev3 and next_dev4 values also

[Updated on: Mon, 19 January 2009 06:53] by Moderator

Report message to a moderator

Re: A challenging question [message #381715 is a reply to message #381713] Mon, 19 January 2009 06:56 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This does not explain anything.

Regards
Michel
Re: A challenging question [message #381728 is a reply to message #381715] Mon, 19 January 2009 08:22 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Do you really need 170 records to get an idea of what to do?
You should spend some time to investigate how to create a small and representative testcase.
Often, creating such a testcase (what do I minimally need to mimick my actual problem) requires one to think about the problem and gives you new insights, leading to a solution!
Re: A challenging question [message #381765 is a reply to message #381699] Mon, 19 January 2009 12:46 Go to previous message
joy_division
Messages: 4644
Registered: February 2005
Location: East Coast USA
Senior Member
rakeshramm wrote on Mon, 19 January 2009 06:52
[code]

create table DESIGN
( MSLINK NUMBER(10) not null,
DEV_NAME CHAR(25),
...
Values
(1004490108, 'FFT8-14K', 4, 8, 1004490107,
...



CHAR is the incorrect datatype for a column of this type of data. VARCHAR2 is the correct datatype. I pointed this out to you before.
Previous Topic: about sql update
Next Topic: Extract CREATE TABLE statements from USER_TAB_COLUMNS
Goto Forum:
  


Current Time: Sat Dec 10 03:29:30 CST 2016

Total time taken to generate the page: 0.14617 seconds