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.

Tags: Database

Similar Questions

  • 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

  • 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

  • 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

  • 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

  • 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
    
  • 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

  • Problem with special characters in a column

    Hello, I call data from a database and I don't have the rights to the database, the name of the columns have points on behalf here: Parameters.12V_Prog_IccType_A

    Is there a way to solve this problem with the name change? Like using (de), [,], "", or something like that?

    BR,

    Robin

    Try the square brackets.

    Mike...

  • 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

  • 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.

  • 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.
    
  • HII its special characters on

    I need to query the table EMP for EMPname column.

    I need to count the number of lines to contains special characters in the column EMPNAME.

    and after that, I would like to replace the special characters with a blank space...

    Can someone guide me for the same thing?


    Thank you


    see you soon

    Hello

    ROY wrote:
    big frank. Thnx for the index. But any idea on the number of lines special tanks.

    Sorry, I forgot about this.

    Your front end probably has a feature to display the number of lines. In SQL * Plus, it is

    SET   FEEDBACK    1
    

    To count the rows of the query itself, use the analytical COUNT function:

    WITH     got_new_empname          AS
    (
         SELECT     empname
         ,     TRANSLATE ( '!@#$%'     -- special characters
                     , '     '     -- exactly the same number of spaces
                     )        AS new_empname
         FROM    table_x
    )
    SELECT     n.*
    ,     COUNT (*) OVER ()     AS total_number          -- ADDED
    FROM     got_new_empname     n
    WHERE     empname          != new_empname
    ;
    
  • Find special characters in a string

    Hi all, I am using Oracle 10 g.

    I have a column name with special characters. How can I replace the special characters in the column with space and no space based on the special character. Please see the example below. can I use REGEXP_REPLACE?

    create table
    create table sample_test (
      Name    VARCHAR2(20 BYTE))
    Insert a table
     insert into sample_test values ('O''NEIL')
         insert into sample_test values ('B.E.VICTOR')
          insert into sample_test values ('WILLIAM,L')
           insert into sample_test values ('MARY-ANNE')
               insert into sample_test values ('VON_ANCKEN')
                insert into sample_test values ('BROWN;L')
    I would like the following output
     
    Special Character         Name         Expected Name                  Remarks      
     
    Single Quotes            O'NEIL                  ONEIL                          Remove quotes and no space        
    Dot                      B.E.VICTOR         B E VICTOR                          Replace with space        
    Comma                      WILLIAM,L         WILLIAM L                          Replace with space        
    Hyphen                      MARY-ANNE         MARY ANNE                          Replace with space        
    Underscore                VON_ANCKEN         VON ANCKEN                          Replace with space        
    Semi Colon              BROWN;L          BROWN L                          Replace with space      
    Please notify.

    Thank you
    Bob

    A simple solution without the use of regexp:

    -- Test Data
    with sample_test as
    (
    select 'O''NEIL' name from dual union all
    select 'B.E.VICTOR'  name from dual union all
    select'WILLIAM,L' name from dual union all
    select'MARY-ANNE' name from dual union all
    select'VON_ANCKEN' name from dual union all
    select'BROWN;L' name from dual
    )
    -- Query:
    select name old_name,
           translate(replace(name,'''',''),'.,-_;','     ') new_name
    from sample_test;
    

    Explanation:

    REPLACE deletes the quote
    TRANSLATE replaces point, comma, dash, semicolon and underscore

  • 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.

Maybe you are looking for

  • What is the bookmark button? It keeps disappearing.

    The button bookmark watch when the 'customize' but then everything disappears. What is this for?

  • MK IPhone?

    I got a new iPhone 6 last week, brought home... is entered a 5-digit code and got access to the device, but the next day, it has been disabled. How to reset the password?

  • Desktop HP 3515: 3515 hp desktop

    I have only a simple question. I have 8 GB of RAM memory on my pc. Can I put more. I saw four locations it s, 2 are used by 2 x 4 GB. Greetings, kolswadet

  • Call SIP with Tandberg C40

    I have a Cisco Tandberg C40 codec and have been making H.323 calls for an organization with no problems.  The organization is now making changes and demanding that I connect to them with their new SIP address.  When I try to connect, it is said immed

  • Scrolling text does not display in the published file - 9 Captivate

    I'm working on a Captivate 9 project with several slides containing text scrolling interactions. Viewers of content and features on preview, however, appears in the published project (i.e. empty space where the marquee should be). Edition for HTML5.U