Difference between revisions of "VbzCart/procs/Upd StkContainers"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< VbzCart‎ | procs
Jump to navigation Jump to search
(New page: ==About== * '''Purpose''' update (replace/fill) {{vbzcart|table|_stk_containers}} * '''Status''': in progress; Packages and Restocks were not yet migrated when this was designed, but they ...)
 
(updates: correct name of query to use; this is not used)
 
Line 1: Line 1:
 
==About==
 
==About==
 
* '''Purpose''' update (replace/fill) {{vbzcart|table|_stk_containers}}
 
* '''Purpose''' update (replace/fill) {{vbzcart|table|_stk_containers}}
* '''Status''': in progress; Packages and Restocks were not yet migrated when this was designed, but they are now -- this should probably just select * from {{vbzcart/query|qryStk_containers}} (to be documented), but I'm going to save it once for reference purposes...
+
* '''Status''': NOT USED
 +
** if something ever does need to cache container data, just change this so it SELECTs * from {{vbzcart/query|qryStock_containers}}
 +
** Packages and Restocks were not yet migrated when this was written as it is now, which is why those sections are commented out
 
==SQL==
 
==SQL==
 
<section begin=sql /><mysql>CREATE PROCEDURE Upd_StkContainers()
 
<section begin=sql /><mysql>CREATE PROCEDURE Upd_StkContainers()

Latest revision as of 11:18, 9 March 2009

About

  • Purpose update (replace/fill) _stk_containers
  • Status: NOT USED
    • if something ever does need to cache container data, just change this so it SELECTs * from
  1. REDIRECT Template:l/vc/query
    • Packages and Restocks were not yet migrated when this was written as it is now, which is why those sections are commented out

SQL

<mysql>CREATE PROCEDURE Upd_StkContainers()

 REPLACE INTO _stk_containers
 /*
 SELECT
     CONCAT("P.",p.ID) AS IDS,
     "P" AS Type,
     p.ID AS ID_forType,
     CONCAT(o.Number,"-",p.Seq) AS Name,
     s.WhenShipped AS TimeStamp
   FROM (Packages AS p LEFT JOIN Orders AS o ON p.ID_Order=o.ID) LEFT JOIN Shipments AS s ON p.ID_Shipment=s.ID;
   UNION /**/
 SELECT
     CONCAT("L.",l.ID) AS IDS,
     "L" AS Type,
     l.ID AS ID_forType,
     l.Code AS Name,
     l.WhenCreated AS TimeStamp
   FROM stk_bins AS l
   UNION
 /*
 SELECT
     CONCAT("R.",r.ID) AS IDS,
     "R" AS Type,
     r.ID AS ID_forType,
     "po"&r.PurchOrdNum&"/ord"&SuppOrdNum&"/inv"&SuppInvcNum AS Name,
     RestockEffDate(r.ID) AS TimeStamp
   FROM Restocks AS r
   UNION /**/
 SELECT
     CONCAT("M.",i.ID) AS IDS,
     "M" AS Type,
     i.ID AS ID_forType,
     i.CatNum AS Name,
     NULL AS TimeStamp
   FROM cat_items AS i WHERE i.IsMaster;</mysql>