/**Begin C:\PDM_UPGRADE\PDM1\PBD_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PBD_LINK' AND KSQL_COL_NAME IN ('FUSER')) 
 ALTER TABLE T_PBD_LINK ADD (FUSER VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PBD_SERVICE_RULE_FIN' AND KSQL_COL_NAME IN ('FINPUTTARGETCONSTANT')) 
 ALTER TABLE T_PBD_SERVICE_RULE_FIN ADD (FINPUTTARGETCONSTANT NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PBD_SERVICE_RULE_RIN' AND KSQL_COL_NAME IN ('FINPUTTARRULETCONSTANT')) 
 ALTER TABLE T_PBD_SERVICE_RULE_RIN ADD (FINPUTTARRULETCONSTANT NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PBD_SERVICE_RULE_ROUT' AND KSQL_COL_NAME IN ('FOUTPUTTARRULETCONSTANT')) 
 ALTER TABLE T_PBD_SERVICE_RULE_ROUT ADD (FOUTPUTTARRULETCONSTANT NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_SMONI_DATA') 
 CREATE TABLE T_PBD_SMONI_DATA (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FMONITORSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FSUPPLIERNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMONITORBEFORETIME DATETIME,
FMONITORAFTERTIME DATETIME,
FSUPPLIERMONITORID BIGINT DEFAULT 0 NOT NULL,
FCOMPANYGID BIGINT DEFAULT 0 NOT NULL,
FCOMPANYTOTAL INT DEFAULT 0 NOT NULL,
FBIGSHARETOTAL INT DEFAULT 0 NOT NULL,
FHOLDERTOTAL INT DEFAULT 0 NOT NULL,
FBRANCHTOTAL INT DEFAULT 0 NOT NULL,
FCOMPANYCHECKTOTAL INT DEFAULT 0 NOT NULL,
FNEWSTOTAL INT DEFAULT 0 NOT NULL,
FABNTOTAL INT DEFAULT 0 NOT NULL,
FILLEGALINFOTOTAL INT DEFAULT 0 NOT NULL,
FOPUNISHTOTAL INT DEFAULT 0 NOT NULL,
FPUNISHTOTAL INT DEFAULT 0 NOT NULL,
FKTANNOUNCEMENTTOTAL INT DEFAULT 0 NOT NULL,
FDISHONESTTOTAL INT DEFAULT 0 NOT NULL,
FEXECUTEETOTAL INT DEFAULT 0 NOT NULL,
FCOURTREGISTERTOTAL INT DEFAULT 0 NOT NULL,
FCOURTANNOTOTAL INT DEFAULT 0 NOT NULL,
FREMARK NVARCHAR(2000) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_SMONI_ABNENTITY') 
 CREATE TABLE T_PBD_SMONI_ABNENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FADBID BIGINT DEFAULT 0 NOT NULL,
FPUTDATE DATETIME,
FPUTDEPARTMENT NVARCHAR(200) DEFAULT ' ' NOT NULL,
FABNPUTREASON NVARCHAR(255) DEFAULT ' ' NOT NULL,
FABNPUTREASON_TAG NCLOB,
FREMOVEDATE DATETIME,
FABNREMOVEREASON NVARCHAR(255) DEFAULT ' ' NOT NULL,
FABNREMOVEREASON_TAG NCLOB,
FREMOVEDEPARTMENT NVARCHAR(200) DEFAULT ' ' NOT NULL,
FUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_SMONI_BRANCHENTITY') 
 CREATE TABLE T_PBD_SMONI_BRANCHENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FBRANCHID BIGINT DEFAULT 0 NOT NULL,
FBRANCHGID BIGINT DEFAULT 0 NOT NULL,
FBRANCHNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FLEGALPERSONNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FREGSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FESTIBLISHTIME DATETIME,
FUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_SMONI_CHECKENTITY') 
 CREATE TABLE T_PBD_SMONI_CHECKENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FCHECKID BIGINT DEFAULT 0 NOT NULL,
FCHECKDATE DATETIME,
FCHECKORG NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCHECKRESULT NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCHECKRESULT_TAG NCLOB,
FCHECKTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(1024) DEFAULT ' ' NOT NULL,
FUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_SMONI_NEWSENTITY') 
 CREATE TABLE T_PBD_SMONI_NEWSENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FDOCID VARCHAR(255) DEFAULT ' ' NOT NULL,
FNEWSTITLE NVARCHAR(200) DEFAULT ' ' NOT NULL,
FNEWSURL VARCHAR(300) DEFAULT ' ' NOT NULL,
FNEWSEMOTION VARCHAR(50) DEFAULT ' ' NOT NULL,
FNEWSSOURCE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_SMONI_COMENTITY') 
 CREATE TABLE T_PBD_SMONI_COMENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FCOMPANYID BIGINT DEFAULT 0 NOT NULL,
FCOMPANYITEM NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCOMPANYITEM_TAG NCLOB,
FCOMPANYBEFORE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCOMPANYBEFORE_TAG NCLOB,
FCOMPANYAFTER NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCOMPANYAFTER_TAG NCLOB,
FCHANGETIME DATETIME,
FUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_SMONI_BIGSHARENTITY') 
 CREATE TABLE T_PBD_SMONI_BIGSHARENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FHOLDERID BIGINT DEFAULT 0 NOT NULL,
FHOLDER NVARCHAR(255) DEFAULT ' ' NOT NULL,
FHOLDERBEFORE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_SMONI_ILLEGALENTITY') 
 CREATE TABLE T_PBD_SMONI_ILLEGALENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FILLEGALID BIGINT DEFAULT 0 NOT NULL,
FPUTDATE DATETIME,
FPUTREASON VARCHAR(255) DEFAULT ' ' NOT NULL,
FPUTREASON_TAG NCLOB,
FPUTDEPARTMENT VARCHAR(200) DEFAULT ' ' NOT NULL,
FREMOVEDATE DATETIME,
FREMOVEDEPARTMENT VARCHAR(200) DEFAULT ' ' NOT NULL,
FREMOVEREASON VARCHAR(255) DEFAULT ' ' NOT NULL,
FREMOVEREASON_TAG NCLOB,
FUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_SMONI_PUNISHENTITY') 
 CREATE TABLE T_PBD_SMONI_PUNISHENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FPUBLISHID BIGINT DEFAULT 0 NOT NULL,
FDECISIONDATE DATETIME,
FPUNISHNUMBER VARCHAR(500) DEFAULT ' ' NOT NULL,
FCONTENT NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCONTENT_TAG NCLOB,
FDEPARTMENTNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FPUNISHTYPE VARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(100) DEFAULT ' ' NOT NULL,
FPUBLISHDATE DATETIME,
FUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_SMONI_OPUNISHENTITY') 
 CREATE TABLE T_PBD_SMONI_OPUNISHENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FPUBLISHOID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FDECISIONDATE DATETIME,
FPUNISHNUMBER VARCHAR(500) DEFAULT ' ' NOT NULL,
FREASON NVARCHAR(255) DEFAULT ' ' NOT NULL,
FREASON_TAG NCLOB,
FCONTENT NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCONTENT_TAG NCLOB,
FDEPARTMENTNAME NVARCHAR(512) DEFAULT ' ' NOT NULL,
FTYPESECOND NVARCHAR(100) DEFAULT ' ' NOT NULL,
FTYPE VARCHAR(100) DEFAULT ' ' NOT NULL,
FAREANAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FEVIDENCE NVARCHAR(1000) DEFAULT ' ' NOT NULL,
FUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_SMONI_HOLDERENTITY') 
 CREATE TABLE T_PBD_SMONI_HOLDERENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FHOLDERID BIGINT DEFAULT 0 NOT NULL,
FHOLDERNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPERCENTBEFORE VARCHAR(50) DEFAULT ' ' NOT NULL,
FCAPITALBEFORE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPERCENT VARCHAR(50) DEFAULT ' ' NOT NULL,
FCAPITAL NVARCHAR(50) DEFAULT ' ' NOT NULL,
FUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_SMONI_COURTANENTITY') 
 CREATE TABLE T_PBD_SMONI_COURTANENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FCOURTANNOID BIGINT DEFAULT 0 NOT NULL,
FANNOUNCEID BIGINT DEFAULT 0 NOT NULL,
FBLTNNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FPARTY1 NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FPARTY2 NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FBLTNSTATE VARCHAR(50) DEFAULT ' ' NOT NULL,
FBLTNTYPENAME VARCHAR(255) DEFAULT ' ' NOT NULL,
FBLTNTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FBLTNCOURTCODE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBLTNCASENO VARCHAR(200) DEFAULT ' ' NOT NULL,
FBLTNJUDGE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBLTNPROVINCE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBLTNDEALGRADE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBLTNDEALGRADENAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBLTNCONTENT_TAG NCLOB,
FBLTNCONTENT NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FBLTNPUBLISHPAGE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBLTNREASON NVARCHAR(500) DEFAULT ' ' NOT NULL,
FBLTNPUBLISHDATE DATETIME,
FUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_SMONI_COURTREENTITY') 
 CREATE TABLE T_PBD_SMONI_COURTREENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FCOURTREGID BIGINT DEFAULT 0 NOT NULL,
FCOURTREGCASENO VARCHAR(50) DEFAULT ' ' NOT NULL,
FFILINGDATE DATETIME,
FCOURTREGSTARTTIME DATETIME,
FCOURTREGCLOSEDATE DATETIME,
FCOURTREGDEPARTMENT NVARCHAR(200) DEFAULT ' ' NOT NULL,
FCOURTREGCOURT NVARCHAR(200) DEFAULT ' ' NOT NULL,
FCOURTREGJUDGE NVARCHAR(200) DEFAULT ' ' NOT NULL,
FCOURTREGASSISTANT NVARCHAR(200) DEFAULT ' ' NOT NULL,
FCOURTREGCASETYPE VARCHAR(200) DEFAULT ' ' NOT NULL,
FCASESTATUS VARCHAR(200) DEFAULT ' ' NOT NULL,
FCOURTREGPLAINTIFF NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCOURTREGDEFENDANT NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCOURTREGTHIRD NVARCHAR(255) DEFAULT ' ' NOT NULL,
FUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_SMONI_EXEENTITY') 
 CREATE TABLE T_PBD_SMONI_EXEENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FEXECID BIGINT DEFAULT 0 NOT NULL,
FEXECCASENO VARCHAR(50) DEFAULT ' ' NOT NULL,
FEXECCOURT NVARCHAR(200) DEFAULT ' ' NOT NULL,
FEXECPNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FEXECPARTYCARDNUM NVARCHAR(255) DEFAULT ' ' NOT NULL,
FEXECCASETIME DATETIME,
FEXECMONEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_SMONI_DISHONEENTITY') 
 CREATE TABLE T_PBD_SMONI_DISHONEENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FDISHONESTID BIGINT DEFAULT 0 NOT NULL,
FPUBLISHDATE DATETIME,
FCASENO VARCHAR(50) DEFAULT ' ' NOT NULL,
FDISHONESTINAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBUSIENTITY NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDISHONESTCOURT NVARCHAR(200) DEFAULT ' ' NOT NULL,
FDISHONESTGISTUNIT NVARCHAR(200) DEFAULT ' ' NOT NULL,
FPERFORMANCE NVARCHAR(200) DEFAULT ' ' NOT NULL,
FGISTID VARCHAR(200) DEFAULT ' ' NOT NULL,
FDISHONESTDUTY NVARCHAR(200) DEFAULT ' ' NOT NULL,
FAREANAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FDISRUPTTYPENAME NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FREGDATE DATETIME,
FUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_SMONI_KTANENTITY') 
 CREATE TABLE T_PBD_SMONI_KTANENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FKTANNOUNCEMENTID BIGINT DEFAULT 0 NOT NULL,
FKTDATE DATETIME,
FKTPLAINTIFF NVARCHAR(255) DEFAULT ' ' NOT NULL,
FKTPLAINTIFF_TAG NCLOB,
FKTCOURTROOM VARCHAR(50) DEFAULT ' ' NOT NULL,
FKTCOURTREGREASON VARCHAR(200) DEFAULT ' ' NOT NULL,
FKTCOURT NVARCHAR(200) DEFAULT ' ' NOT NULL,
FKTLITIGANT NVARCHAR(1000) DEFAULT ' ' NOT NULL,
FKTCASENO VARCHAR(50) DEFAULT ' ' NOT NULL,
FKTDEFENDANT NVARCHAR(255) DEFAULT ' ' NOT NULL,
FKTDEFENDANT_TAG NCLOB,
FKTJUDGE VARCHAR(200) DEFAULT ' ' NOT NULL,
FKTCONTRACTORS VARCHAR(200) DEFAULT ' ' NOT NULL,
FUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_MONITOR') 
 CREATE TABLE T_PBD_MONITOR (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_MONITOR_ENTRYENTITY') 
 CREATE TABLE T_PBD_MONITOR_ENTRYENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FMONITORSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FMONITORBEFORETIME DATETIME,
FMONITORAFTERTIME DATETIME,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_MONITOR_API') 
 CREATE TABLE T_PBD_MONITOR_API (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FISPRESET CHAR(1) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FFULL_NAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPLATFORMAPITYPE BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_MONITOR_API_L') 
 CREATE TABLE T_PBD_MONITOR_API_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_MONITORAPI_INPUTS') 
 CREATE TABLE T_PBD_MONITORAPI_INPUTS (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FINPUT_FIELD VARCHAR(100) DEFAULT ' ' NOT NULL,
FINPUT_IS_ARRAY CHAR(1) DEFAULT ' ' NOT NULL,
FREQUIRED CHAR(1) DEFAULT ' ' NOT NULL,
FINPUT_DESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINPUT_DATA_TYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FDEFAULT_VALUE NVARCHAR(500) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_MONITORAPI_OUTPUTS') 
 CREATE TABLE T_PBD_MONITORAPI_OUTPUTS (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FINPUT_FIELD VARCHAR(100) DEFAULT ' ' NOT NULL,
FINPUT_IS_ARRAY CHAR(1) DEFAULT ' ' NOT NULL,
FINPUT_DESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINPUT_DATA_TYPE VARCHAR(30) DEFAULT ' ' NOT NULL
);



/**End C:\PDM_UPGRADE\PDM1\PBD_table.sql **/
