Fieldpine Logo Documentation Home  

Fpos.ctl & Fpos_All.ctl

The file fpos.ctl is a text structured file to provide values to influence the POS operation. This file must exist in the working directory in order for it to be used. The file itself is optional, and will only be used if located, the POS is able to function without this file.

In version V2.5.5.1250, the Retail system was expanded to process the file fpos_all.ctl before fpos.ctl. This allows the splitting of site wide definitions and highly lane specific setup.

database:path=?Override any database path values and force the system to use the named file.
database:write=?Override the command line -write option, a value of 1 implies open database for writing, 0 for read only
database:share=?Override the command line -share option, a value of 1 implies open database for shared access, 0 for exclusive
cmdline:location=?Override the command line -location option
cmdline:lane=?Override the command line -lane option
cmdline:web=?Override the command line -web option
cmdline:debug=?Override the command line -debug option
default:name=valueLoad the setting name to have the default value specified. This allows a setting value to be created, but overriden by the database or other levels if required. See Settings Management for more details on settings.
force:name=valueForce the setting name to the specified value.
licence:valueLoads the licence code to be used on this system
dbcdao:type=valueSet the database engine type of an ODBC data source. In some cases when the POS is aware of the remote database type, it is able to make additional optimisations to suit the remote database. The keywords 'oracle' and 'sqlserver' can be used for the type argument.
dbcdao:trace=NEnable Database interface DLL tracing to the file dbcdao35.log. The argument N is a bit encoded number, with the following bitfield meanings.

BitDescription
1Trace Recordsets (cursors) being opened and closed
2Trace individual field reads
4Trace individual field writes
8Enable full detail (verbose) mode
16Trace errors trapped
32Bulk record operations. Enabling this option can result in large amounts of information being written to the trace file.

Physical Database Structure

The command "database-physical:" can be used to define fields in the database that should be present. Shortly after startup the Point of Sale processes these commands in the background and verifies and database being used has the required format. This command can be used with either "database:physical:" or "database-physical:" syntax. As the timing of the commands is undefined you cannot ship a database-physical command to lanes and immediately expect it to be executed.

Example that might be found in fpos_all.ctl
database-physical:table(goodsinhistory) field(linecost) datatype(money) create report(different)
database-physical:table(products) field(abc) delete
KeywordDescription
table(?) Sets the name of the table to process
field(?) Sets the name of the field to process
datatype(?) Sets the datatype definition, using POS datatype definitions. For examples of this syntax read the file posmetadef.txt
create Create the field if it does not exist and the table does exist. If the table does not exist the field is not added. If the field exists already but is a different datatype it is not changed.
delete Delete the field if it exists.
alter Alter the field if, and only if, it already exists. This keyword alone will not cause a field to be added to the database.
alter-if-bigger
alter-if-smaller
add-table By default, the commands create, alter and delete only work if the table already exists in the database. If the keyword add-table is present then the table is created if required.
delete-table Indicates this operation is to delete the table completely.
report(param) If the field is present but does not match the datatype an event is generated.

The database-physical differs from posmetadef.txt in that the PosMetaDef.txt file is defining the expected logical types but has no bearing on the actual database once the field is present in the database. The database-physical command however is only interested to verify the actual current database structure is as specified now. Database-physical does not read posmetadef.txt

Database-Physical Examples

Example. Requiring a field to be present with a minimum length of 128 characters. (Common use)
database:physical:table(products) field(poscommand) datatype(string:128,zerolen) create alter alter-if-smaller

This command has the following effect

Example. Requiring a field to be present with a length of 128 characters. (Common use)
database:physical:table(products) field(poscommand) datatype(string:128,zerolen) create alter alter-if-smaller alter-if-bigger

This command has the following effect

Example. Requiring a field to be present but not always changing it (Rarely used, example only)
database:physical:table(products) field(poscommand) datatype(string:128,zerolen) create alter

The use of "alter" without "alter-if-smaller" and/or "alter-if-bigger" on string datatypes has an effect you might not immediately expect. This form of command would not generally be used

Example. Reporting, but not changing fields that need changing. (Common use)
database:physical:table(products) field(poscommand) datatype(string:128,zerolen) create alter alter-if-smaller report(change)

This command does not change the database as the "report" keyword is present and the "execute" keyword is not present. It is used to scan and report systems that do not meet the criteria

If this command had included the "execute(1)" keyword then the database would have been changed and a report generated.
database:physical:table(products) field(poscommand) datatype(string:128,zerolen) create alter alter-if-smaller report(change) execute(1)
Example. Deleting a table that should not be present.
database:physical:table(BobPlay2015) delete delete-table

Deletes the table BobPlay2015 if present.

Example. Creating a new table
database:physical:table(BobsNewTable) field(abc) datatype(number) create alter create-table
database:physical:table(BobsNewTable) field(AnotherField) datatype(char(32),zerolen) create alter alter-if-smaller

Fpos.ctl Example

cmdline:write=0
default:ScreenWatermark=Development
default:BisTrace=1

; Turn off offline data
force:BSLanDisabled=1

force:HttpNoDefault=0
default:BSLanIdleVisible=1
force:HttpTempDir=c:\junk\