Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2014
    Posts
    294

    Unanswered: Character based substring

    Hi,

    I have a scenario as I need to fetch a part of word from the string based upon the symbol from the literal.

    sentence : abde.fghi

    from the above literal I need to fetch the characters after the .(dot) symbol.
    here abde & fghi are dynamic.

    can some one give me a query on this.

  2. #2
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    take a look at multiple functions together, such as substr, length and locate.
    Dave

  3. #3
    Join Date
    Jul 2014
    Posts
    294
    This is what I tried & its working

    SELECT substr(COLUMN_NAME,locate('.',COLUMN_NAME)+1,lengt h(substr(COLUMN_NAME,locate('.',COLUMN_NAME)+1))) from SYSIBM.SYSDUMMY1;

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •