Consultor Eletrônico



Kbase 22048: How To Build an SDO Against a Large Database Table
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   8/22/2002
SUMMARY:

This Knowledge Base Solution applies to Progress Version 9.1A and higher. It provides instruction on how to construct an SDO (SmartDataObject) against a database table that contains a lot of fields.

When attempting to build an SDO off of a large database table, you might experience the following error messages:

** More than 4096 characters in a single statement--use -inp parm.
(135)

** More than 1024 items in a single statement. Use the -tok
parameter. (136)

Increasing the values for the -inp and -tok parameters from their default values to their maximum values takes care of the above error messages. However, you might still get the following error message when trying to compile the SDO:

Expression is too complex or statement is too long. (4384)

EXPLANATION:

Error 4384 happens because there is a limit to the number of levels of nesting that can be handled in Progress syntax. You can simplify an expression by using program variables to hold intermediate results.

In this case though, it is not possible to use variables to hold intermediate results because the issue here is associated with the DEFINE TEMP-TABLE statement, which attempts to define the SDO's rowObject temp-table with too many fields.

SOLUTION:

In order to work around this issue and to consequently eliminate the error messages above, follow these steps:

1) Using the Progress AppBuilder Tool, create and save an SDO against
your large database table (ignoring the compile errors).

2) Open the generated SDO include file (<sdo-name>.i) with the
Procedure Editor Tool so that you can manually edit it. Then,
a) Insert the following line at the top of the SDO include file:
LIKE <large-table-name> {&TEMP-TABLE-OPTIONS}
b) Remove all field definitions from the SDO include file, except
for the fields mapped to extents.
c) If many fields are mapped to extents, then remove the VALIDATE
option from all fields to reduce the DEFINE TEMP-TABLE statement size.

3) Open the SDO main program file (<sdo-name>.w) with the Procedure
Editor Tool so that you can also edit it manually (do not use the
AppBuilder Section Editor). Define the following preprocessor in
the SDO's definition section:

&SCOPED-DEFINE TEMP-TABLE-OPTIONS RCODE-INFORMATION

4) Save and compile the SDO.

NOTE: The above workaround is not a fix and is not Quality Assured.
We particularly recommend substantial testing before using this on tables that contain extent fields. The SDO does not support rowObject with extents so all database extent fields must be explicitly mapped (use the default code generated by AppBuilder). The LIKE option will also define the extent fields in the rowObject temp-table even though they are not used. This might cause some operations in the SDO to fail. Also, if fields are changed or added to the database, then the SDO should be reopened with AppBuilder and steps 1 through 4 should be repeated. This is to ensure that all preprocessors are generated properly and all extents are correctly mapped. If desired, it is possible to add validation before RCODE-INFORMATION in the TEMP-TABLE-OPTIONS preprocessor definition.


References to Written Documentation:

Progress Knowledge Base Solution 21661, "ADM2: SmartDataObjects, Error 135 and the -inp Parameter."