Difference between revisions of "VbzCart/queries"

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
(→‎Packages: qryOrders_Pulled, qryPkgs_Pull_status)
(reorganized)
Line 7: Line 7:
 
* '''qryCbx_''': queries used for filling comboboxes. The unique ID will always be the first field, and the text to display will always be the second field; additional fields may be provided for use in further '''qryCbx_''' queries which show a subset of the results.
 
* '''qryCbx_''': queries used for filling comboboxes. The unique ID will always be the first field, and the text to display will always be the second field; additional fields may be provided for use in further '''qryCbx_''' queries which show a subset of the results.
 
* '''qryCat_''': queries which build catalog numbers or information by joining multiple tables. (In Access, the convention was '''qryCatNum_'''.)
 
* '''qryCat_''': queries which build catalog numbers or information by joining multiple tables. (In Access, the convention was '''qryCatNum_'''.)
 +
==by category==
 
===Inactive===
 
===Inactive===
 
* [[/deprecated]]: queries we're trying to [[/discarded|get rid of]], once we're sure nothing uses them
 
* [[/deprecated]]: queries we're trying to [[/discarded|get rid of]], once we're sure nothing uses them
Line 23: Line 24:
 
* [[/qryCbx_Titles]]
 
* [[/qryCbx_Titles]]
 
* [[/qryCat_Items_Stock]]: cat_items with stock info
 
* [[/qryCat_Items_Stock]]: cat_items with stock info
 
+
====Catalog Items====
===Catalog Items===
 
 
* [[/qryCat_Items]]
 
* [[/qryCat_Items]]
 
* [[/qryCbx_Items_data]]
 
* [[/qryCbx_Items_data]]
Line 32: Line 32:
 
** [[/qryCbx_Items_opt]]: abbreviated version for contexts where Title is already known
 
** [[/qryCbx_Items_opt]]: abbreviated version for contexts where Title is already known
 
* [[/qryItems_prices]]: what uses this?
 
* [[/qryItems_prices]]: what uses this?
 
+
====Catalog Sources====
===Catalog Sources===
 
 
* [[/qryCtg_Sources_active]]
 
* [[/qryCtg_Sources_active]]
 
* [[/qryCtg_Items_updates]]
 
* [[/qryCtg_Items_updates]]
Line 48: Line 47:
 
** [[/qryCtg_src_dups]]
 
** [[/qryCtg_src_dups]]
 
** [[/qryCtgCk_dup_keys]]
 
** [[/qryCtgCk_dup_keys]]
 
+
===Ordering===
===Orders===
+
====Customers====
 +
* [[/qryCustAddrs]]
 +
* [[/qryCbx_CustNames]]
 +
====Orders====
 
* [[/qryCbx_Orders]]
 
* [[/qryCbx_Orders]]
 
* [[/qryOrderLines_notPkgd]]
 
* [[/qryOrderLines_notPkgd]]
Line 62: Line 64:
 
* [[/qryItms_to_restock]]
 
* [[/qryItms_to_restock]]
 
* [[/qryItms_to_restock_w_info]]
 
* [[/qryItms_to_restock_w_info]]
===Shipping===
+
====Packages====
* [[/qryPkgs_status]]
 
 
 
===Customers===
 
* [[/qryCustAddrs]]
 
* [[/qryCbx_CustNames]]
 
 
 
===Packages===
 
 
* [[/qryPkgLines_byOrdLine_andItem]]
 
* [[/qryPkgLines_byOrdLine_andItem]]
 
* [[/qryOrdLines_PkgdQtys]]
 
* [[/qryOrdLines_PkgdQtys]]
Line 75: Line 70:
 
* [[/qryOrders_Pulled]]
 
* [[/qryOrders_Pulled]]
 
* [[/qryPkgs_Pull_status]]
 
* [[/qryPkgs_Pull_status]]
 
+
====Restocks====
===Restocks===
 
 
* '''all restock requests''':
 
* '''all restock requests''':
 
** [[/qryRstks_info]]
 
