VbzCart/docs/queries/qryTitles ItTyps ItTyps: Difference between revisions

From Woozle Writes Code
< VbzCart‎ | docs‎ | queries
Jump to navigation Jump to search
imported>Woozle
(some documentation)
m (Woozle moved page VbzCart/VbzCart/queries/qryTitles ItTyps ItTyps to VbzCart/docs/queries/qryTitles ItTyps ItTyps without leaving a redirect: part 3/5)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
==About==
==About==
* '''Returns''': list of available titles for each item type
** This query provides some of the same information as {{vbzcart|table|_title_ittyps}}, but (a) broken down by Item and (b) using live data.
* '''Requires''': {{vbzcart/query|qryTitles_ItTyps_grpItems}}, {{vbzcart/table|cat_ittyps}}
* '''Requires''': {{vbzcart/query|qryTitles_ItTyps_grpItems}}, {{vbzcart/table|cat_ittyps}}
* '''Used by''': catalog title pages
* '''Used by''': can be used by catalog pages in place of cat_items to provide realtime data (instead of relying on some cached fields in cat_items), but this is very slow; currently no known uses.
* '''History''':
* '''History''':
** '''2009-04-13''' had to recreate because qryTitles_ItTyps_grpItems changed
** '''2009-04-13''' had to recreate because qryTitles_ItTyps_grpItems changed
** '''2011-01-24''' For consistency with {{vbzcart|table|_title_ittyps}}:
*** '''ItTyp_Sort''' &rarr; '''ItTypSort'''
*** '''ItTyp_Sng''' &rarr; '''ItTypNameSng'''
*** '''ItTyp_Plr''' &rarr; '''ItTypNamePlr'''
==SQL==
==SQL==
<section begin=sql /><mysql>CREATE OR REPLACE VIEW qryTitles_ItTyps_ItTyps AS
<section begin=sql /><mysql>CREATE OR REPLACE VIEW qryTitles_ItTyps_ItTyps AS
SELECT
SELECT
   i.*,
   i.*,
   it.Sort                      AS ItTyp_Sort,
   it.Sort                      AS ItTypSort,
   it.NameSng                    AS ItTyp_Sng,
   it.NameSng                    AS ItTypNameSng,
   IFNULL(it.NamePlr,it.NameSng) AS ItTyp_Plr
   IFNULL(it.NamePlr,it.NameSng) AS ItTypNamePlr
FROM  
FROM  
qryTitles_ItTyps_grpItems AS i LEFT JOIN cat_ittyps AS it ON i.ID_ItTyp=it.ID;</mysql>
qryTitles_ItTyps_grpItems AS i LEFT JOIN cat_ittyps AS it ON i.ID_ItTyp=it.ID;</mysql>
<section end=sql />
<section end=sql />

Latest revision as of 01:56, 25 February 2024

About

  • Returns: list of available titles for each item type
    • This query provides some of the same information as Template:Vbzcart, but (a) broken down by Item and (b) using live data.
  • Requires: Template:Vbzcart/query, Template:Vbzcart/table
  • Used by: can be used by catalog pages in place of cat_items to provide realtime data (instead of relying on some cached fields in cat_items), but this is very slow; currently no known uses.
  • History:
    • 2009-04-13 had to recreate because qryTitles_ItTyps_grpItems changed
    • 2011-01-24 For consistency with Template:Vbzcart:
      • ItTyp_SortItTypSort
      • ItTyp_SngItTypNameSng
      • ItTyp_PlrItTypNamePlr

SQL

<section begin=sql /><mysql>CREATE OR REPLACE VIEW qryTitles_ItTyps_ItTyps AS SELECT

 i.*,
 it.Sort                       AS ItTypSort,
 it.NameSng                    AS ItTypNameSng,
 IFNULL(it.NamePlr,it.NameSng) AS ItTypNamePlr

FROM qryTitles_ItTyps_grpItems AS i LEFT JOIN cat_ittyps AS it ON i.ID_ItTyp=it.ID;</mysql> <section end=sql />