VbzCart/docs/procs/Upd DeptIttyps fr TitleIttyps: Difference between revisions
Jump to navigation
Jump to search
imported>Woozle (New page: ==About== * '''Input''': {{vbzcart|table|_title_ittyps}} (grouped by ID_ItTyp, ID_Dept) * '''Output''': {{vbzcart|table|_dept_ittyps}} (replace) ==SQL== <section begin=sql /><mysql>CREATE ...) |
imported>Woozle (created in db) |
||
Line 2: | Line 2: | ||
* '''Input''': {{vbzcart|table|_title_ittyps}} (grouped by ID_ItTyp, ID_Dept) | * '''Input''': {{vbzcart|table|_title_ittyps}} (grouped by ID_ItTyp, ID_Dept) | ||
* '''Output''': {{vbzcart|table|_dept_ittyps}} (replace) | * '''Output''': {{vbzcart|table|_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== | ==SQL== | ||
<section begin=sql /><mysql>CREATE PROCEDURE Upd_DeptIttyps_fr_TitleIttyps() | <section begin=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) | REPLACE INTO _dept_ittyps(ID_ItTyp,ID_Dept,cntForSale,cntInPrint,qtyInStock) | ||
SELECT | SELECT |
Revision as of 15:21, 10 November 2010
About
- Input: Template:Vbzcart (grouped by ID_ItTyp, ID_Dept)
- Output: Template:Vbzcart (replace)
- History:
- 2010-11-10
- Added DROP PROCEDURE for easier maintenance.
- Created in database (procs were not ported from L48 to Rizzo).
- 2010-11-10
SQL
<section begin=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>
<section end=sql />