VbzCart/queries

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< VbzCart
Revision as of 00:17, 6 January 2010 by Woozle (talk | contribs) (→‎Restocks: qryRstkItms_expected_byItem)
Jump to navigation Jump to search

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

Carts

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/Inactive)--

Shipping

Stock

new queries

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

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>