Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2004
    Posts
    3

    Unanswered: Removing embedded tabs

    Have about 16000 rows in an Oracle table that has embedded tabs in it. These tabs are causing a conversion program to fail. Does anyone know how I can remove them using PL/SQL?

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Use the SQL function REPLACE

  3. #3
    Join Date
    Jan 2004
    Posts
    3
    Good idea but I can't get this to work since I can't clearly represent the 'tab' character. I can't simply to replace(string, 'TAB',''). Can I replace an ASCII value? That's what I'm asking.

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Spoon fed answer follows:

    1 declare
    2 tab varchar2(1) := chr(9);
    3 scr_string varchar2(127) := 'abc' || tab || 'def';
    4 dst_string varchar2(127);
    5 begin
    6 dst_string := replace(scr_string,tab);
    7 dbms_output.put_line(dst_string);
    8* end;
    acd@MWH.ARES.ABC.COM> /
    abcdef

    PL/SQL procedure successfully completed.

  5. #5
    Join Date
    Jan 2004
    Posts
    3
    Thank you for special feeding. Exactly what I needed.

  6. #6
    Join Date
    Jul 2003
    Posts
    2,296
    when in doubt, lookup ASCII
    Some day you will need to remove or add Carriage Returns and you will think back on this post and smile.
    - The_Duck
    you can lead someone to something but they will never learn anything ...

Posting Permissions

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