ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Problem with blank spaces

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with blank spaces

    Hello,
    i have a problem with blank spaces. I have defined my variable like this :

    d v1 s 150A VARYING

    My problem is that the input that im putting in "V1" can be 20 or 150 characters. I tried it with %trim but it doesnt work then i give the variable to a sql statement. The sql statement dont find the record.

  • #2
    Can you show us an example of what you're coding and the problem you're having?

    The definition by itself is not enough for us to understand the problem.

    Comment


    • #3
      If you use the RPG function %TRIM (before using it in SQL) all leading and trainling blanks should have been removed.
      If you put the SQL Function TRIM in your SQL statement around your host variable, i.e. TRIM( :YourHostVar), the leading and trailing blanks should also be removed.
      As Scott said, provide an example where it does not work.

      Birgitta

      Comment

      Working...
      X