Question

I have the following code in a 4gl module:

DEFINE f_drec RECORD LIKE verhistd.*
DEFINE f_input
   RECORD
      long_desc LIKE verhistd.long_desc
   END RECORD
Let f_input.long_desc = f_drec.long_desc

Where verhistd.long_desc is a TEXT data type. But when I compile the code I get this error message:

|
|      The variable "f_input.long_desc" is too complex a type to be used in an
| assignment statement.
| See error number -4323.

The error message for -4323 just talks about arrays and screen records, not TEXT data types.

Was it helpful?

Solution

I've not used TEXT datatypes in any of the 4gl code I have to maintain, however a quick view of the documentation about TEXT fields in the IBM 4GL By Example documentation suggests that 4GL treats Text blobs as a special case and does not load them by default due to the potential memory use.

If you view the example code they have in Example 18 (sorry, they only have pdf versions of the documentation online now) it should give you a fairly straight forward example of how to deal with a TEXT blob.

Because a BLOB column can contain a very large amount of data, a 4GL program does not allocate space for a BLOB variable as it does other variable types. Instead of containing the actual value, a BLOB variable contains a pointer to the location where this data is stored. This location can be in memory, in a temporary file created by the program, or in a specified file named by the programmer. The LOCATE statement initializes the BLOB variable with the location of the BLOB value.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top