DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: Function to replace text

Threaded View

  1. #5
    Join Date
    Aug 2003
    Posts
    100

    Actual query

    Here's the query...

    select substr(a.mcrp30,4,2)||decode(b.ibsrp8,'H',1,0)||replace(c.imaitm,'#',' ')||trim(substr(a.mcrp30,1,3)) as ITEM_CODE
    from f0006 a, f4102 b, f4101 c
    where a.mcmcu = b.ibmcu
    and b.ibitm = c.imitm

    and here's the result. Crap! I lost all the formatting, but imagine that the first line reads: 580~~100276R1~~423 (where ~ = spaces)

    ITEM_CODE
    ----------------------------------
    580 100276R1 423
    580 100662 423
    580 E2170R2 423
    580 E2181R1 423
    580 E6407R8 423
    580 E6946R9 423
    580 E8268R5 423
    580 E9395R3 423
    580 EE0142R2 423
    260PGM1002C 408
    260PTS1000A 408

    What I need for it to look like is this (18 chars total):

    580 100276R1 423

    Steve
    Last edited by ssmith001; 09-23-2003 at 04:11 PM.

Posting Permissions

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


Click Here to Expand Forum to Full Width