VbzCart/procs/Upd DeptIttyps fr TitleIttyps

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< VbzCart‎ | procs
Revision as of 15:21, 10 November 2010 by Woozle (talk | contribs) (created in db)
Jump to navigation Jump to search

About

  • Input: _title_ittyps (grouped by ID_ItTyp, ID_Dept)
  • Output: _dept_ittyps (replace)
  • History:
    • 2010-11-10
      • Added DROP PROCEDURE for easier maintenance.
      • Created in database (procs were not ported from L48 to Rizzo).

SQL

<mysql>DROP PROCEDURE IF EXISTS Upd_DeptIttyps_fr_TitleIttyps; CREATE PROCEDURE Upd_DeptIttyps_fr_TitleIttyps()

 REPLACE INTO _dept_ittyps(ID_ItTyp,ID_Dept,cntForSale,cntInPrint,qtyInStock)
 SELECT
   ID_ItTyp,
   ID_Dept,
   SUM(cntForSale) AS cntForSale,
   SUM(cntInPrint) AS cntInPrint,
   SUM(qtyInStock) AS qtyInStock
 FROM _title_ittyps
 GROUP BY ID_ItTyp, ID_Dept;</mysql>