version 1.5
OP Records in table (connectionID; tableID; recordsInTable) Longint
Parameter | Type | Description | |
connectionID | Longint | Connection ID with target server | |
tableID | Longint | Number of the table in the database | |
recordsInTable | Longint | Number of records in the table | |
Function result | Longint | Error code result for the function |
Description
OP Records in table returns the number of records in table tableID in the recordsInTable variable.
Error Codes
If OP Records in table executes successfully, it return 0. Otherwise, this function returns one of the following errors:
Error Code | Description |
-9972 | Table number is out of range. |
10128 | The 4D Open for 4th Dimension package has not been initialized. |
10136 | The connection does not exist. |
10154 | This command cannot be executed right now. |
Example
C_LONGINT (vTableID;vFieldID) C_LONGINT (vRecords) C_LONGINT ($errCode;$nbHours) ` Get table ID $errCode:=OP Get one field number (vConnectID;"[Invoices]Amount"; vTableID;vFieldID) ` Get number of records in the table $errCode:=OP Records in table (vConnectID;vTableID;vRecords) ` Compute average time to process entire file $nbHours:=vRecords*<>avgTimePerRecord If ($nbHours > 8) ` If more than eight hours to process, get user's OK CONFIRM ("This operation will take more than eight hours"+Char (13) + "Proceed ?") If (OK=1) processInvoices End if End if
See Also
OP Get one field number, OP Records in selection, Records in table.