LTrim property: SQL class

Description

This property specifies whether values read by the Fetch method are trimmed of blanks on the left, except in the following cases:

  • For long columns.

  • The record is directly used to buffer the incoming data. In the following example, the values aren't LTrimmed - regardless of the setting of the LTrim property.

    Local Record &Rec = CreateRecord(Record.QA_TEST);
    Local SQL &Sql = CreateSQL("%SelectAll(:1)");
    &Sql.LTrim = True; /* the default */
    &Sql.Execute(&Rec);
    While &Sql.Fetch(&Rec)
       /* do processing */
    End-While;
    

This property takes a Boolean value. The default value is True. If this property is set to False, the selected values are not trimmed of blanks on the left.

This property is read/write.

Note:

The removal of blanks from the right end of fetched values (RTrimming) still occurs for non-long columns.

Example

Local Record &Rec = CreateRecord(Record.QA_TEST);
Local SQL &Sql = CreateSQL(%SelectAll(:1)", &Rec);
&Sql.LTrim = False;
While &Sql.Fetch(&Rec)
   /* do processing */
End-While;