DBStruct
DBStruct() --> aStructGets the physical structure exposed by the RDD.
Overview
DBStruct returns field descriptors containing name, type, length and decimals. This alone does not represent SX3 rules, validations, sharing or indexes. Documentation uses length 10 for memo compatibility; it is not content capacity. The example only counts descriptors without reading records or reconstructing a production table. EDTRB identifies only an owned test table already open with the required schema and permissions; examples are not intended for standard tables. (TOTVS, n.d., ref. 1)
Syntax
DBStruct() --> aStructReturn value
Array of arrays: field name, type, length and decimals.
Commented example
#Include "Protheus.ch"
User Function Ed342()
Local aFields
If Select("EDTRB") > 0
aFields := EDTRB->(DBStruct())
ConOut(cValToChar(Len(aFields)))
EndIf
Return NilNumber of fields described by the RDD; table-dependent. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Check RDD, alias and pending operations. Navigation can flush updates; preserve context under the caller contract and handle errors in the complete routine.
- Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.