Finding special characters in a columns using SQL

Hi,
I have a column (Object_Name) which accepts character values. I want to find out such kind of records which has special charaters in my columns Object_Name. Please let me know, how do I write SQL statement for the same.
Thanks for your time in advance.

To find, for example, a comma in the OBJECT_NAME column try:
SELECT OBJECT_NAME
  FROM MYTABLE
WHERE INSTR(OBJECT_NAME,',')>0;To find multiple special characters, for example @ # + - _ , . : ; at same time try:
SELECT OBJECT_NAME
  FROM MYTABLE
WHERE INSTR(TRANSLATE(OBJECT_NAME,'@#+-_,.:;','@@@@@@@@@'),'@')>0;add a @ to the string '@@@@@@@@@' each time you add a character to the string '@#+-_,.:;'
max

Similar Messages

  • Finding special characters in the column

    Hi,
    Need a help to find out the special characters in the column. since the data is loaded from external files like excel etc.., there
    are some special characters are got inserted in the column.
    how do i find out the rows in the column which has special characters, Please help ASAP...
    Thanks

    Hi,
    What do you mean by "special characters"?
    SQL> With T As(Select 'A?BC' txt from dual union all
      2            Select 'AB%C' txt from dual union all
      3            Select 'ACAA' txt from dual)
      4  Select txt from t where Regexp_Like(txt,'[[:punct:]]');
    TXT
    A?BC
    AB%C
    [:punct:]      Punctuation symbols
                    % . , " ' ? ! : # $ & ( ) * ;
                    + - / < > = @ [ ] \ ^ _ { } | ~
    {code}
    Regards,
    Christian Balz                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Dynamic SQL Query to Find Special Characters in Table columns

    Hi,
    I am new to OTN FORUMS.
    I am trying to find the columnsi of a table which have special characters in them.
    I am planning on using this query
    select ' select INSTR('||column_name||', chr(0))
    from '||table_name||'where INSTR('||column_name||', chr(0)) >0' from user_tab_columns
    where table_name='Account'
    and spool the output to run as a script.
    Is this the right way or do u suggest any modifications to the query?
    Thanks in advance.

    Hi,
    I think your basic approach is right. Since you can't hard-code the table- or column names into the query, you'll need dynamic SQL.
    Instead SQL-from-SQL (that is, writing a pure SQL query, whose output is SQL code), you could do the whole job in PL/SQL, but I don't see any huge advantage either way.
    When you say "Special character<b>s</b>", do you really mean "one given special character" (in this case, CHR(0))?
    Will you ever want to search for multiple special characters at once?
    What if table foo has a column bar, and in 1000 rows of foo, bar contains CHR (0). Do you want 1000 rows of output, each showing the exact position of the first CHR(0)? If the purpose is to look at theese rows later, shouldn't you include the primary key in the output? What if CHR(0) occurs 2 or more times in the same string?
    If you'd rather have one row of output, that simply says that the column foo.bar sometimes contains a CHR(0), then you could do something like this:
    SELECT     'foo',     'bar'
    FROM     dual
    WHERE     EXISTS (
                SELECT  NULL
                FROM       foo
                WHERE       INSTR ( bar
                            , CHR (0)
                        ) > 0
                );

  • Finding special characters in a string

    Hi all, I'm using Oracle 10g.
    I have a column name with special characters. how can i replace the special characters in the column with space and no space depending 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 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 output as follows
    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 advise.
    Thanks
    Bob

    A simple solution without regexp usage:
    -- 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 dot, comma, hyphen, semicolon and underscore

  • How can I find special characters in a string

    Hi,
    I have a small task where I have to find special characters in a given string, Can anyone suggest.......................

    What is your definition of a "special character", could you be a bit more specific?
    Do you simply want to find the position of a specific character in the string?
    Can it occur more than once and you want to find all occurences?
    What should happen if the special character does not exist?
    For programming purposes, all 256 possible 8 bit characters (x00-xFF) can be treated the same. Non-printing characters can be entered in \-codes or hex display if needed.
    LabVIEW Champion . Do more with less code and in less time .

  • How to find Special Characters in a single query

    Dear Experts,
    Your usual help is required to solve the query.My query is "How to find all special characters like (%$*&@,;'/+- etc. in a single query?"
    Thanks.
    e.g.
    A_MIR
    A%SIM
    A*SIM
    A)SIM

    Hi,
    947459 wrote:
    Dear Experts,
    Your usual help is required to solve the query.My query is "How to find all special characters like (%$*&@,;'/+- etc. in a single query?"
    Thanks.
    e.g.
    A_MIR
    A%SIM
    A*SIM
    A)SIMIt's not clear what you want.
    What are "special characters"? Can you list all of them?
    Do you want to find rows where string_column contains any of the special characters? If so
    SELECT     string_column
    FROM     table_x
    WHERE     string_column     != NVL ( TRANSLATE ( string_column
                                        , 'A(%$*&@,;'/+-'
                                , 'A'
                          , 'A'
    ;I assume 'A' is not a special character.
    You could also use regular expressions, but it will be more efficient if you don't use them unless you really need to.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements), and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}
    You'll get better replies sooner if you always include this information whenever you have a question.

  • How to find Special Characters in a table ?

    Hi,
    I have a problem, during a data upload by the client, some special characters were uploaded in the database.
    Sample data : " AC Power Cord Denmark "
    I want to find all records containing such special characters and update them.
    TOAD is able to display these characters but when i copy them onto the query... it doesnt work.
    Can we know which encoding is that ? or do something to take care of this ?
    Thanks in Advance.
    Message was edited by:
    Champ

    insert into t1 values ('joe$%"likes#$%#to*()ride%^$#his bike');
    1 rows inserted
    select * from t1;
    C1                                                                                                  
    joe$%"likes#$%#to*()ride%^$#his bike                                                                
    1 rows selected
    select translate(c1,'!@#$%^&*()"','          ') from t1;
    TRANSLATE(C1,'!@#$%^&*()"','')                                                                      
    joe  likes    to   ride    his bike                                                                 
    1 rows selected
    update t1 set c1 = translate(c1,'!@#$%^&*()"','          ');
    1 rows updated
    select * from t1;
    C1                                                                                                  
    joe  likes    to   ride    his bike                                                                 
    1 rows selectedI didn't notice your special special characters, but it still works:
    insert into t1 values ('joe likes his'||chr(22));
    select * from t1;
    select translate(c1,chr(22),' ') from t1;
    update t1 set c1 = translate(c1,chr(22),' ');
    select * from t1;
    Message was edited by:
    JoeC

  • Special characters in XML built using the DOM object

    I am using the DOM object to build xml but I am having problems with special characters. I have a Element object that I create attributes in. Most special characters like the &, ", or ' are translated for me (amp; quot;, acute; put a & in front of those, if I do it here the browser will translate them into the logical character) but I am having a problem with the � character. The DOM object does not translate this. If I do it my self to(eacute; same here add a & in front) before adding the string to the attribute then the DOM object translates it to (amp;eacute; add a & in front of the amp; not in front of the eacute;). As you can see the DOM object translates the & instead of recognizing that it is a HTML character. Can anyone give me a hand?

    I am building this XML in a servlet so ,right, DOM does process XML (even though a valid HTML file can be loaded into a DOM object) but if you build XML using DOM then write the XML out using PrintWriter and Transformer objects this will cause the XML to print out in your browser. If you view source on this XML you will see that the DOM object has translated all special characters to there &xxxx; equivalent. For a example: when the string (I know "cool" java) gets loaded into a attribute using the DOM object then wrote back out it looks like (I know &xxx;cool&xxx; java) if you view the source in your browser. This is what it should do, but the DOM object is not change the � to the "&xxxxx;". This servlet is acting as a gateway between a Java API and a windows asp. The asp will call the servlet expecting to get XML back and load it directly into a DOM object. When the windows DOM object gets the xml that I am returning in this servlet is throws a exception "invalid character" because the � was not translated to &xxxx; like the other characters were. According to the book HTML 4 in 24 hours (and other references) the eacute; or #233; are how you say "�" in HTML or XML. How do you say it?

  • Load special characters in oracle by using informatica

    Hi All,  I'm trying to load data from flat file to oracle databse table using Informatica power center 9.1.0 and I have some special characters in source file. Data are loaded sucessfully without any errors but these special characters are loaded different way like 1) Planner – loaded as Planner ��������2) Háiréch  loaded as Hair��������ch  While same flatfile loaded into another flatfile,data loaded correctly including special characters.So,I am unable to understand problem with database or informatica.   SourceFlat File - comma ',' delimtedCode page is defined as UTF-8 encoding of Unicode Relational connectionI have tried by changing the code page while creating relational connection in Informatica to UTF-8, ISO 8859-1 Western European,  MS Windows Latin 1 etc.,didn't work. InformaticaIntegration Service and Repo code page is defined as UTF8Data movement code page of Integration server was set to UNICODE   TargetOracle databaseNLS_NCHAR_CHARACTERSET: AL16UTF16NLS_CHARACTERSET: AL32UTF8   ThanksSai

    Hi All,  I'm trying to load data from flat file to oracle databse table using Informatica power center 9.1.0 and I have some special characters in source file. Data are loaded sucessfully without any errors but these special characters are loaded different way like 1) Planner – loaded as Planner ��������2) Háiréch  loaded as Hair��������ch  While same flatfile loaded into another flatfile,data loaded correctly including special characters.So,I am unable to understand problem with database or informatica.   SourceFlat File - comma ',' delimtedCode page is defined as UTF-8 encoding of Unicode Relational connectionI have tried by changing the code page while creating relational connection in Informatica to UTF-8, ISO 8859-1 Western European,  MS Windows Latin 1 etc.,didn't work. InformaticaIntegration Service and Repo code page is defined as UTF8Data movement code page of Integration server was set to UNICODE   TargetOracle databaseNLS_NCHAR_CHARACTERSET: AL16UTF16NLS_CHARACTERSET: AL32UTF8   ThanksSai

  • FrameMaker 8 Special characters in MIF file using hexcodes

    Hey,
    I'm creating a MIF-file from another system, and using hexcodes to create my special characters (\x8c for example).
    When importing it to FrameMaker 8 I'm only ending up with a space where this character is supposed to be.
    Using the same MIF-file in FrameMaker 7, it comes up with the character å(aring) as I'm expecting it to do.
    What do I do to make FrameMaker 8 read the hexcodes correctly?
    Regards,
    Monica Svanlind

    Monica,
    FM8 is now unicode aware and you should be using the unicode values
    instead of hex. If you use a codepage specific font, then using hex
    values may still display the correct character. FM8 will no longer
    display characters from Registry mapped codepages (e.g. Arial CE) for
    WGL TT and OTF Pro fonts properly - you need to use the unicode value.

  • Apply embedded fonts to special characters in spark textArea using tlf

    By setting fontfamily directly to textarea in mxml fonts get applied to special characters. But using tlf and setting fontfamily it does not apply.
    style.css ::
    @font-face
        src: URL("/Assets/Fonts/GandhariUnicode-Bold.otf");
        fontFamily: "GandhariUnicode-Bold";
        embedAsCFF: true;
    snippet of source code ::
    textArea.textFlow.interactionManager.selectRange(beginIndex, endIndex);
    var textLayoutFormat:TextLayoutFormat = getTextLayoutFormat();
    textLayoutFormat.fontLookup = FontLookup.EMBEDDED_CFF;
    textLayoutFormat.fontFamily ="GandhariUnicode-Bold";   
    textLayoutFormat.renderingMode = RenderingMode.CFF;

    Please try the code as follows.
    (1)
    [Embed(mimeType="application/x-font", exportSymbol="GandhariUnicode-Bold", embedAsCFF="true", fontWeight="bold", source="Assets/Fonts/GandhariUnicode-Bold.otf", fontName="gandhariUnicode-Bold")]
    var GandhariUnicode-Bold:Class;
    var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
    textLayoutFormat.fontLookup = FontLookup.EMBEDDED_CFF;
    textLayoutFormat.fontFamily ="gandhariUnicode-Bold";   
    textLayoutFormat.renderingMode = RenderingMode.CFF;
    textArea.textFlow.hostFormat = textLayoutFormat;
    textArea.textFlow.flowComposer.updateAllControllers();
    Or (2)
    [Embed(mimeType="application/x-font", exportSymbol="GandhariUnicode-Bold", embedAsCFF="true", fontWeight="bold", source="Assets/Fonts/GandhariUnicode-Bold.otf", fontName="gandhariUnicode-Bold")]
    var GandhariUnicode-Bold:Class;
    textArea.textFlow.fontLookup = FontLookup.EMBEDDED_CFF;
    textArea.textFlow.fontFamily ="gandhariUnicode-Bold";   
    textArea.textFlow.renderingMode = RenderingMode.CFF;
    textArea.textFlow.flowComposer.updateAllControllers();

  • How to insert  data into BLOB column  using sql

    Hi all,
    How to insert data into BLOB column directly using sql .
    create  table temp
      a blob,
      b clob);
    SQL> /
    Insert into temp  values ('32aasdasdsdasdasd4e32','adsfbsdkjf') ;
    ERROR at line 1:
    ORA-01465: invalid hex number
    Please help in this.Thanks,
    P Prakash

    see this
    How to store PDF file in BLOB column without using indirect datastore

  • How to load date column using sql loader

    Hi,
    I am trying to load a file using sql loader. my date value in the file is '2/24/2009 8:23:05 pm',
    In control file for this column i specified like this
    rec_date date ''mm/dd/yyyy hh:mi:ss pm"
    But i am getting following error
    not avalid month.
    Thanks
    sudheer

    Hi,
    Use this example as reference:
    CTL file:
    LOAD DATA
    INFILE 'test.txt'
    BADFILE 'test.bad'
    truncate INTO TABLE T3
    FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '|' TRAILING NULLCOLS
    dt_date DATE "mm/dd/yyyy hh:mi:ss pm")DAT file:
    2/24/2009 8:23:05 pm
    C:\ext_files>sqlldr hr/hr control=test.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Wed Jul 1 20:35:35 2009
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 1
    Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
    Connected as hr
    SQL> desc t3;
    Name    Type Nullable Default Comments
    DT_DATE DATE Y                        
    SQL> select to_char(dt_date, 'mm/dd/yyyy hh24:mi:ss') from t3;
    TO_CHAR(DT_DATE,'MM/DD/YYYYHH2
    02/24/2009 20:23:05
    SQL> Regards,
    Edited by: Walter Fernández on Jul 1, 2009 8:35 PM - Adding example...
    Edited by: Walter Fernández on Jul 1, 2009 8:38 PM
    Edited by: Walter Fernández on Jul 1, 2009 8:41 PM - Fixing some information...

  • Loading Images into LONG RAW column using SQL or PL/SQL

    Hi!
    I am trying to load images into a LONG RAW column. Can anybody tell me how to do this using SQL or PL/SQL. I do not want to use Forms to do this. And, I have a limitation using BLOBs.
    Thanks in Advance,
    Kotesh.

    You wrote that you cannot use a java class to insert a picture. We are working on a school project and HAVE to use java as a client and Oracle 7 as a server.
    Can you tell us how this is to be done?
    Thank you in advance,
    Bart van der Heijden

  • Find special characters in string (using mask)

    Hi all,
    I have the following requirement, perhaps someone has got a hint for me:
    I have got a string of 255 characters.
    I want to realize that this string only contains characters of a "normal" format, like
    a-z, A-Z and numbers.
    Any characters like , - # for example are not allowed and I would like to know, how to check my string.
    How can I achive that? With FIND or SEARCH?
    I am not really familiar with these ABAP KEY WORDS. Can I use masks for example like
    DATA:  no_good type c value '[#,+,*...)
    FIND no_good in STRING
    or something like that?
    Thanks and best regards
    Andreas

    Hi Try the below code:
    data: l_data(10) type c,      
          l_special(10) type c.
    l_data = 'AAA%%AA'.          " You can give your value here
    L_special = '!@#$%^&*()'.     " This need to be maintained wth the char which you don't want
    IF l_data ca l_special.
    WRITE: 'Special'.
    else.
    WRITE: 'Only ALPHA.'.
    ENDIF.
    P.S. - @ Rob, sorry I haven't check you have already given this as CO. Just a doubt, I think we have to use CA here, because we need to check this for each byte level.
    Edited by: Kuntal Nandi on Mar 30, 2009 2:55 PM

Maybe you are looking for

  • Business Event Appraisal in Training and event management

    Hi I am facing issue releated to Business Event Appraisal Functionality in ESS. I have maintained value as blank in field HAP00 REPLA switch. We have created I View of transacion PV7I in ESS. When i am selecting "APPRAISAL" button for attended event

  • Hp scanner all in one, hp g60 laptop

    Scanner was working. told scanner to send to ocs, but no ocs software in laptop. now scanner wont work, computer says scanner in use. how do i reset que in vista?

  • Comparing numbers in two arrays

    OK I am making a lottery program in Java. The idea is a user enters 4 numbers, they are saved to disk. A user then starts the draw which creates 4 random numbers and compares them with the numbers a user has chosen and sees if there are any matches.

  • Incompletion for third party orders

    Hi Everybody, I see that the incompletion procedure config is not useful to stop third party orders(TAS items) from creating a Purchase Req if an order is incomplete for pricing. I tried flagging the 'Pricing' check in the status group definition but

  • Sort in date order from Essbase cube source

    Hi everyone, I have an Essbase cube which I'm displaying the data from in OBIEE. Within the cube one of the dimensions is a date ( set as a time dimension ). It has several generations: Gen2 - Year, 2010 Gen3 - Year/Quarter, 2010/Q1 Gen4 - Year/Month