Jump to content

Recommended Posts

DROP TABLE IF EXISTS `CommerceInsight_dbo`.`Item`;
CREATE TABLE `CommerceInsight_dbo`.`Item` (
  `CompanyNo` CHAR(2) NOT NULL,
  `No` CHAR(20) NOT NULL,
  `Descn1` VARCHAR(30) NOT NULL,
  `Descn2` VARCHAR(30) NOT NULL,
  `ItemClassCode` CHAR(3) NOT NULL,
  `SeqNo` VARCHAR(5) NOT NULL,
  `UomSmallest` CHAR(2) NOT NULL,
  `Uom2` CHAR(2) NOT NULL,
  `Uom3` CHAR(2) NOT NULL,
  `UomSt` CHAR(2) NOT NULL,
  `UomPr` CHAR(2) NOT NULL,
  `UomSl` CHAR(2) NOT NULL,
  `UomCt` CHAR(2) NOT NULL,
  `UomBy` CHAR(2) NOT NULL,
  `Cf2Sm` CHAR(10) NOT NULL,
  `Cf3Sm` CHAR(10) NOT NULL,
  `Alpha` CHAR(10) NOT NULL,
  `StdPack` INT(10) NOT NULL,
  `ManualCost` DECIMAL(19, 4) NOT NULL,
  `ManualCostBasis` CHAR(1) NOT NULL,
  `ManualCostMultiplier` DECIMAL(8, 3) NOT NULL,
  `CfMask` CHAR(10) NOT NULL,
  `GlTable` CHAR(3) NOT NULL,
  `VendorNo` CHAR(10) NOT NULL,
  `VendorItemNo` VARCHAR(30) NOT NULL,
  `DateLastSale` DATETIME NOT NULL,
  `DateLastPurchase` DATETIME NOT NULL,
  `DateLastPrice` DATETIME NOT NULL,
  `DateLastCost` DATETIME NOT NULL,
  `DateEstablished` DATETIME NOT NULL,
  `Taxable` CHAR(1) NOT NULL,
  `UpdateInventory` CHAR(1) NOT NULL,
  `SerialLots` CHAR(1) NOT NULL,
  `MiscSales` CHAR(1) NOT NULL,
  `ManufacturedItem` CHAR(1) NOT NULL,
  `Active` CHAR(1) NOT NULL,
  `MultipleUom` CHAR(1) NOT NULL,
  `DfltPrices` CHAR(1) NOT NULL,
  `WeightUom1` DECIMAL(18, 0) NOT NULL,
  `WeightUom2` DECIMAL(18, 0) NOT NULL,
  `WeightUom3` DECIMAL(18, 0) NOT NULL,
  `FreightClass` CHAR(3) NOT NULL,
  `MsdsId` CHAR(20) NOT NULL,
  `StdComm` DECIMAL(5, 3) NOT NULL,
  `SubItem1` CHAR(20) NOT NULL,
  `SubItem2` CHAR(20) NOT NULL,
  `SubItem3` CHAR(20) NOT NULL,
  `NotUsed2` VARCHAR(15) NOT NULL,
  `ModelNo` CHAR(15) NOT NULL,
  `DotCode` CHAR(6) NOT NULL,
  `ItemPriceClassCode` CHAR(3) NOT NULL,
  `ListPrice` DECIMAL(19, 4) NOT NULL,
  `Service` CHAR(1) NOT NULL,
  `MeteredItem` CHAR(1) NOT NULL,
  `Uom_Meter` CHAR(2) NOT NULL,
  `Track` CHAR(1) NOT NULL,
  `NotUsed1` CHAR(5) NOT NULL,
  `ModelCode` CHAR(15) NOT NULL,
  `SalesSvrItem` CHAR(20) NOT NULL,
  `PricingType` CHAR(1) NOT NULL,
  `PartsWtyDays` CHAR(4) NOT NULL,
  `LaborWtyDays` CHAR(4) NOT NULL,
  `Fltr` TINYINT(1) NOT NULL,
  `Icmun1` VARCHAR(1) NOT NULL,
  `Icmun2` VARCHAR(1) NOT NULL,
  `Icmun3` VARCHAR(1) NOT NULL,
  `Icmun4` VARCHAR(1) NOT NULL,
  `Icmun5` VARCHAR(1) NOT NULL,
  `Udf1` VARCHAR(50) NOT NULL,
  `Udf2` VARCHAR(50) NOT NULL,
  `Udf3` VARCHAR(50) NOT NULL,
  `Udf4` VARCHAR(50) NOT NULL,
  `Udf5` VARCHAR(50) NOT NULL,
  `TS` TIMESTAMP NOT NULL,
  `rowguid` VARCHAR(64) NOT NULL DEFAULT newid(),
  PRIMARY KEY (`CompanyNo`, `No`),
  INDEX `IX_Item_Alpha` (`CompanyNo`, `Alpha`),
  INDEX `IX_Item_ClassCode` (`CompanyNo`, `ItemClassCode`),
  INDEX `IX_Item_ModelNumber` (`CompanyNo`, `ModelNo`),
  INDEX `IX_Item_MsdsId` (`CompanyNo`, `MsdsId`),
  INDEX `IX_Item_SearchNoDescn1` (`CompanyNo`, `No`, `Descn1`),
  INDEX `IX_Item_VendorItemNo` (`CompanyNo`, `VendorItemNo`),
  INDEX `IX_Item_VendorNo` (`CompanyNo`, `VendorNo`),
  INDEX `IX_Item_VendorNo_ClassCode` (`CompanyNo`, `VendorNo`, `ItemClassCode`)
)
ENGINE = INNODB;

 

Here is the message it is giving me:

 

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'newid(), PRIMARY KEY('companyNo', 'No'), INDEX 'IX_Item_Alpha'('CompanyNo' at line 76

 

 

yea it is large. 80,000 products. I just took that default and function off for now. I don't need to add any more products I just need to move it into my mysql database so I can use it with my php shopping basket.

 

`Jake

 

If you are every required to add new products an INSERT INTO `CommerceInsight_dbo`.`Item` SET `rowguid` = uuid() will probably be appropriate.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.