jakebur01 Posted May 2, 2007 Share Posted May 2, 2007 I am migrating data from a ms sql table into mysql. I keep getting an error with this: newid() Is there another way to write this? Thanks, `Jake Link to comment https://forums.phpfreaks.com/topic/49637-solved-error-while-migrating/ Share on other sites More sharing options...
fenway Posted May 2, 2007 Share Posted May 2, 2007 And where is this code? Link to comment https://forums.phpfreaks.com/topic/49637-solved-error-while-migrating/#findComment-243732 Share on other sites More sharing options...
jakebur01 Posted May 2, 2007 Author Share Posted May 2, 2007 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 Link to comment https://forums.phpfreaks.com/topic/49637-solved-error-while-migrating/#findComment-243784 Share on other sites More sharing options...
quillspirit Posted May 3, 2007 Share Posted May 3, 2007 Nevermind, sorry Link to comment https://forums.phpfreaks.com/topic/49637-solved-error-while-migrating/#findComment-243953 Share on other sites More sharing options...
bubblegum.anarchy Posted May 3, 2007 Share Posted May 3, 2007 I did not know that a function could be used as a default value. btw, large table! Link to comment https://forums.phpfreaks.com/topic/49637-solved-error-while-migrating/#findComment-243982 Share on other sites More sharing options...
jakebur01 Posted May 3, 2007 Author Share Posted May 3, 2007 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 Link to comment https://forums.phpfreaks.com/topic/49637-solved-error-while-migrating/#findComment-243992 Share on other sites More sharing options...
quillspirit Posted May 3, 2007 Share Posted May 3, 2007 80K products? Can I ask who the supplier is? Just curious. Link to comment https://forums.phpfreaks.com/topic/49637-solved-error-while-migrating/#findComment-244016 Share on other sites More sharing options...
bubblegum.anarchy Posted May 3, 2007 Share Posted May 3, 2007 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. Link to comment https://forums.phpfreaks.com/topic/49637-solved-error-while-migrating/#findComment-244093 Share on other sites More sharing options...
jakebur01 Posted May 3, 2007 Author Share Posted May 3, 2007 Thank you. I will write this down for my records. `Jake Link to comment https://forums.phpfreaks.com/topic/49637-solved-error-while-migrating/#findComment-244205 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.