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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_LIC_LICENSE' AND KSQL_COL_NAME ='FPRODID') 
 ALTER TABLE T_LIC_LICENSE ADD (FPRODID VARCHAR(36) DEFAULT ' ' NOT NULL );
 
 EXEC P_ALTERPK 'PK_T_LIC_ISVPROD_L', 'T_LIC_ISVPROD_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_LIC_ISVPROD_L_FID') CREATE INDEX IDX_T_LIC_ISVPROD_L_FID ON T_LIC_ISVPROD_L ( FID ,FLOCALEID );