Creating dataItem parts from an SQL record part (overview)

After you declare structure items in an SQL record part, you can use a special mechanism in the EGL editor to create data item parts that are equivalent to the structure items. The benefit is that you can more easily create a non-SQL record (usually a basic record) for transferring data to and from the related SQL record at run time.

Consider the following structure items:

  10 myHostVar01 CHAR(3);
  10 myHostVar02 BIN(9,2);

You can request that dataItem parts be created:

  DataItem myHostVar01 CHAR(3) end

  DataItem myHostVar02 BIN(9,2) end

Another effect is that the structure item declarations are rewritten:

  10 myHostVar01 myHostVar01;
  10 myHostVar02 myHostVar02;

As shown in this example, each dataItem part is given the same name as the related structure item and acts as a typedef for the structure item. Each data item part is also available as a typedef for other structure items.

Before you can use a structure item as the basis of a dataItem part, the structure item must have a name, must have valid primitive characteristics, and must not point to a typedef.

Related concepts
SQL support

Related tasks
Creating dataItem parts from an SQL record part

Related reference
DataItem part in EGL source format
SQL record part in EGL source format