DEFINE [ PRIVATE | PROTECTED ] [ STATIC ] DATA-SOURCE data-source-name
FOR [ QUERY query-name ]
[ source-buffer-phrase [ , source-buffer-phrase ] ... ]
|
[ PRIVATE
| PROTECTED
] [ STATIC
] DATA-SOURCE
data-source-name FOR
A data-source defined with the STATIC option is a static data member of the class type for which it is defined and is scoped to the ABL session where it is referenced. ABL creates one copy of the specified class static data-source on first reference to the class type, and ABL creates only one such copy for any number of instances of the class that you create. You can directly reference an accessible static data-source data member from any other static or instance class member defined in the same class or class hierarchy.
Without the STATIC option, ABL creates an instance data-source data member that is scoped to a single instance of the class where it is defined. ABL creates one copy of the specified instance data-source for each such class instance that you create. You cannot directly reference an instance data-source data member from a STATIC class member definition defined within the same class or class hierarchy.
If the data-source is a data member of a class, you must specify the name of a compatible query. Thus, if the data-source is a static data member, the query must also be a static data member; if the data-source is PROTECTED, the query must also be defined as PROTECTED or inherited from a super class; and if the data-source is PRIVATE, the query can be defined as either PRIVATE or PROTECTED.
The name of the database or temp-table buffer. If the data-source is a data member of a class, you must define and specify the name of a compatible buffer data member for the table. Thus, if the data-source is a static data member, the buffer must also be a static data member; if the data-source is PROTECTED, the buffer must also be defined as PROTECTED or inherited from a super class; and if the data-source is PRIVATE, the buffer can be defined as either PRIVATE or PROTECTED. If the data-source is a PRIVATE instance data member, you can also specify a default database table buffer; you cannot specify a default database buffer for a data-source data member defined with any other combination of access mode and scope.
KEYS ( { field1 [ ,
fieldn ]... | ROWID
} )
A data-source can be compile-time defined (often referred to as a static data-source object), where the data-source is defined and created at compile time using this statement, or it can be run-time defined (often referred to as a
dynamic data-source object), where the data-source is defined and created at run time using the
CREATE DATA-SOURCE statement and data-source object handle operations. A compile-time defined data-source can also be defined as a static data member of a class. In this case, it is a static data-source object that is also a class static data member.