/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\ER_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_PLANEBILL_A') 
 CREATE TABLE T_ER_PLANEBILL_A (
FID BIGINT DEFAULT 0 NOT NULL,
FLOWESTPIRCE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FISLOWESTPIRCE CHAR(1) DEFAULT ' ' NOT NULL
);

EXEC P_ALTERPK 'PK_T_ER_PLANEBILL_A', 'T_ER_PLANEBILL_A', 'FID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_PLANEBILL_FLOW') CREATE INDEX IDX_ER_PLANEBILL_FLOW ON T_ER_PLANEBILL_A ( FISLOWESTPIRCE );


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_PLANECHECKINGBILL_A') 
 CREATE TABLE T_ER_PLANECHECKINGBILL_A (
FID BIGINT DEFAULT 0 NOT NULL,
FLOWESTPIRCE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FISLOWESTPIRCE CHAR(1) DEFAULT ' ' NOT NULL
);

 EXEC P_ALTERPK 'PK_T_ER_PLANECHECKINGBILL_A', 'T_ER_PLANECHECKINGBILL_A', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_PLANECB_A_FLOWE') CREATE INDEX IDX_ER_PLANECB_A_FLOWE ON T_ER_PLANECHECKINGBILL_A ( FISLOWESTPIRCE );


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