ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Using LIKE in Embedded SQL

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

  • Using LIKE in Embedded SQL

    I am attaching my code. I would like to use LIKE in my embedded sql and is not working. Any suggestions.

    Thank you in advance.
    Tiara
    Attached Files

  • #2
    You could try using the "%" sign

    Try this - run the sql from within SQL to test first:

    Once you get it working then go back to RPG and correct it.

    Code:
    select * from libraries where odobnm like '%JAM%'
    or

    Code:
    select * from libraries where odobnm like 'JAM%'
    You could also define a constant for the quotes .. ''''

    Code:
    D*
    D Q               C                   CONST('''')
    D*
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      I got it to work so I am posting my code to help prog. with the same problem. This is a subfile using Embedded Sql.

      Thank you Jamie for your help
      Attached Files

      Comment

      Working...
      X