/**Begin D:\PDM_UPGRADE\PDM1\BEI_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BEI_QUERYTASK', 'T_BEI_QUERYTASK', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_QUERYTASK') CREATE INDEX IDX_BEI_QUERYTASK ON T_BEI_QUERYTASK ( FNUMBER );


 EXEC P_ALTERPK 'PK_T_BEI_QUERYTASK_L', 'T_BEI_QUERYTASK_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_QUERYTASK_L') CREATE INDEX IDX_BEI_QUERYTASK_L ON T_BEI_QUERYTASK_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_BEI_QUERYREQUEST', 'T_BEI_QUERYREQUEST', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_QUERYREQUEST') CREATE INDEX IDX_BEI_QUERYREQUEST ON T_BEI_QUERYREQUEST ( FTASKID );


 EXEC P_ALTERPK 'PK_T_BEI_QUERYREQUEST_A', 'T_BEI_QUERYREQUEST_A', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_QUERYREQUEST_A') CREATE INDEX IDX_BEI_QUERYREQUEST_A ON T_BEI_QUERYREQUEST_A ( FID );




/**End D:\PDM_UPGRADE\PDM1\BEI_constraint.sql **/
/**Begin D:\PDM_UPGRADE\PDM1\BEI_constraint.sql **/
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_QUERYREQUEST_S') CREATE INDEX IDX_BEI_QUERYREQUEST_S ON T_BEI_QUERYREQUEST ( FSTATUS );

 EXEC P_ALTERPK 'PK_T_BEI_QUERYTASK_H', 'T_BEI_QUERYTASK_H', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_QUERYTASK_H') CREATE INDEX IDX_BEI_QUERYTASK_H ON T_BEI_QUERYTASK_H ( FNUMBER );


 EXEC P_ALTERPK 'PK_T_BEI_QUERYTASK_H_L', 'T_BEI_QUERYTASK_H_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_QUERYTASK_H_L') CREATE INDEX IDX_BEI_QUERYTASK_H_L ON T_BEI_QUERYTASK_H_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_BEI_QUERYREQUEST_H', 'T_BEI_QUERYREQUEST_H', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_QUERYREQUEST_H') CREATE INDEX IDX_BEI_QUERYREQUEST_H ON T_BEI_QUERYREQUEST_H ( FTASKID );


 EXEC P_ALTERPK 'PK_T_BEI_QUERYREQUEST_A_H', 'T_BEI_QUERYREQUEST_A_H', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BEI_QUERYREQUEST_A_H') CREATE INDEX IDX_BEI_QUERYREQUEST_A_H ON T_BEI_QUERYREQUEST_A_H ( FID );



/**End D:\PDM_UPGRADE\PDM1\BEI_constraint.sql **/
