Difference between revisions of "VbzCart/queries/qryTitles ItTyps ItTyps"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
(some documentation)
(changing field names for compatibility with cached table)
Line 1: Line 1:
 
==About==
 
==About==
 +
* '''Returns''': list of available titles for each item type
 +
** This query generally provides the same information as {{vbzcart|table|_title_ittyps}}, but uses live (non-cached) data.
 +
** There is probably some function-overlap between this query and the procedures which build that cached table.
 
* '''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 title pages, but 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}} so that they may be used interchangeably:
 +
*** '''ItTyp_Sort''' → '''ItTypSort'''
 +
*** '''ItTyp_Sng''' → '''ItTypNameSng'''
 +
*** '''ItTyp_Plr''' → '''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 />

Revision as of 17:15, 24 January 2011

About

  • Returns: list of available titles for each item type
    • This query generally provides the same information as _title_ittyps, but uses live (non-cached) data.
    • There is probably some function-overlap between this query and the procedures which build that cached table.
  • Requires:
  1. REDIRECT Template:l/vc/query,
  2. REDIRECT Template:l/vc/table
  • Used by: can be used by catalog title pages, but 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 _title_ittyps so that they may be used interchangeably:
      • ItTyp_SortItTypSort
      • ItTyp_SngItTypNameSng
      • ItTyp_PlrItTypNamePlr

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>