CREATE COLUMN TABLE "SBODEMOPT"."AIRI" ("DocEntry" INTEGER CS_INT NOT NULL , "DocNum" INTEGER CS_INT NOT NULL , "Series" INTEGER CS_INT, "PostDate" LONGDATE CS_LONGDATE, "DocDate" LONGDATE CS_LONGDATE, "DocStatus" NVARCHAR(1) DEFAULT 'O', "RefNo" NVARCHAR(100), "RefEntry" INTEGER CS_INT, "RefDocDate" LONGDATE CS_LONGDATE, "TransId" INTEGER CS_INT, "Comments" NVARCHAR(254), "ObjType" NVARCHAR(20), "SrcLoc" INTEGER CS_INT, "SrcLocName" NVARCHAR(100), "SrcGSTIN" NVARCHAR(15), "TarLoc" INTEGER CS_INT, "TarLocName" NVARCHAR(100), "TarGSTIN" NVARCHAR(15), "DataSource" NVARCHAR(1) DEFAULT 'N', "UserSign" SMALLINT CS_INT, "LogInstanc" INTEGER CS_INT NOT NULL , "CreateDate" LONGDATE CS_LONGDATE, "UserSign2" SMALLINT CS_INT, "UpdateDate" LONGDATE CS_LONGDATE, "JrnlMemo" NVARCHAR(254), "Handwrtten" NVARCHAR(1) DEFAULT 'N', "PIndicator" NVARCHAR(10) NOT NULL , "BPLId" INTEGER CS_INT, "BPLName" NVARCHAR(100), "VATRegNum" NVARCHAR(32), PRIMARY KEY ("DocEntry", "LogInstanc")) UNLOAD PRIORITY 5  AUTO MERGE ;
CREATE UNIQUE INDEX "AIRI_INDEX" ON "SBODEMOPT"."AIRI" ( "DocNum" ASC, "PIndicator" ASC, "LogInstanc" ASC )