Difference between revisions of "VbzCart/queries/qryCtg Upd join"
Jump to navigation
Jump to search
(extracted from catalog building page) |
m (2008-03-15) |
||
Line 5: | Line 5: | ||
* '''Fields''': | * '''Fields''': | ||
** '''s.CatNum''' -- the CTG CatNum -- should never be NULL; this indicates something is wrong in the sourcing process, because how can you have an active source with no title CatNum? | ** '''s.CatNum''' -- the CTG CatNum -- should never be NULL; this indicates something is wrong in the sourcing process, because how can you have an active source with no title CatNum? | ||
+ | * '''History''': | ||
+ | ** '''2008-03-15''' Building sequence completely rewritten, so presumably this query was created then | ||
==SQL== | ==SQL== | ||
<section begin=sql /><mysql>CREATE OR REPLACE VIEW qryCtg_Upd_join AS | <section begin=sql /><mysql>CREATE OR REPLACE VIEW qryCtg_Upd_join AS |
Revision as of 22:21, 3 May 2009
About
- Purpose: This recordset represents all the catalog items for which there is currently an active source (in print or closeout, but not stock). It should not need to preserve anything from the current record in cat_items EXCEPT Supp_CatNum and QtyMin_Stock. (Maybe these should later be moved to a separate table.)
- Requires: ctg_upd1, ctg_upd2
- Used by: catalog building process (details to be documented)
- Fields:
- s.CatNum -- the CTG CatNum -- should never be NULL; this indicates something is wrong in the sourcing process, because how can you have an active source with no title CatNum?
- History:
- 2008-03-15 Building sequence completely rewritten, so presumably this query was created then
SQL
<mysql>CREATE OR REPLACE VIEW qryCtg_Upd_join AS SELECT
c.ID_Item AS ID, s.CatNum AS CatNum, TRUE AS isForSale, /* has catalog source, so is for sale */ FALSE AS isMaster, /* master items are entered manually */ c.qtyInStock, /* this has just been recalculated from stock */ NOT s.isCloseOut AS isInPrint, s.isCloseOut, FALSE AS isPulled, FALSE AS isDumped, s.ID_Title, s.ID_ItTyp, s.ID_ItOpt, s.ItOpt_Descr, s.ItOpt_Sort, s.GrpCode, s.GrpDescr, s.GrpSort, s.CatSfx, s.ID_ShipCost, s.PriceBuy, s.PriceSell, s.PriceList, c.Supp_CatNum, c.QtyMin_Stk
FROM ctg_upd1 AS s LEFT JOIN ctg_upd2 AS c ON s.IDS_Item=c.IDS_Item;</mysql>