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

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG' AND KSQL_COL_NAME ='FISHROD')
 ALTER TABLE T_ORG_ORG ADD (FISHROD CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG' AND KSQL_COL_NAME ='FISHROP')
 ALTER TABLE T_ORG_ORG ADD (FISHROP CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG' AND KSQL_COL_NAME ='FISHRBG')
 ALTER TABLE T_ORG_ORG ADD (FISHRBG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG' AND KSQL_COL_NAME ='FISHRTR')
 ALTER TABLE T_ORG_ORG ADD (FISHRTR CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG' AND KSQL_COL_NAME ='FISHRPA')
 ALTER TABLE T_ORG_ORG ADD (FISHRPA CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG' AND KSQL_COL_NAME ='FISHRWT')
 ALTER TABLE T_ORG_ORG ADD (FISHRWT CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG' AND KSQL_COL_NAME ='FISHRCMP')
 ALTER TABLE T_ORG_ORG ADD (FISHRCMP CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG' AND KSQL_COL_NAME ='FISHRBS')
 ALTER TABLE T_ORG_ORG ADD (FISHRBS CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG' AND KSQL_COL_NAME ='FISHRPAY')
 ALTER TABLE T_ORG_ORG ADD (FISHRPAY CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG' AND KSQL_COL_NAME ='FISHRTAX')
 ALTER TABLE T_ORG_ORG ADD (FISHRTAX CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG' AND KSQL_COL_NAME ='FISHRSI')
 ALTER TABLE T_ORG_ORG ADD (FISHRSI CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG' AND KSQL_COL_NAME ='FISHRLTI')
 ALTER TABLE T_ORG_ORG ADD (FISHRLTI CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG' AND KSQL_COL_NAME ='FISHRBM')
 ALTER TABLE T_ORG_ORG ADD (FISHRBM CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG' AND KSQL_COL_NAME ='FISHRTD')
 ALTER TABLE T_ORG_ORG ADD (FISHRTD CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG' AND KSQL_COL_NAME ='FISHRTL')
 ALTER TABLE T_ORG_ORG ADD (FISHRTL CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG' AND KSQL_COL_NAME ='FISHRIP')
 ALTER TABLE T_ORG_ORG ADD (FISHRIP CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG' AND KSQL_COL_NAME ='FISHRSSC')
 ALTER TABLE T_ORG_ORG ADD (FISHRSSC CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG_H' AND KSQL_COL_NAME ='FISHROD')
 ALTER TABLE T_ORG_ORG_H ADD (FISHROD CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG_H' AND KSQL_COL_NAME ='FISHROP')
 ALTER TABLE T_ORG_ORG_H ADD (FISHROP CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG_H' AND KSQL_COL_NAME ='FISHRBG')
 ALTER TABLE T_ORG_ORG_H ADD (FISHRBG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG_H' AND KSQL_COL_NAME ='FISHRTR')
 ALTER TABLE T_ORG_ORG_H ADD (FISHRTR CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG_H' AND KSQL_COL_NAME ='FISHRPA')
 ALTER TABLE T_ORG_ORG_H ADD (FISHRPA CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG_H' AND KSQL_COL_NAME ='FISHRWT')
 ALTER TABLE T_ORG_ORG_H ADD (FISHRWT CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG_H' AND KSQL_COL_NAME ='FISHRCMP')
 ALTER TABLE T_ORG_ORG_H ADD (FISHRCMP CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG_H' AND KSQL_COL_NAME ='FISHRBS')
 ALTER TABLE T_ORG_ORG_H ADD (FISHRBS CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG_H' AND KSQL_COL_NAME ='FISHRPAY')
 ALTER TABLE T_ORG_ORG_H ADD (FISHRPAY CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG_H' AND KSQL_COL_NAME ='FISHRTAX')
 ALTER TABLE T_ORG_ORG_H ADD (FISHRTAX CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG_H' AND KSQL_COL_NAME ='FISHRSI')
 ALTER TABLE T_ORG_ORG_H ADD (FISHRSI CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG_H' AND KSQL_COL_NAME ='FISHRLTI')
 ALTER TABLE T_ORG_ORG_H ADD (FISHRLTI CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG_H' AND KSQL_COL_NAME ='FISHRBM')
 ALTER TABLE T_ORG_ORG_H ADD (FISHRBM CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG_H' AND KSQL_COL_NAME ='FISHRTD')
 ALTER TABLE T_ORG_ORG_H ADD (FISHRTD CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG_H' AND KSQL_COL_NAME ='FISHRTL')
 ALTER TABLE T_ORG_ORG_H ADD (FISHRTL CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG_H' AND KSQL_COL_NAME ='FISHRIP')
 ALTER TABLE T_ORG_ORG_H ADD (FISHRIP CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ORG_ORG_H' AND KSQL_COL_NAME ='FISHRSSC')
 ALTER TABLE T_ORG_ORG_H ADD (FISHRSSC CHAR(1) DEFAULT '0' NOT NULL );

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