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
Commnd Overview
internal(...)
Internal functions generally relating to metadata. Internal commands should typically not be used for
general retailing operation, instead reserved for support functions.
- internal(writedef,Output file name)
(2.5.5.1216)
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,
- internal(tablelist)
- internal(tablefields(...))
- internal(tablefieldsdb(...))
- internal(tableindex(...))
- internal(indexinfo(...))
- internal(primarykey(...))
- internal(newindex(...))
- internal(newtable(...))
- internal(newdatabase(fieldname,...))
(2.5.2.1120)
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.
- internal(deletetable(...))
- internal(deleteindex(...))
- internal(deletefield(...))
- internal(tabledef(...))
- internal(addfield(...))
- internal(resetstats(...))
query(%s)
close(%s)
open(%s)
store(%s)
isfield(%s)
delete(%s)
fetch(%s)
next(%s)
update(%s)
transfer(%s)
backup(%s)
compress
online
offline
journal(%s)
fdldb(%s)
sql(%s)
addrow(%s)
indexcheck(...)
(19 Sep 2012, P1726)
Verify key indexes exist on tables. The following keywords are possible.
- 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.
Examples:
storage(indexcheck(major))
storage(indexcheck(major,add,silent))
physkey(...)
(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
- physkey(add:all)
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
renumber(%s)