remove special characters

Hello

How to remove special characters except '-'',' '. " in a string.

Database: 10g

Thank you

Hello

For example, use the REGEXP_REPLACE

REGEXP_REPLACE (str

, '[^-,.]'

)

I hope that answers your question.

If this isn't the case, please post a small example data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the results desired from these data.

In the case of a DML (UPDATE), for example, the sample data should show what looks like the tables before the DML, and the results will be the content of the or the tables changed after the DML.

Explain, using specific examples, how you get these results from these data.

Always say what version of Oracle you are using (for example, 11.2.0.2.0).

See the FAQ forum: https://forums.oracle.com/message/9362002#9362002

Tags: Database

Similar Questions

  • How to remove special characters from the string using translate() without typing all special characters?

    Hi all

    I am trying to remove special characters without the help of regular expressions.

    translate (the column name or string,'!@#$ & * (* () _) * "" :} {?}) >? /, «, » ')

    I want to eliminate this manual process to give all special characters using a chr() or ascii() function.

    Please show me the way.

    Thanks in advance

    Similar to the solution of Michael...

    SQL > ed
    A written file afiedt.buf

    1 with t as (select "[it comes of the #] [more amazing!") Test @# "$* & $%) assuming chain cost $ 5 000' double Str)
    2, i like (select level 1 c from dual connect by level<=>
    3 less
    4 Select + 32 (level-1) double connect by level<=>
    5 less
    6 select + 58 (level-1) double connect by level<=>
    7 less
    8 select + 91 (level-1) double connect by level<=>
    9 less
    10. Select 123 + (level-1) from dual connect by level<=>
    11 less
    12. Select 255 double
    13            )
    14, ts as (select level r, substr (str, level 1) c
    15 t
    16 connect by level<=>
    17             )
    18, tf as (select row_number() (order for r) r
    19                    ,ts.c
    20 TS
    21 I join on (i.c = ascii (ts.c))
    22             )
    23 select replace (sys_connect_by_path(c,'!'),'! ') Str
    24 TF
    25 where connect_by_isleaf = 1
    26 connect r = prior r + 1
    27 * start with r = 1
    SQL > /.

    STR
    -----------------------------------------------------------------------------------------------------------------------
    Thisisthemostamazingtest¸astringcosting5000

    Or something as horrible as this...

    SQL > ed
    A written file afiedt.buf

    1 with t as (select "[it comes of the #] [more amazing!") Test @# "$* & $%) assuming chain cost $ 5 000' double Str)
    2, I like (select replace (sys_connect_by_path (chr (c), 'A'), 'A') as tr)
    3 of)
    4 select c, rownum r
    5 (select 32 + (level-1) as the double connection by level c<=>
    6                         union
    7 select + 58 (level-1) double connect by level<=>
    8                         union
    9 select + 91 (level-1) double connect by level<=>
    10 the union
    11. Select 123 + (level-1) from dual connect by level<=>
    12 union
    13. Select 255 double
    14 tri 1
    15                        )
    16                  )
    17 where connect_by_isleaf = 1
    18 log r = prior r + 1
    19 start with r = 1
    20            )
    21 select translate (str, 'A' |) TR, 'A') as str
    22 * t, I
    SQL > /.

    STR
    --------------------------------------------------------------------
    Thisisthemostamazingtest¸astringcosting5000

  • How to remove special characters that are not available in the key board

    Hi all
    How to remove special characters that are not available in the key board.
    select '106    ©      500049' str from dual;
    
    After removal of the special symbols ( not only copy right, it can be any special symbol other than key board symbols), I want to add a single space between two number.
    
    Output should be like:
    Str
    106 500049
    Thank you for your help in advance.
    select
     '106    © ® (k)      500049' str
    ,regexp_replace('106    © ® (k)     500049', '[^[:digit:]]+', ' ') r
    from dual
    
  • Function to remove special characters

    I'm trying to figure out if there is a function anywhere in the Finder that can be used to remove special characters in a field. I wish they had just removed. Any help would be great.

    Thank you!

    934527,

    I'm glad it helped.

    When I said, "import" function, I should say, 'save' function. Using the administration tool of the Disco, the following should be done:

    -Connect to the instance of eul
    -Select Tools > register of PLSQL function
    -the import function (owner is SYS) and the function is in the package, 'STANDARD '. It seems that you did not identify SYS as the owner. In addition, it is very important to be aware that the 'STANDARD' is the package.

    Directions to the disco of 11g administration tool are here, http://docs.oracle.com/cd/E17904_01/bi.1111/b32519/adpsff01.htm.

    Patrick

    Published by: Patrick Bacon on May 20, 2013 14:32

  • Function to remove special characters in a column.

    Hi all

    In one of my column, we get special characters, as well as others. The data are extracted and loaded through Informatica. We are not face any problem while loading into the target, but when we try to extract these data through the report, it fails with the error:

    ORA-29275: partial multibyte character sets

    When we check this column, we find the special characters. Initially, we have implemented logic with the CHR to replace these NULL values. But every time we get different values. To make the permanent solution, we decided to remove all characters except available on Board of the key.

    Now, to this end, I need to write a function in Oracle's PL/SQL. I do not know more easy way from there to achieve. If I go with the CHR() function, I have to write for all these characters, which I think is not the right solution.

    Enjoy, if someone can help me identify the function or the way to get there.

    Thanks in advance.

    Hello

    AceNovice wrote:

    ... we have decided to remove all characters except available on key board...

    It depends on your keyboard.

    All that is on the keyboard you, something similar to this shoud work:

    REGEXP_REPLACE (string_column

    , '[^]0-9A-Za-z~!@#$%^&*()_+`={}| [\:";'' <>?,./-]'

    )

    This will return a copy of string_column, but with all the characters that are not not in the 2nd deleted argument.

    [Inside the brackets, ']' must come first (immediately after the ' ^') and '-' must come last.

  • How to find and remove special characters in the file name?

    I have a files in various Windows Server 2003 with a special character in its name, which cause problem with backup software, I Don t know which character is because in the browser that they do not appear and command line, they are listed only as a mark of the interrogation and for this, I Don t know how I'll find and delete then.

    Thank you.

    Ask in the forum Windows Server:
    http://social.technet.Microsoft.com/forums/en-us/category/WindowsServer

  • Request to remove special characters in a column

    How to retrieve only numbers in a column

    For example

    123-456-9876 need to be removed as a 1234569876

    -345 (123) - 6789 should be extracted as 1233456789

    + 1234567891111 should be extracted as 1234567891111

    Thank you

    IJ

    Hello

    Here's one way:

    SELECT REGEXP_REPLACE (str, '\D') AS digits_only

    FROM table_x;

    where str is the column.

    I hope that answers your question.

    If this isn't the case, please post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and also publish outcomes from these data.

    If you ask on a DML statement, such as UPDATE, the sample data will be the content of the or the tables before the DML, and the results will be the State of the or the tables changed when it's all over.

    Explain, using specific examples, how you get these results from these data.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: https://forums.oracle.com/message/9362002#9362002

  • SQL to remove special characters from my research

    Hello world.  I am very new to sql and hit another road block.  I do a query on my database in oracle sql developer.  I want to search numbers manufacturer but sometimes they were seized with dashes (999-99-9999) and other times not (999999999) is possible to use a function that give my number query and in the mfr_nbr database column on the dashboard in two?

    any help would be appreciated.

    Kelly

    Hi, Kelly.

    Of course, you can use REPLACE function to return a copy of a string, but with all dashes (if there is) removed.

    For example, if you have a string: user_input and you try to compare this to mfr_nbr, but you don't know if one (or two) contains dashes, you can tell

    ...

    WHERE REPLACE (: user_input, '-') =.

    REPLACE (mfr_nbr, '-')

    You might want to permanently remove the dashes in the table, like this:

    UPDATE table_x

    SET mfr_nbr = REPLACE (mfr_nbr, '-')

    WHERE mfr_nbr LIKE '%-% '.

    ;

    then add a CHECK constraint (mfr_nbr = REPLACE (mfr_nbr, '-')) and perhaps a trigger, to keep the dashes in the table.

  • How to remove special characters UNICODE as n

    Hi all
    In my RDF file, I should accomidate comes so that, whatever currupt characters (UNICODE symbols in particular) between the email_address, he must change his later character like that...

    The output of n should be n. It is a kind of example...

    When the input value is 'john.mun [email protected]' he must return to "[email protected]".

    I tried to use the following functions, but the result shows me always the same...

    Select UNISTR ("john.mun [email protected]") of the double

    Select translate (trim (email_address) {,'1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ WE8ISO8859P1 ~! #$% ^ & * () _ +} {":?"}) [> < ' =] ["'; /, ',' (1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ') of per_people_f]
    where employee_number = 3951

    Select CONVERT ('john.mun [email protected]', 'US7ASCII') of double

    Select regexp_replace ('john.mun [email protected]', ' [^-. @, a - z, A - Z, [: space:]]') twice;

    If you have any ideas... Please let me know...
    Thanks in advance
    Ravi.

    Published by: rkpinus on July 30, 2009 08:14

    rkpinus wrote:
    In my RDF file, I should accomidate comes so that, whatever currupt characters (UNICODE symbols in particular) between the email_address, he must change his later character like that...

    The output of n should be n. It is a kind of example...

    When the input value is "john.mun[email protected]"he should return to ' [email protected]'

    You said it is corrupt, and you know n must be converted to n.

    You can add more characters you know the output should be, just add it to the function to translate.

    SQL> select
      TRANSLATE ( 'john.muñ[email protected]' ,'üéâäàåêëèïîìÄÅÉæÆôöòîìÅæáíóúñÑ','ueaaaaeeeiiiaaeaaoooiiaaaiounn')
    from dual ;
    
    TRANSLATE('JOHN.MUñO
    --------------------
    [email protected]
    

    SS

  • Values between removal of special characters

    Hi all

    I'm using the version of oracle 10.2

    create table
    CREATE TABLE DMM.foretst
    (
      lastname       varchar2(20 BYTE)
    );
    INSERT orders
    insert into foretst  (lastname) values
    ('ted'); 
    
    insert into foretst  (lastname) values
    ('teddy {abc}'); 
    
    insert into foretst  (lastname) values
    ('paul #'); 
    
    insert into foretst  (lastname) values
    ('paul #ggg#'); 
    
    insert into foretst  (lastname) values
    ('parker #'); 
    
    insert into foretst  (lastname) values
    ('ash 1'); 
    
    insert into foretst  (lastname) values
    ('$123$ vini'); 
    power required
    lastname
    ted
    teddy
    paul
    paul
    parker
    ash
    vini
    I know how to remove special characters. How to remove values between two special characters?

    any help is appreciated.

    Thanks in advance

    Something like that...

    Ranit>> select
      2  regexp_replace(lastname,'[^a-zA-Z]+(.)*[^a-zA-Z]+','')
      3  from foretst;
    
    REGEXP_REPLACE(LASTNAME,'[^A-ZA-Z]+(.)*[^A-ZA-Z]+','')
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    ted
    teddy
    paul
    paul
    parker
    ash
    vini                                                                                                                                                                                                                        
    
    7 rows selected.
    
  • very special characters in columns

    I am trying to remove special characters from a db column using the below query, but I'm not getting results can someone help

    Select replace (CHR. (5) |) ' ABC'. Chr (1) | ' lkaljsk', Chr (5) | » '|| Chr (1)) double

    SQL > select regexp_replace (CHR. (5) |) ' ABC'. Chr (1) | ' lkaljsk ',' [' | CHR. (5) |] » ' || Chr (1) | ') of double
    2.

    A
    ----------
    abclkaljsk

    SQL >

    SY.

  • Bunch of Oracle on the special characters in a string - translate?

    How to remove special characters in a string, it can contain. , (space), etc.

    SELECT TRANSLATE('123.456 (90-90)', '', '') FROM DUAL
    

    Basically I want to undress and to compare with the db value.

    WHERE TRANSLATE(TABLE.NUMCODE, '', '')  = TRANSLATE('123.456 (90-90)', '', '') 
    

    Use TRANSLATE, since you're on 9i. For example:

    TRANSLATE (your_string,'X,. #! % @$ ^ & * () _-+=', 'X')

    Removes all the s characters in ', #! % @$ ^ & * () _-+=' of your_string.

    SY.

  • Replace special characters in the FDF

    Hello

    I've looked everywhere and can't find the answer to this simple problem.  I can handle javascript in an HTML environment using free scripts, but it is not so easy in a PDF form.  I use Adobe Acrobat 9 Pro and I have a form that once completed and submitted, generates and sends a FDF file.  I use a script on the server side, called FormGenie do this and the script hate parentheses and some other characters, they break the FDF file.  Everything I want to do is set up a document level Javascript that find and replace all instances of these special characters with something license as a hyphen - or just a space.

    I tried:

    function clearText() {}
    document. FormName.FieldName.Value = filterNum (document. FormName.FieldName.value)

    function filterNum (str) {}
    re = /\$|#|~|\%|\*|\^|\(|\)|\+|\=|\[|\]|\[|\}|\{|\;|\"|\<|\>|\?| \|| \\|\!| \$/g;
    remove special characters as ' $' and ',' etc...
    return str.replace (re, "-");
    }
    }

    and

    function clearText2 (str) {}

    stringName = stringName.replace (/------$| #| ~ |------% |------* |------^ | \(|\) |--------+ |------= |------[|------] |------[{|------} |------{|------; |------"|"}]) ------< | ------> | \ ? | \|| \\|\!| \$ /g,'-');
    }

    I know that these are not good, but I have to be at least barking to the top of the tree on the right.

    Can anyone help?

    Thank you

    You create the form in Acrobat or LiveCycle Designer?

    In general, you can place a script typo in the script of the text of each filter field field hit, in the case where something replacing the user typed with something else would not cause the concern of the user. An alternative would be to be implemented a script that parses the fields just before the submission form action takes place and not to replace them.

    For example, you can use the following JavaScript typo customized for text fields created in Acrobat:

    If (! event.willCommit) {}

    Event.change = event.change.replace (/ [------$# ~ %------*------*------^ \ (\)------+=------[\]------{\};------"\<\>\?]) \ | \\\ !] /g, "-");

    }

    and it will replace these characters when the user types the data into a text field. May not include all the character you want replaced, but you should get the idea.

  • Remove the spaces and special characters.

    Hi all

    Here is the table of phone having a column that is 'phno' and the values are the below in this format.

    I need given the output.

    My client uses oracle 8i version.

    EmplId

    PhNO

    output

    121212

    605/339-9276

    6053399276

    222222

    251/813-0663

    8132510663

    323232

    208-585-1594

    2085851594

    232323

    352.735.8285

    3527358285

    Thank you

    music

    Hello

    DEFINITION of use,

    If it is possible to enumerate all special characters, do this way:

    SELECT emplid, phno

    REPLACE (phno

    , '9 ./'

    , '9'

    ), Exit

    FROM table_x

    ;

    If it is impossible, or if it is easier to display the characters that you want to keep, then do it like this

    SELECT emplid, phno

    REPLACE (phno

    , '9  || TRANSLATE (phno

    , ' ?' 0123456789

    . '?'

    )

    , '9'

    ), Exit

    FROM table_x

    ;

    Whatever it is, the argument 3 of TRANSLATE is one of the characters that you want to keep (any), and the 2nd argument is that same character, followed by all the characters that you want to remove.

    Nevermind, you use such an old version.  Regular expressions are much easier.

    This will leave 1 "at the beginning of '13527358285'.  How to remove characters like this depends on means exactly what "characters like this.  It can probably be done in Oracle 8 without too many problems, according to your needs.

  • Remove the spaces and special characters to a form field

    Hello

    I am tragically new to all this, but I'm trying to create a form in Adobe Acrobat 9.  I am trying to use a custom script Format to make entries in a form field and automatically remove the spaces and special characters (hyphens specifically).  For example, if a user 'RAN - 99 06' entries I want to change it to "RAN9906."  I found this script that does not allow users to input special characters

    If (! event.willCommit) {}


    Event.change = event.change.replace (/ [------$# ~ %------*------*------^-------------(\)------+=------[\]------{\}; \ "\ <>\ \?"]) \ | \\\ !] /g, "");

    }

    And it's OK, but I can't understand how to prohibit the spaces.  In addition, the perference would be a script to allow users to enter data as they wish, but to clean after leaving the text field.

    Thanks in advance!

    Yes, there are a few changes during the passage of the code of the event in the sequence of keys to the Validate event.

    First of all, you need not try the willCommit. In fact, when the sequence of events of field reached the Validate event, the field is already committed. The Validate event does not therefore the property of willCommit.

    Secondly, in the Validate event, you work on the event.value and either event.change. Thus, you will replace accordingly.

    And who should actually do.

    I hope this can help.

    Max Wyss.

Maybe you are looking for

  • "Mesh" networking Possible with the Airport extreme?

    Now many of you may have heard talk about Eero and Luma, whose routers create a scope "mesh" network by installing 2-3 of their units close to each other.  Whether you're home devices move from one access point to another without a decrease in perfor

  • Printer HP 2512 has stopped working

    Original title: 2512 hp printer I have a printer of hp 2512 during vacation Bible School, it ceased its print job, but not print kept looking at it has been replaced by hp to a 2510-2512, so what I'm doing and I can't find the disc that came with the

  • Failure USB port?

    I just want this message and the sound that accompanies it, go away.  There is nothing in my USB port.  The message said: one of the USB devices attached to this computer has malfundtioned and windows does not recognize it.  This is accompanied by a

  • Aspire E1-510 Windows 7 drivers

    I bought this laptop a few months ago.  Aspire E1-510 Windows 8 I hated windows 8 and I was unable to get windows 7 on it until this month when I finally noticed that they put out an update of the bios. And I was able to get windows 7 installed. Afte

  • BBM BBID

    I have a new passport (work).  My old Q10 was work as well.  I am trying to unlock the Q10 so that I can use a Sim Card we on it.  With that, I would like to, so I can use all my BBM contacts.  When I go to access the BBM Contacts it says that there