Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 1.92 KB | None | 0 0
  1. BEGIN
  2. INSERT INTO im_inventorymaster  (ItemNumber, ItemDescription, ProductLine, ProductType, Procurement, Valuation, PriceCode, BackordersAllowed2, IT_Enabled,  DefaultWhse,
  3. Weight, ImageFile, DateLastSold, AlternateItems, PriceByItem, PriceByCustomerPriceLevel, PriceByCustomerNumberr, ExplodeKit, ReturnsAllowed,TaxClass,
  4. WarrantyCode, SuggestedRetailPrice, StdPrice, TotalQtyOnHand, Volume, DateCreated, TimeCreated, DateUpdated)
  5. VALUES (TRIM(NEW.ItemNumber), TRIM(NEW.ItemDescription), NEW.ProductLine, NEW.ProductType, NEW.Procurement, NEW.Valuation, TRIM(NEW.PriceCode), NEW.BackordersAllowed,
  6. NEW.IT_Enabled,  NEW.DefaultWhse, TRIM( NEW.Weight), TRIM(NEW.ImageFile), NEW.DateLastSold, NEW.AlternateItems, NEW.PriceByItem, NEW.PriceByCustomerPriceLevel, NEW.PriceByCustomerNumber,
  7. NEW.ExplodeKit, NEW.ReturnsAllowed, NEW.TaxClass, NEW.WarrantyCode, NEW.SuggestedRetailPrice, NEW.StdPrice, NEW.TotalQtyOnHand, TRIM(NEW.Volume), NEW.DateCreated, NEW.TimeCreated,
  8. NOW())
  9. ON duplicate KEY
  10. UPDATE ItemDescription = TRIM(NEW.ItemDescription), ProductLine = NEW.ProductLine, ProductType = NEW.ProductType, Procurement = NEW.Procurement,
  11. Valuation = NEW.Valuation, PriceCode = TRIM(NEW.PriceCode), BackordersAllowed2 = NEW.BackordersAllowed, IT_Enabled = NEW.IT_Enabled,  DefaultWhse = NEW.DefaultWhse,
  12. Weight = TRIM( NEW.Weight), ImageFile = TRIM(NEW.ImageFile), DateLastSold = NEW.DateLastSold, AlternateItems = NEW.AlternateItems, PriceByItem = NEW.PriceByItem,
  13. PriceByCustomerPriceLevel = NEW.PriceByCustomerPriceLevel, PriceByCustomerNumber = NEW.PriceByCustomerNumber, ExplodeKit = NEW.ExplodeKit, ReturnsAllowed = NEW.ReturnsAllowed,
  14. TaxClass = NEW.TaxClass, WarrantyCode = NEW.WarrantyCode, SuggestedRetailPrice = NEW.SuggestedRetailPrice, StdPrice = NEW.StdPrice, TotalQtyOnHand = NEW.TotalQtyOnHand,
  15. Volume = TRIM(NEW.Volume), DateCreated = NEW.DateCreated, TimeCreated = NEW.TimeCreated, DateUpdated = NOW(), DateDeleted = 0;
  16. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement