IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_AI_DAPCONFIG_SNP') 
 CREATE TABLE T_AI_DAPCONFIG_SNP (
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FBOOKID BIGINT DEFAULT 0 NOT NULL,
FOPENLOGGER CHAR(1) DEFAULT ' ' NOT NULL,
FALLORGOPEN CHAR(1) DEFAULT ' ' NOT NULL
);

 EXEC P_ALTERPK 'PK_T_AI_DAPCONFIG_SNP', 'T_AI_DAPCONFIG_SNP', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_AI_DAPCONFIG_SNP_ORG') CREATE INDEX IDX_AI_DAPCONFIG_SNP_ORG ON T_AI_DAPCONFIG_SNP ( FORGID );
