POS Commands Home
The storage command has a very large collection of functions covering normal record reading and writing, and also
metadata and control functionality.
While this is documented as a seperate command
it is always reached through the storage(function(...)) command
Internal functions generally relating to metadata. Internal commands should typically not be used for
general retailing operation, instead reserved for support functions.
(19 Sep 2012, P1726)
Verify key indexes exist on tables. The following keywords are possible.
- internal(writedef,Output file name)
Create a posmetadef_user_new.txt that matches the current system setup. Metadef files are used to force
the metadata definition and can be very useful when dealing through ODBC, where the technical details about fields may be
altered by intervening drivers. Note, this file has _new in the filename and will not be used until renamed,
Create a new empty database. This command is reserved for automated testing only and may not be present in all code builds. Once the database
has been created, the POS system will change to using this new database - however this database is largely empty of all information. Typically
after creating a new database you will immediately need to create the desired tables and populate reference data.
- major Check major tables only.
- add Automatically attempt to add missing indexes. This add operation can fail if the index cannot be created, such as duplicate values being present.
- silent This command should not display anything to the user.
This command is commonly accessed by quickcode 71242 which checks the indexes. Or quickcode 71353
which checks the indexes and attempts to add any required.
(8 May 2013) Manage physkey fields on tables. This command can be extremely
dangerous when executed in a multi store environment. There are two main forms of this command
Add the field "physkey" to all tables. You should not run this command without explicit instruction as not
all tables are capable of physkey support.
- physkey(tablename, tablename ....)
Generate a unique physkey for each record in the table that does not already have a physkey value. In a distributed
environment, this command should typically only be issued on the head office system.
The physkey field can be considered a globally unique primary key, albeit one that can be
generated without central coordination. It is similar to a GUID or UUID, but the internal structure
is slightly more index friendly than random values. See about physkeys for more details