Products Downloads


French version


 

 

ADELIA

VADELIA

SADELIA

WADELIA

MADELIA

(I/B)

(I/B) (S)

(B) (S)

(I/B) (S)

(I) (S)

 

Warning:

    • In the case of ADELIA programs, this instruction is only compatible with the RPG generator.
    • This instruction can only be used in server blocks, not in client blocks.

Section for use

All

 

Syntax

LOAD_SQL_LST ListName SeriesEntities Distinct Condition SortOption

 

SeriesEntities

Þ

SeriesEntities, Entity | Entity

Entity

Þ

EntityName CorrelationName

 

 

| EntityName

Distinct

Þ

*DISTINCT | None

Condition

Þ

AdeliaCondition | *COND(:VarId)

 

Description

This instruction reads the entity or entities SeriesEntities, obeying the (optional) condition Condition, and inserts the values of the fields in the entities into the fields in the list ListName. The fields in the list must have the same names as those in the entities.

 

If *DISTINCT is specified, only the distinct lines will be loaded (in relation to the list columns which have the same name as the entities' fields).

 

The read operation can follow an order concerning certain fields, the order being defined by the SortOption element.

Click here for the explanation of the SortOption element .

 

Warning: When the condition is contained in a variable *COND(:VarId), the latter will have to contain the "where" part of an SQL query. In this part, you must specify the real name of the columns and array, not the Adelia names.

 

Example

* loads the list of customers in the list CUSTLST

LOAD_SQL_LST CUSTLST CUSTOMERS *COND(CCUST_COUNTRY = :WCOUNTRY) *SORT(CCUST_NAME)

 

WREQUEST = 'CCUST_COUNTRY = ' 'France' ' OR CCUST_COUNTRY = ' 'USA' ' '

LOAD_SQL_LST CUSTLST2 CUSTOMERS *COND(:WREQUEST) *SORT(CCUST_NAME)

 

* In the DECL PGM section, declaration of a list (Visual Adelia syntax) with the names of its file fields:

LIST LST1_PCODE PDESCRIP PPRICE

...

LOAD_SQL_LST LST1_PROD PRODUCT *COND(PPRO_COD START_WITH :ZPRO_COD)

 

* In the DECL PGM section, declaration of a list (Adelia syntax) with the names of its file fields:

DECL LIST LST1_PCODE PDESCRIP PPRICE

...

LOAD_SQL_LST LST1_PROD PRODUCT *COND(PPRO_COD START_WITH :ZPRO_COD)

 

↑ Top of page

  • Aucune étiquette