DEFINE NEW GLOBAL SHAREDPRIVATE PROTECTED STATICTEMP-TABLE temp-table-name NO-UNDONAMESPACE-URI namespace NAMESPACE-PREFIX prefixXML-NODE-NAME node-name SERIALIZE-NAME serialize-nameREFERENCE-ONLYLIKE table-nameVALIDATEUSE-INDEX index-name AS PRIMARYLIKE-SEQUENTIAL table-nameVALIDATEUSE-INDEX index-name AS PRIMARYRCODE-INFORMATIONBEFORE-TABLE before-table-nameFIELD field-nameAS data-type LIKE field VALIDATEfield-optionsINDEX index-nameAS IS UNIQUE PRIMARY WORD-INDEXindex-field ASCENDING DESCENDINGNEW SHARED TEMP-TABLE temp-table-nameNEW GLOBAL SHARED TEMP-TABLE temp-table-nameSHARED TEMP-TABLE temp-table-nametemp-table-namePRIVATE PROTECTED STATIC TEMP-TABLEDefines and identifies a temp-table object as a data member of a class, and optionally specifies an access mode (PRIVATE or PROTECTED) and scope (instance or STATIC) for that data member. You cannot specify any of these options for a temp-table in an interface definition (INTERFACE statement block) or when defining a temp-table as a data element of a procedure.
Note: The specified options are applicable only when defining a data member for a class in a class definition (.cls) file. Note also that you cannot shadow (override) the definition of a given temp-table data member in a class hierarchy.For more information on accessing temp-tables of different access modes and scopes, see the reference entry for Class-based data member access.For more information on where and how to define data members in a class, see the CLASS statement reference entry.TEMP-TABLE temp-table-nameNAMESPACE-URI namespaceNAMESPACE-PREFIX prefixXML-NODE-NAME node-nameAn optional CHARACTER constant that specifies the name of the XML element representing the temp-table in an XML Document. The default is temp-table-name. Use this option when the serialized name either contains invalid characters for an ABL name or the serialized name is an ABL keyword.SERIALIZE-NAME serialize-nameAn optional CHARACTER constant that specifies the name of the temp-table as it should appear when serialized, for example into JSON or XML. The default is temp-table-name. Use this option when the serialized name either contains invalid characters for an ABL name or the serialized name is an ABL keyword.Specifies the name of a table whose characteristics the temp-table inherits. All field definitions of table-name are added to the temp-table. table-name can represent a database table or another temp-table.
Note: The source (temp-table or database table) for table-name can have any access mode or scope as long as its definition is accessible to the current temp-table definition.HELP options are inherited from the table-name. Validate options are inherited only if the VALIDATE keyword is used.For example, to make the index country-post the primary index (thereby, overriding the default primary index CustNum in the table Customer), you specify it as follows:
DEFINE TEMP-TABLE mycust LIKE CustomerUSE-INDEX CustNum USE-INDEX country-post AS PRIMARY.Specifies the name of a table whose characteristics the temp-table inherits. All field definitions of table-name are added to the temp-table. table-name can represent a database table or another temp-table.LIKE-SEQUENTIAL is similar to LIKE in all ways except one. Unlike LIKE, which creates temp-table fields in _field._field-rpos order (POSITION order in the .df schema definition file) of the source table’s fields, LIKE-SEQUENTIAL creates fields in _field._order sequence.BEFORE-TABLE before-table-nameFIELD field-nameAS data-typeFor more information on these data types, see the Data types reference entry.
DEFINE TEMP-TABLE ttObjHolder FIELD MyObj AS CLASS Progress.Lang.Object.LIKE fieldIf the database field is a COLUMN-CODEPAGE CLOB, the temp-table field is in the database field’s code page. If the database field is a DBCODEPAGE CLOB, the temp-table field’s code page is -cpinternal.You can override selected characteristics of the field or variable with the field-options parameter.HELP help-textSERIALIZE-NAME serialize-nameAn optional CHARACTER constant that specifies the name of the temp-table field as it should appear when serialized, for example into JSON or XML. The default is temp-table field-name. Use this option when the serialized name either contains invalid characters for an ABL name or the serialized name is an ABL keyword.TTCODEPAGE COLUMN-CODEPAGE codepageSpecifies the code page for a CLOB field in the temp-table. If you specify TTCODEPAGE, the code page is -cpinternal. If you specify COLUMN-CODEPAGE, codepage must be a valid code page name available in the DLC/convmap.cp file. You cannot specify the "undefined" code page for a CLOB. The code page you specify overrides any code page inherited through the LIKE option.If you do not specify a code page for a CLOB field in the temp-table, the default code page is -cpinternal.XML-DATA-TYPE stringFor more information about the ABL XML data type mapping rules, see OpenEdge Development: Working with XML.XML-NODE-TYPE stringAn optional CHARACTER constant that specifies the XML node type of the temp-table field, which lets you specify how the field is represented in XML. Valid option values are: "ATTRIBUTE", "ELEMENT", "HIDDEN", and "TEXT". The default value is "ELEMENT".Table 34 lists the valid XML node types.
Table 34: The XML node type of a temp-table field that represents an array must be either "ELEMENT" or "HIDDEN".
Note: XML-NODE-NAME node-name
Note: For more information and a description of all other field options, see the DEFINE VARIABLE statement.INDEX index-name AS IS UNIQUE PRIMARY WORD-INDEXindex-field ASCENDING DESCENDING
DEFINE TEMP-TABLE foo NO-UNDOFIELD a AS CHARACTERFIELD b AS CHARACTERFIELD c AS CHARACTERINDEX x a DESC b DESC c DESC.
DEFINE TEMP-TABLE foo NO-UNDOFIELD a AS CHARACTERFIELD b AS CHARACTERFIELD c AS CHARACTERINDEX x a DESC b c.
DEFINE TEMP-TABLE foo NO-UNDOFIELD a AS CHARACTERFIELD b AS CHARACTERFIELD c AS CHARACTERINDEX x a ASC b DESC c DESC.
DEFINE TEMP-TABLE foo NO-UNDOFIELD a AS CHARACTERFIELD b AS CHARACTERFIELD c AS CHARACTERINDEX x a ASC b DESC c.The following procedure creates a temp-table (temp-item) that stores the total inventory value (Item.Price * Item.OnHand) for each catalog page (Item.CatPage) in the sports2000 database. It builds temp-item with two indexes-one that sorts the table in ascending order by catalog page and a second that sorts the table in descending order by inventory value.For examples of instance and static temp-table data member definitions, see the descriptions of r-CustObj.cls, r-CustObjStatic.cls, and r-CustObjAbstract.cls in the CLASS statement reference entry.
A temp-table can be compile-time defined (often referred to as a static temp-table object), where the temp-table is defined and created at compile time using this statement, or it can be run-time defined (often referred to as a dynamic temp-table object), where the temp-table is defined and created at run time using the CREATE TEMP-TABLE statement and temp-table object handle operations. A compile-time defined temp-table can also be defined as a static data member of a class. In this case, it is a static temp-table object that is also a class static data member.
You cannot define a SHARED or NEW SHARED temp-table in a class definition (.cls) file. If you do, ABL generates a compilation error.
The point at which the AVM stores temp-table overflow from memory to disk is based on the setting of the Number of Buffers for Temp-tables (-Bt) startup parameter, which specifies the number of buffers in the temp-table database pool. For more information, see OpenEdge Deployment: Startup Command and Parameter Reference.
See OpenEdge Getting Started: ABL Essentials for information on temp-tables and work tables.
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |