ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Substring in a declare

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

  • Substring in a declare

    Can I not use a variable in a substring on a declare statement? The following code doesn't compile.
    PHP Code:
            Exec Sql
             
    Declare MainCursor Cursor For
               
    Select myfield1 From myfile
               Where Substring
    (myfield2, :Indx ,1) = 'Y'

  • #2
    Re: Substring in a declare

    is Indx defined as an integer? if not then it won't work.
    I'm not anti-social, I just don't like people -Tommy Holden

    Comment


    • #3
      Re: Substring in a declare

      Got it figured out, thanks! It was the integer problem and a typo.

      Comment

      Working...
      X