The commands in this range are designed to be processed by database agents and return information about how the database engines are configured, current operating state and historic performance information.
121,003 DbStorage_TableSummary
This command is processed by fpos.dll if present and active. It returns overview information on a single table, such as fields, checksums of all data, table row counts and minimum/maximum values.
This packet can be useful for quickly determining if tables on different machines are likely to contain the same data.
The command requires the field 603 to be set to the table to report on. See examples below.
If you wish to return information about the individual rows by scanning the table you also need to include field 603 = 1. If field 603 is not present the table will not be scanned. Table scanning can on some configurations cause a pause/hang to the operating user so caution is advised. This mainly applies for large tables, small reference tables can be easily fully scanned sub second.
121,003 Reply Packet
Field# | Name | Description |
120 | Status | Overall status of request. 0=error, 1=success |
40,000 | RowCount | Number of rows in table. Returned only if bit 1 in f601 set. (eg f601=2 or f601=3) |
Per Field Information. Returned only if bit 0 in f601 set. (eg f601=1 or f601=3) | ||
DMEG DMEF 40,001 | RowCount | Number of rows in this field analysis |
DMEG DMEF 40,002 | RowMinimum | Minimum value observed in this row. Numeric datatypes only |
DMEG DMEF 40,003 | RowMaximum | Maximum value observed in this row. Numeric datatypes only |
DMEG DMEF 40,004 | RowAverage | Average of values observed in this row. Numeric datatypes only |
DMEG DMEF 40,005 | RowDistinctCount | Number of disinct values observed. Numeric datatypes only. NULL may be counted as zero. |
DMEG DMEF 40,006 | RowStdDev1 | 1 standard deviation of values observed |
DMEG DMEF 40,007 | RowChecksumA | A rolling checksum of the field values. The order the records is retrieved does not affect the checksum. This checksum is designed for high speed comparison, not robust use. |
Example of DbStorage_TableSummary reply (JSON)
This example shows a request for JSON response for the table r_paymenttypes. f601 is set to "2" which says count and return the rows in the table only.
http://127.0.0.1:8095/gnap/J/buck?3=fieldpineinternal.fdl911.fetch&100=121003&603=r_paymenttypes&601=2{ "RootType":"DATS", "f100":121003, "f110":1584, "DMEG":[ { "f10":"r_paymenttypes", "RowCount":15, "DMEF":[ { "f11":"code","f163":"code","f12":4,"f13":4}, { "f11":"typestr","f163":"typestr","f12":12800,"f13":20}, { "f11":"custspell","f163":"custspell","f12":12800,"f13":30}, { "f11":"saleeffect","f163":"saleeffect","f12":4,"f13":4}, { "f11":"visibleflags","f163":"visibleflags","f12":4,"f13":4}, { "f11":"control","f163":"control","f12":4,"f13":4}, { "f11":"rid","f163":"rid","f12":4,"f13":4}, { "f11":"stdid","f163":"stdid","f12":4,"f13":4} ]} ]}
Example of DbStorage_TableSummary reply (XML)
This example shows an XML request for complete table field details. Some response output has been removed for clarity
http://127.0.0.1:8095/gnap/M/buck?3=fieldpineinternal.fdl911.fetch&100=121003&603=r_paymenttypes&601=3<DATS> <f100>121003</f100> <f110>3492</f110> <DMEG> <f10>r_paymenttypes</f10> <RowCount>15</RowCount> <DMEF> <f11>code</f11> <f163>code</f163> <f12>4</f12> <f13>4</f13> <RowCount>15</RowCount> <RowMinimum>1.000000</RowMinimum> <RowMaximum>22.000000</RowMaximum> <RowAverage>9.400000</RowAverage> <RowDistinctCount>15</RowDistinctCount> <RowStdDev1>6.811755</RowStdDev1> <RowChecksumA>27</RowChecksumA> </DMEF> <DMEF> <f11>typestr</f11> <f163>typestr</f163> <f12>12800</f12> <f13>20</f13> <RowChecksumA>-1876372582</RowChecksumA> </DMEF> <RowCount>15</RowCount> </DMEG> </DATS>
121,006 Dbcdao2000_Overview
This command is processed by dbcdao2000.dll if present and active. It returns summary information about the environment the DLL is operating within and high level information about the database(s) connected.
121,006 Reply Packet
Field# | Name | Description |
General Information | ||
5901 | TraceFilePath | If a trace file is active this field contains the full path name of the trace file |
5902 | TraceFileName | If a trace file is active this field contains just the file name |
5903 | TraceFileLength | Current length of trace file in bytes |
The main reply packet may also include DATA subpackets which contain information about each connected database. The information in a DATA packet primary comes from the API used to connect to the database
DATA packets may include a PERF subpacket which contains timing information to open/write/close/open/read/close a file in the same path as the database. On a well performing system these numbers will be very similar.
Field# | Name | Description |
DATA 110 | DbName | Name of the database file or ODBC connection string. |
DATA 111 | Update | Indicates if the database can be written or is read only |
DATA 112 | Transactions | Indicates if the database is capable of SQL transactions |
DATA 113 | Version | Version of the database file etc, where known |
DATA 114 | CollatingOrder | Default sorting order |
DATA 115 | QueryTimeout | Query timeout for requests. Not all database engines support Query Timeout |
DATA PERF 120 | TickStart | GetTickCount() at beginning of test |
DATA PERF 121 | TickOpenWrite | GetTickCount() after the file has been created/opened for write access |
DATA PERF 122 | TickWrite | GetTickCount() after a small string has been written to the file |
DATA PERF 123 | TickCloseWrite | GetTickCount() after the file is closed |
DATA PERF 124 | TickOpenRead | GetTickCount() after the same file is immediately reopened in readwrite mode |
DATA PERF 125 | TickRead | GetTickCount() after the contents of the file is read |
DATA PERF 126 | TickCloseRead | GetTickCount() after the file is closed a second time |
DATA PERF 144 | TickErrorFile | GetTickCount() at the time an error on the file was encountered |
DATA PERF 143 | ErrorFile | Description of the error on the file encountered |
DATA PERF 142 | TickError | GetTickCount() at the time a general error was encountered |
DATA PERF 141 | Error | Description of the general error |
The main reply packet may also include CONN subpackets which contain information about connected databases. The information in a CONN packet primary comes from structures used by DbcDao2000 to manage the database itself. There will usaully be both a DATA and CONN packet present for each database.
Field# | Name | Description |
CONN 110 | DbTypeCode | Id of database type |
CONN 111 | DbType | Textual version of CONN.110 |
CONN 112 | FlagOdbc | |
CONN 113 | FlagIsolate | |
CONN 114 | FlagSqlServer | |
CONN 115 | FlagDummyRead | |
CONN 116 | FlagTxnIgnore | |
CONN 117 | KeywordQuoting | |
CONN 118 | Oracle | |
CONN 119 | Flags | |
CONN 120 | CurOpenRO | Number of read only cursors currently open |
CONN 121 | CurOpenRW | Number of read write cursors currently open |
CONN 122 | DiscMsgLogged | |
CONN 123 | TamperState | |
CONN 124 | CacheLimit | Number of rows to cache on load if the database supports this |
CONN 125 | ConnectStatus | |
CONN 126 | UseDisconnect | Is disconnecting from idle databases enabled |
CONN 127 | DisconnectInterval | Number of idle seconds before a database will disconnect |
CONN 128 | LastUsed | When this database was last used by the application |
CONN 129 | FlagMetaDirect | |
CONN 130 | FlagAllowIdentity | |
CONN 131 | TotalOpenRO | Total number of read only requests performed |
CONN 132 | TotalOpenRW | Total number of read write requests performed |
CONN 133 | TotalInserts | Total number of insert operations |
CONN 134 | TotalEdits | Total number of edit operations |
CONN 135 | TotalDeletes | Total number of delete operations |
CONN 136 | TotalUpdates | Total number of requests to commit/update database |
CONN 137 | TotalUpdateErrors | Number of errors encountered during updates. Errors can occur in normal operation, so a non zero value does not necessarily mean there is a problem |
The CONN packet may contain HIST packets which detail the recent history of Sql statements issued.
Field# | Name | Description |
CONN HIST 110 | Sql | Actual SQL statement for database. This field might be editted from actual in some cases, specifically if sensitive (customer type) information could be revealed |
CONN HIST 111 | Dt | Date time the sql started processing |
CONN HIST 112 | OpenTime | Number of milliseconds the database engine took to respond to the "open" phase of the request. This is generally a good indicator to database performance, although variation will often be seen. |
The CONN packet may contain ERRO packets which detail the recent errors trapped
Field# | Name | Description |
CONN ERRO 110 | Text | Error text reported by the database engine |
Example of dbcdao2000_Overview reply (XML)
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> - <DATS> <DATA> <DbName>C:\customers\dev1901\fpos.mdb</DbName> <Update>1</Update> <Transactions>1</Transactions> <Version>4.0</Version> <CollatingOrder>1033</CollatingOrder> <QueryTimeout>9000</QueryTimeout> <FILE> <Size>1118457856</Size> <Attibutes>32</Attibutes> </FILE> <PERF> <TickStart>14091640</TickStart> <TickOpenWrite>14091640</TickOpenWrite> <TickWrite>14091640</TickWrite> <TickCloseWrite>14091640</TickCloseWrite> <TickOpenRead>14091640</TickOpenRead> <TickRead>14091640</TickRead> <TickCloseRead>14091640</TickCloseRead> </PERF> </DATA> <CONN> <DbTypeCode>1</DbTypeCode> <DbType /> <FlagOdbc>0</FlagOdbc> <FlagIsolate>0</FlagIsolate> <FlagSqlServer>0</FlagSqlServer> <FlagDummyRead>1</FlagDummyRead> <FlagTxnIgnore>0</FlagTxnIgnore> <KeywordQuoting>1</KeywordQuoting> <Oracle>0</Oracle> <Flags>0</Flags> <CurOpenRO>0</CurOpenRO> <CurOpenRW>0</CurOpenRW> <DiscMsgLogged>0</DiscMsgLogged> <TamperState>1</TamperState> <CacheLimit>700</CacheLimit> <ConnectStatus>1</ConnectStatus> <UseDisconnect>1</UseDisconnect> <DisconnectInterval>1335.000000</DisconnectInterval> <LastUsed>02-Jul-2016 09:35:15</LastUsed> <FlagMetaDirect>0</FlagMetaDirect> <FlagAllowIdentity>0</FlagAllowIdentity> <TotalOpenRO>35</TotalOpenRO> <TotalOpenRW>10</TotalOpenRW> <TotalInserts>0</TotalInserts> <TotalEdits>5</TotalEdits> <TotalDeletes>0</TotalDeletes> <TotalUpdates>5</TotalUpdates> <TotalUpdateErrors>0</TotalUpdateErrors> <HIST> <Sql>Select * from Sales where completedDT is NULL and sid >= 8388608 and sid <= 16777215</Sql> <Dt>02-Jul-2016 09:35:15</Dt> <OpenTime>203</OpenTime> </HIST> <HIST> <Sql>select * from settings settings where KeyName='SysMaxDbCheckFirstWarn' and lane=1 and location=4</Sql> <Dt>02-Jul-2016 09:35:14</Dt> <OpenTime>0</OpenTime> </HIST> <ERRO> <Text>The Microsoft Jet database engine cannot find the input table or query 'versiondist'. Make sure it exists and that its name is spelled correctly.</Text> </ERRO> <ERRO> <Text>RSOpenRO: RS=01522210 SQL=select * from versiondist</Text> </ERRO> </CONN> <f100>121006</f100> <f110>2128</f110> </DATS>
121,007 Dbcdao2000_Metadata
This command is processed by dbcdao2000.dll if present and active. It returns complete metadata of the database(s) such as tables, fields and indexes.
The response is intended only to show user level information, system level tables may be excluded
121,008 Reply Packet
This reply packet is not yet fully documented.
Field# | Name | Description |
+DMEG | These packets contain information about a group of tables, aka a table | |
+DMEF | These packets contain information about a single field in a DMEG (table) | |
+DMEK | Contains information about an index on a DMEG (table) |
121,008 Dbcdao2000_Users
This command is processed by dbcdao2000.dll if present and active. It attempts to return information about connected users on the database. This is especially useful for Access (Jet) databases being shared over the network.
121,008 Reply Packet
This command returns USER subpackets in the reply.
Field# | Name | Description |
USER 100 | ComputerName | Name of the computer for this user |
USER 101 | UserName | Name of the database user. This is not necessarily a PC login name. Actual contents varies by database type |
USER 102 | IPAddr | IP address of users computer, if possible. |
Example of dbcdao2000_Overview reply (XML)
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <DATS> <USER> <ComputerName>DEVDELL</ComputerName> <UserName>admin</UserName> <IPAddr>127.0.0.1</IPAddr> </USER> <USER> <ComputerName>OPSUPPORT350B</ComputerName> <UserName>admin</UserName> <IPAddr>10.50.23.17</IPAddr> </USER> <f100>121008</f100> <f110>2128</f110> </DATS>
121,009 Dbcdao2000_FullStats
This command is processed by dbcdao2000.dll if present and active. It opens the database file directly (read only, non locking) and attempts to decode the internal structure. From this it is able to report where the space is being used in the database. The output is not intended for direct human consumption and may need further processing to be intelligible.
121,009 Reply Packet
This reply packet is not yet fully documented.
121,010 Dbcdao2000_Fix
This command is processed by dbcdao2000.dll if present and active. It decodes and processes a range of commands and changes various attributes in the database.
121,010 Command Packet
Field# | Name | Description |
f602 | The command to be executed. 83 - change a field attributes to AllowZeroLength | |
f603 | The target table | |
f607 | The target field |
121,010 Reply Packet
Example - Changing field locations.postcode to AllowZeroLength in a running Point of Sale
Command:http://IP:port/gnap/M/buck?3=fieldpineinternal.fdl911.fetch&100=121010&602=83&603=locations&607=postcodeResponse (Success)
<DATS> <f100>121010</f100> <f110>268</f110> </DATS>