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

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SCH_TASK' AND KSQL_COL_NAME ='FGROUPID') 
 ALTER TABLE T_SCH_TASK ADD (FGROUPID INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SCH_RETRYJOB') 
 CREATE TABLE T_SCH_RETRYJOB (
FSCHEDULEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FJOBID VARCHAR(36) DEFAULT ' ' NOT NULL,
FGROUPID INT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT '1' NOT NULL,
FRETRYTIME INT DEFAULT 0 NOT NULL,
FRUNMODE CHAR(1) DEFAULT '0' NOT NULL,
FBATCHTIME INT DEFAULT 0 NOT NULL,
FFIRSTFAILURETIME DATETIME,
FLATESTEXECUTIONTIME DATETIME,
FTASKINFO NCLOB
);

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