/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\GL_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_AI_BIZVOUCHERSUBENTRY') 
 CREATE TABLE T_AI_BIZVOUCHERSUBENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FFLEXFIELD VARCHAR(50) DEFAULT ' ' NOT NULL,
FVALUE VARCHAR(100) DEFAULT ' ' NOT NULL
);

/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\GL_table.sql **/

/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\GL_constraint.sql **/

 EXEC P_ALTERPK 'PK_AI_BIZVOUCHERSUBENTRY', 'T_AI_BIZVOUCHERSUBENTRY', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_AI_BIZVOUCHERSUBENTRY_FK') CREATE INDEX IDX_AI_BIZVOUCHERSUBENTRY_FK ON T_AI_BIZVOUCHERSUBENTRY ( FENTRYID );
 

/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\GL_constraint.sql **/


