/**Begin D:\scm_code\dev_scm\dbschema\imc\1.5\main\rim\pdm\20210730\RIM_table.sql **/
 EXEC p_AlterColumn 'T_RIM_INV_CUSTOM', 'FPAY_LIMIT_DATE', 'NVARCHAR(30)', 'NOT NULL', '1111', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_CUSTOM' AND KSQL_COL_NAME ='FDEPT_TAX_NO') 
 ALTER TABLE T_RIM_INV_CUSTOM ADD (FDEPT_TAX_NO NVARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_CUSTOM' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_RIM_INV_CUSTOM ADD (FREMARK NVARCHAR(300) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INVOICE' AND KSQL_COL_NAME ='FROLLOUT_REMARK') 
 ALTER TABLE T_RIM_INVOICE ADD (FROLLOUT_REMARK NVARCHAR(300) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INVOICE' AND KSQL_COL_NAME ='FACCOUNT_TAX_AMOUNT') 
 ALTER TABLE T_RIM_INVOICE ADD (FACCOUNT_TAX_AMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_INV_WARNING_DETAIL') 
 CREATE TABLE T_RIM_INV_WARNING_DETAIL (
FID BIGINT DEFAULT 0 NOT NULL,
FORG BIGINT DEFAULT 0 NOT NULL,
FSERIAL_NO VARCHAR(50) DEFAULT ' ' NOT NULL,
FWARNING_TYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FDETAIL_PERIOD VARCHAR(10) DEFAULT ' ' NOT NULL
);



/**End D:\scm_code\dev_scm\dbschema\imc\1.5\main\rim\pdm\20210730\RIM_table.sql **/
