VbzCart/queries/qryCat pages

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< VbzCart‎ | queries
Revision as of 00:25, 11 December 2009 by Woozle (talk | contribs) (Created page with '==About== * '''Purpose''': Maps {path info from http requests} to specific titles, departments, and suppliers; may eventually map to other page types * '''History''': ** '''2009-…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

About

  • Purpose: Maps {path info from http requests} to specific titles, departments, and suppliers; may eventually map to other page types
  • History:
    • 2009-12-10 Reconstructed from query _cat_pages as already defined on Rizzo (apparently was not documented), but using newer table/query names

SQL

<mysql>CREATE OR REPLACE SQL SECURITY DEFINER VIEW `qryCat pages` AS

 SELECT
   concat_ws('-','S',s.ID) AS AB,
   lcase(s.CatKey)         AS Path,
   s.ID,
   'S'                     AS Type
 FROM cat_supp AS s
 UNION
 SELECT
   concat_ws('-','D',d.ID) AS AB,
   lcase(d.CatWeb_Dept)    AS Path,
   d.ID,
   'D'                     AS Type
 FROM qryCat_Depts AS d
 UNION
 SELECT
   concat_ws('-','T',t.ID)          AS AB,
   replace(lcase(t.CatWeb),'-','/') AS Path,
   t.ID,
   'T'                              AS Type
 FROM qryCat_Titles AS t
 UNION
 SELECT
   concat_ws('-','I',i.ID)          AS AB,
   lcase(concat_ws('/',replace(t.CatWeb,'-','/'),i.AttrFldr,i.Ab_Size)) AS Path,
   i.ID,
   'I' AS Type
 FROM (cat_images AS i LEFT JOIN qryCat_Titles AS t ON i.ID_Title = t.ID)
   WHERE (i.Ab_Size NOT IN ('th','sm'));</mysql>