 UPDATE CATISSUE_SEARCH_DISPLAY_DATA SET ATTRIBUTE_ORDER = 9 WHERE RELATIONSHIP_ID=130 AND COL_ID=260;
 /*********************** Sachin: Setting the column/attribute order ENDS ************************/
 
+/************** 9 aug 2007 ***** for distribution array ***************************************/
+UPDATE CATISSUE_SEARCH_DISPLAY_DATA SET ATTRIBUTE_ORDER = 10 WHERE RELATIONSHIP_ID=131 AND COL_ID=72;
 
 
 

INSERT into CATISSUE_RELATED_TABLES_MAP values (75 , 9 , 'DISTRIBUTION_PROTOCOL_ID','IDENTIFIER');
INSERT INTO CATISSUE_SEARCH_DISPLAY_DATA (RELATIONSHIP_ID, COL_ID, DISPLAY_NAME, DEFAULT_VIEW_ATTRIBUTE) VALUES (124, 224, 'Distribution Protocol Title',1);

INSERT INTO CATISSUE_TABLE_RELATION (RELATIONSHIP_ID, PARENT_TABLE_ID, CHILD_TABLE_ID,TABLES_IN_PATH) values (127,75,70,'72');
INSERT INTO CATISSUE_SEARCH_DISPLAY_DATA (RELATIONSHIP_ID, COL_ID, DISPLAY_NAME, DEFAULT_VIEW_ATTRIBUTE) VALUES (127, 240, 'SpecimenArray Name',1);

INSERT INTO CATISSUE_TABLE_RELATION (RELATIONSHIP_ID, PARENT_TABLE_ID, CHILD_TABLE_ID,TABLES_IN_PATH) values (125,75,69,'71:72');
/*Removed for PHI bug*/
/*INSERT INTO CATISSUE_RELATED_TABLES_MAP(FIRST_TABLE_ID,SECOND_TABLE_ID,FIRST_TABLE_JOIN_COLUMN,SECOND_TABLE_JOIN_COLUMN) VALUES(72,69,'SPECIMEN_ARRAY_TYPE_ID','IDENTIFIER');*/
INSERT INTO CATISSUE_SEARCH_DISPLAY_DATA (RELATIONSHIP_ID, COL_ID, DISPLAY_NAME, DEFAULT_VIEW_ATTRIBUTE) VALUES (125, 307 , 'SpecimenArrayType Name',1);


/*changes added for array distribution */
INSERT INTO CATISSUE_QUERY_TABLE_DATA  ( TABLE_ID, TABLE_NAME, DISPLAY_NAME, ALIAS_NAME, PRIVILEGE_ID,FOR_SQI) values ( 75, 'CATISSUE_DISTRIBUTION', 'Distribution_array', 'Distribution_array',2,1);
INSERT INTO CATISSUE_TABLE_RELATION (RELATIONSHIP_ID, PARENT_TABLE_ID, CHILD_TABLE_ID, TABLES_IN_PATH) values (121,75,72,'37');
INSERT INTO CATISSUE_TABLE_RELATION (RELATIONSHIP_ID, PARENT_TABLE_ID, CHILD_TABLE_ID) values (122,75,75);
/* **********not required  INSERT INTO CATISSUE_RELATED_TABLES_MAP(FIRST_TABLE_ID,SECOND_TABLE_ID,FIRST_TABLE_JOIN_COLUMN,SECOND_TABLE_JOIN_COLUMN) VALUES(75,72,'IDENTIFIER','DISTRIBUTION_ID');*/
INSERT INTO CATISSUE_INTERFACE_COLUMN_DATA ( IDENTIFIER, TABLE_ID, COLUMN_NAME , ATTRIBUTE_TYPE ) values ( 321, 72, 'DISTRIBUTION_ID', 'bigint');
INSERT INTO CATISSUE_SEARCH_DISPLAY_DATA (RELATIONSHIP_ID, COL_ID, DISPLAY_NAME, DEFAULT_VIEW_ATTRIBUTE) VALUES (122, 327 , 'Distribution Id',1);