** [[/qryRstks_info]]
Line 85: Line 79:
 
*** [[/qryRstkReq_by_status]]
 
*** [[/qryRstkReq_by_status]]
 
*** [[/qryRstkReq_by_PurchOrd]]
 
*** [[/qryRstkReq_by_PurchOrd]]
**
 
 
* '''active restocks''':
 
* '''active restocks''':
 
** [[/qryRstks_active]]: not terminated = !(closed, orphaned or killed)
 
** [[/qryRstks_active]]: not terminated = !(closed, orphaned or killed)
Line 93: Line 86:
 
** [[/qryRstkItms_unsent_for_order]]
 
** [[/qryRstkItms_unsent_for_order]]
 
** [[/qryRstkItms_expected]]
 
** [[/qryRstkItms_expected]]
====terminology====
+
 
 +
'''terminology'''
 
* '''Active''' = not "terminated", i.e. not "closed", "killed", or "orphaned" (may or may not be "expected" yet)
 
* '''Active''' = not "terminated", i.e. not "closed", "killed", or "orphaned" (may or may not be "expected" yet)
 
* '''Closed''' = received from supplier, nothing remaining on backorder
 
* '''Closed''' = received from supplier, nothing remaining on backorder
Line 101: Line 95:
 
* '''Terminated''' = closed, orphaned, or killed
 
* '''Terminated''' = closed, orphaned, or killed
 
* '''Unsent''' = created but not yet placed with supplier, i.e. not "expected"
 
* '''Unsent''' = created but not yet placed with supplier, i.e. not "expected"
Phases:
+
'''phases''':
 
{| border=1
 
{| border=1
 
|-
 
|-
Line 110: Line 104:
 
| colspan=4 align=center | --(Active)-- || align=center | --(Terminated)--
 
| colspan=4 align=center | --(Active)-- || align=center | --(Terminated)--
 
|}
 
|}
 +
====Shipping====
 +
* [[/qryPkgs_status]]
 +
  
 
===Stock===
 
===Stock===

Revision as of 18:03, 8 September 2009

Navigation

VbzCart: data views

Overview

What MS Access calls "queries" are called "views" in MySQL, i.e. they pull data from existing tables and are themselves usable as data sources in much the same way that tables are (and in which result sets from functions are not).

Some common prefixes:

  • qryCbx_: queries used for filling comboboxes. The unique ID will always be the first field, and the text to display will always be the second field; additional fields may be provided for use in further qryCbx_ queries which show a subset of the results.
  • qryCat_: queries which build catalog numbers or information by joining multiple tables. (In Access, the convention was qryCatNum_.)

by category

Inactive

Catalog

Catalog Items

Catalog Sources

Ordering

Customers

Orders

Packages

Restocks

terminology

  • Active = not "terminated", i.e. not "closed", "killed", or "orphaned" (may or may not be "expected" yet)
  • Closed = received from supplier, nothing remaining on backorder
  • Expected = placed with supplier, but not yet received
  • Killed = canceled with supplier after having been placed
  • Orphaned = we don't have records that anything was received, but nothing further is expected (usually old data)
  • Terminated = closed, orphaned, or killed
  • Unsent = created but not yet placed with supplier, i.e. not "expected"

phases:

Time →
Created (Unsent) Ordered (Expected) Closed, Killed, or Orphaned
--(Active)-- --(Terminated)--

Shipping


Stock

new queries

  1. REDIRECT Template:l/vc/table):

old queries

This was the first batch of queries I created, before I had decided to go with the qry prefix as in Access.

Caching

Caching should only be used for catalog display.

v_data_flow

<mysql> CREATE OR REPLACE VIEW v_data_flow AS

   SELECT
     df.ID_Srce,
     df.ID_Dest,
     df.ID_Proc,
     dfx.doesClear
   FROM data_flow AS df LEFT JOIN data_procs AS dfx ON df.ID_Proc=dfx.ID
   ORDER BY dfx.doesClear;</mysql>