Sample SQL Code
Previous Topic  Next Topic 

DROP TABLE "CORE"."TRADINGPARTNERS" ;


CREATE TABLE "CORE"."TRADINGPARTNERS"

  ("PARTNERID" VARCHAR(10) NOT NULL,

   "PARTNERNAME" VARCHAR(50) ,

   "PARTNERTYPE" VARCHAR(10) ,

   "REFERENCE" VARCHAR(24) ,

   "COMMENT" VARCHAR(120) ,

   "INVENTORYCONTROLLERID" BIGINT ,

   "BUYERID" BIGINT ,

   "DEFAULTDELIVERYPATTERN" VARCHAR(10) ,

   "DEFAULTROUTENUMBER" BIGINT ,

   "DEFAULTSCHEDULEPATTERN" VARCHAR(10) ,

   "DEFAULTFLOATCODE" VARCHAR(3) ,

   "DEFAULTINSPECT" VARCHAR(3) ,

   "DEFAULTSIGNALCODE" VARCHAR(10) ,

   "DEFAULTFOB" VARCHAR(3) ,

   "DEFAULTTRANSPORTMETHOD" VARCHAR(16) ,

   "CREATIONTIME" TIMESTAMP ,

   "CREATIONLOGIN" VARCHAR(32) ,

   "LOCATION" VARCHAR(32) ,

   "CUSTOMERSUPPLIERVENDORID" VARCHAR(10) );


ALTER TABLE "CORE"."TRADINGPARTNERS"

  ADD CONSTRAINT "C4457428" PRIMARY KEY ("PARTNERID");

 

COMMENT ON TABLE "CORE"."TRADINGPARTNERS" IS 'Trading partners are other entities or businesses that exchange information required during the course of trade.';


COMMENT ON COLUMN "CORE"."TRADINGPARTNERS".PARTNERID IS 'A unique ID to identify a trading partner.';


COMMENT ON COLUMN "CORE"."TRADINGPARTNERS".PARTNERNAME IS 'The name of the partner.';


COMMENT ON COLUMN "CORE"."TRADINGPARTNERS".PARTNERTYPE IS 'The type of partner. (CORE.PARTNERTYPES)';


COMMENT ON COLUMN "CORE"."TRADINGPARTNERS".REFERENCE IS 'A reference to additional partner information.';


COMMENT ON COLUMN "CORE"."TRADINGPARTNERS".COMMENT IS 'A comment describing information about the trading partner.';


COMMENT ON COLUMN "CORE"."TRADINGPARTNERS".INVENTORYCONTROLLERID IS 'The contact ID of the inventory controller assigned to this trading partner. (CORE.CONTACTS)';


COMMENT ON COLUMN "CORE"."TRADINGPARTNERS".BUYERID IS 'The contact ID (CONTACTID) of the buyer assigned to this trading partner. (CORE.CONTACTS)';


COMMENT ON COLUMN "CORE"."TRADINGPARTNERS".DEFAULTDELIVERYPATTERN IS 'This is the default delivery pattern used when creating a new Item Supplier Sourcing record. (CORE.DELIVERPATTERNS)';


COMMENT ON COLUMN "CORE"."TRADINGPARTNERS".DEFAULTROUTENUMBER IS 'This is the default route used when creating a new Item Supplier Sourcing record. (CORE.ROUTES)';


COMMENT ON COLUMN "CORE"."TRADINGPARTNERS".DEFAULTSCHEDULEPATTERN IS 'This is the default schedule pattern used when creating a new Item Supplier Sourcing record. (CORE. SCHEDULEPATTERNS)';


COMMENT ON COLUMN "CORE"."TRADINGPARTNERS".DEFAULTFLOATCODE IS 'This is the default float code used when creating a new Item Supplier Sourcing record. (CORE. SCHEDULEPATTERNS)';


COMMENT ON COLUMN "CORE"."TRADINGPARTNERS".DEFAULTINSPECT IS 'This is the default inspect flag used when creating a new Item Supplier Sourcing record. (CORE.YESNO)';


COMMENT ON COLUMN "CORE"."TRADINGPARTNERS".DEFAULTSIGNALCODE IS 'This is the default signal code used when creating a new Item Supplier Sourcing record. (CORE. SIGNALCODES)';


COMMENT ON COLUMN "CORE"."TRADINGPARTNERS".DEFAULTFOB IS 'FOB means free on board. If it is set to YES then the buying partner owns the material when it ships. This is the default FOB flag used when creating a new Item Supplier Sourcing record. (CORE.YESNO)';


COMMENT ON COLUMN "CORE"."TRADINGPARTNERS".DEFAULTTRANSPORTMETHOD IS 'This is the default transport method used when creating a new Item Supplier Sourcing record. (CORE. TRANSPORTMETHODS)';


COMMENT ON COLUMN "CORE"."TRADINGPARTNERS".CREATIONTIME IS 'The date and time this record was created.';


COMMENT ON COLUMN "CORE"."TRADINGPARTNERS".CREATIONLOGIN IS 'The user ID used to create this record.';


INSERT INTO "CORE"."TRADINGPARTNERS" (PARTNERID, PARTNERNAME) VALUES ('0000000000', 'Default');

INSERT INTO "CORE"."TRADINGPARTNERS" (PARTNERID, PARTNERNAME) VALUES ('041415', 'Publix Supermarket');

INSERT INTO "CORE"."TRADINGPARTNERS" (PARTNERID, PARTNERNAME) VALUES ('074333', 'Arrowhead');