query with a special character clob field

Using Oracle 10 g:
I have a clob field that stores a bunch of text. Some fields have a value of: \N

When I try to do a query for:

SELECT * FROM DOC_LANGUAGE, WHERE THE LANGUAGE IS NOT NULL OR LANGUAGE! = « \N » ;

I get:
ORA-00932: inconsistent data types: expected - got CLOB
00932 00000 - ' incompatible data types: wait %s %s got. "

What is the best way to isolate these?

You can't do

LANGUAGE != '\N'

on a clob

try something like

SELECT * FROM DOC_LANGUAGE
WHERE LANGUAGE IS NOT NULL
OR dbms_lob.instr(LANGUAGE,'\N') = 0

Edit: of course, this construction is a FORMULATION more NOT LIKE '% \N%'. You can also try

to_char(dbms_lob.substr(LANGUAGE,1,2)) != '\N'

Published by: Pleiadian on March 21, 2011 15:38

Tags: Database

Similar Questions

  • Invisible ESSId with a special character - Satellite M40

    Hello

    I have a Satellite M40 with a card atheros AR5005g wireless.
    I have a wireless network with WPA2-PSK encryption. The ssid looks like this: g4s8j6b-extraordinary character-o7v35s7gt3q1c6b8
    With the latest version of the driver, it is impossible to see one ssid to connect to this network.
    I tried a USB of Atlantis wireless adapter and it can find the wirelessnetwork (I can not connect because the USB adapter is not supported WPA2-PSK)

    For me it is the problem of driving. How can I solve this problem? This 'special character' is not recognizing drivers isn't? is it possible to convert the ssid in the HEX code and insert the ssid in hexadecimal and hexadecimal key in a data to force the connection? (manual connection like Linux)

    your faithfully

    Oh this forum does not support the character... it looks like this: http://en.wikipedia.org/wiki/%C3%9F
    (Unicode U + 00DF)

    That the SSID is very long. Have you tried to use a shorter SSID?

  • Display records with a special character to the end user

    Hello

    What follows with the exception of special characters such as the comma, colon (:), space, preview, brackets [], parenthesis(), key entry, quote (') single, the double quotes (""), full stop (.), slash (/) forward, backward slash (\), + (plus), % (percentage),?) (questionmark), # (pound sign)

    -> if anyone is available in the record, I want it back and also show the special character. for example, retrieval must be id 21, 22: 16
    -> also I want a list of special characters like message in the sql
    for example, 16 ID, (¶, §) must be displayed in the output



    WITH abc AS
    (

    11 SELECT ID, ' he is suffereing
    jaundice"summary FROM DUAL
    UNION ALL
    Order 12, "we can go to the bus stop. OF THE DOUBLE
    UNION ALL
    SELECT 22, 'a mΦnsoon is provided affect≈the region during the next φ a few days' OF the DOUBLE
    UNION ALL
    SELECT 16, "Film¶city looks like go§d." DOUBLE
    UNION ALL
    SELECT 21, "The International @l ¥ mpic Committee moved the bike could Calm fears scratching the Olympic Games." OF THE DOUBLE
    UNION ALL
    SELECT 17, ' John F Kenny was a "young president" America "OF the DOUBLE
    UNION ALL
    18 SELECT, ' the Department of elections, identified (10) polling stations for voters to go to
    thei\r January 26 vote for the by-election of Punggol East Single Member constituency ' FROM DUAL
    UNION ALL
    SELECT 19, "the pilot of the helicopter that + crashed in Central London were thousands of"
    hours of experience of aviation including flight % for films such as die another day and save #Private #Ryan?' THE DOUBLE)
    Select id, summary, 'show special char' in splch
    ABC
    ;

    OUTPUT
    SUMMARY of the splch ID

    Film¶City 16 looks like go§d. ¶§
    21 the International @l ¥ mpic Committee moved the bike could Calm fears scratching the Olympic Games. @¥ O
    22 a mΦnsoon is planned for the region during the next φ affect≈the days Φ≈φ

    Hello

    Here's one way:

    WITH     got_special_characters     AS
    (
         SELECT  id
         ,     summary
         ,     REGEXP_REPLACE ( summary
                          , '[][[:alnum:],: ()''"./\+%?#'  ||
                                CHR (10)                ||
                         '-]'
                          )     AS special_characters
         FROM    abc
    )
    SELECT       id
    ,       summary
    ,       special_characters
    FROM       got_special_characters
    WHERE       special_characters     IS NOT NULL
    ORDER BY  id
    ;
    {code}
    Inside square brackets, the characers ']' and '-' have special meanings, unless you use them in places where the special meaning can't apply.  That means the ']' must be the first character inside the square brackets (Oracle assumes you're not ending the set right after you begin it) and the '-' must be the very last character inside the square brackets.
    Depending on what newline is on your system, you may want to use CHR (13) in addition to, or instead of, CHR (10).
    
    it would be more efficient to use the TRANSLATE fucntion, rather than REGEXP_REPLACE, to produce special_characters.  You'd have to list all 80 or so of the non-special characters, but you'd only have to do it once.
    {code}
    WITH     got_special_characters     AS
    (
         SELECT  id
         ,     summary
         ,     TRANSLATE ( summary
                     , '=0123456789ABCEDFGHIJKLMNOPQRSTUVWXYZabcedfghijklmnopqrstuvwxyz,: -[]()''"./\+%?#'
                           || CHR (10)
                     , '='
                     )     AS special_characters
         FROM    abc
    )
    SELECT       id
    ,       summary
    ,       special_characters
    FROM       got_special_characters
    WHERE       special_characters     IS NOT NULL
    ORDER BY  id
    ;
    

    Published by: Frank Kulash on 16 January 2013 12:35
    TRANSLATE the code added.

  • Invoice number with a special character

    Hi team,

    We have a requirement to compare the invoice number of the child database data.

    We save the master invoice number in the variable to access the data of the child.

    Our number is the invoice number is to have either a special character '-' because of which equal to the function does not work.

    Pourrait a guide on this issue.

    Here is the code
    ? xdoxslt:set_variable($_XDOCTX,_'v1',_ssInvoiceNumber)? >

    <? If: (xdoxslt:get_variable($_XDOCTX,'v1') = ssInvoiceNumber)? > View the data <? end if? >

    Even if the data are not same the run loop if and its unwanted display of data.

    The invoice number as (1-100678, 1-100677, 1-100679).

    See you soon,.
    Andy

    want to remove numbers HYPHEN before compare it?

    use

    
    

    to remove the HYPHEN

    
    
  • Cannot delete/rename/move a file of Windows with a special character

    Not so long ago, I used a portable hard drive to pass data between my PC and my MacBook (Running OS X 10.11.1).)

    Unfortunately, I was stupid to create an alias of my portable hard drive on the desktop of my Mac by chance, just after my hard drive mounting.

    The issue is that I can't even delete/rename/move it. Restart the system does not work, and commands (sudo rm/mv...) since the Terminal does not work either.

    When I tried to delete/move the alias file, I got what is like that, "the operation cannot be completed because an unexpected error occurred (error code - 50)."

    And when you try to rename it with the name of the file 'a', I got what is, "try using a name with fewer characters, or no punctuation.". "

    I think that this probably has to do with the name of the hard disk, which has a weird character "NULL", a character. This character is possibly legal in Windows, but illegal in OS X? Or maybe there are some differences between Windows and Mac, interpreting a file name?

    Any help, thanks!

    I would like to try the list to see what is happening one:

    # display the characters hidden in the form of numbers

    LS - lb

    # If you have a lot of files in the directory

    LS - lb | more

    LS - lB

    I assumed that you released the flash player.

    usually, you can type a few characters and then press tap to get the rest of the printed characters.

  • Function group with CLOB fields in the Select statement

    I try to query our following sql database. Remove the Clob (a.description) field I managed. But I need the Clob (a.description) field. Here is my sql class
    select  a.id_number, a.id_owner,  MAX (n.next_action_required)
                KEEP (DENSE_RANK LAST ORDER BY n.modified_date),
             MAX (n.modified_date) KEEP (DENSE_RANK LAST ORDER BY n.modified_date) 
    from table1 a, table2 n
    where a.id_number = n.id_number
    group by a.id_number, a.id_owner
    I tried the following which works sometimes, but not always because the Clob field length (a.description) varies; anywhere from 10 characters up to 12 000 characters. I get a few drafts with the following and some where the text is cut off. I can not write the correct dbms_lob.substr function.
    select  a.id_number, a.id_owner,  MAX (n.next_action_required)
                KEEP (DENSE_RANK LAST ORDER BY n.modified_date),
             MAX (n.modified_date) KEEP (DENSE_RANK LAST ORDER BY n.modified_date) , DBMS_LOB.SUBSTR (a.description, 8001, 10000)
    from table1 a, table2 n
    where a.id_number = n.id_number
    group by a.id_number, a.id_owner, DBMS_LOB.SUBSTR (a.description, 8001, 10000)
    Help, please. Thank you

    Maybe

    select id_number,
           id_owner,
           description,
           next_action_required,
           modified_date
      from (select a.id_number,
                   a.id_owner,
                   a.description,
                   n.next_action_required,
                   n.modified_date
                   row_number() over (partition by a.id_number,a.id_owner
                                          order by n.modified_date desc,n.next_action_required desc) rn
              from table1 a,
                   table2 n
             where a.id_number = n.id_number
           )
     where rn = 1
    

    Concerning

    Etbin

  • get the table script using dbms_metadata.get_ddl but with clob field

    Thus, Oracle 11g R2...
    I use dbms_metadata.get_ddl for table scripts and it works fine...

    now, I have a table with clob field, and it does not work... I got an error "missing a closing parenthesis (ora-0907) '...
    I could paste a script I had, but I don't think that it makes no sense...

    does anyone have an experience on the use of this package on clob tables?


    TNX

    See this code.

    DECLARE
      myddl clob;
      PROCEDURE print_clob(p_clob in clob) as
        l_offset number default 1;
      BEGIN
        loop
          exit when l_offset > dbms_lob.getlength(p_clob);
          dbms_output.put_line(dbms_lob.substr(p_clob, 255, l_offset));
          l_offset := l_offset + 255;
        end loop;
      END print_clob;
      FUNCTION get_metadata return clob is
        h   number;
        th  number;
        doc clob;
      BEGIN
        h := dbms_metadata.open('TABLE');
        dbms_metadata.set_filter(h, 'SCHEMA', 'HR');
        dbms_metadata.set_filter(h, 'NAME', 'EMPLOYEES');
        th := dbms_metadata.add_transform(h, 'MODIFY');
        th := dbms_metadata.add_transform(h, 'DDL');
        --dbms_metadata.set_transform_param(th,'SEGMENT_ATTRIBUTES',false);
        doc := dbms_metadata.fetch_clob(h);
        dbms_metadata.CLOSE(h);
        return doc;
      END get_metadata;
    BEGIN
      myddl := get_metadata;
      print_clob(myddl);
    END;
    

    This procedure of print_ddl I took of the documentation.
    Use of the long VALUE. See, in the first example out put is truncated.

    SQL> SELECT dbms_metadata.get_ddl('TABLE','EMP','SCOTT') FROM dual;
    
    DBMS_METADATA.GET_DDL('TABLE','EMP','SCOTT')
    --------------------------------------------------------------------------------
    
      CREATE TABLE "SCOTT"."EMP"
       (    "EMPNO" NUMBER(4,0),
            "ENAME" VARCHAR2(10),
    
    SQL> set long 10000
    SQL> /
    
    DBMS_METADATA.GET_DDL('TABLE','EMP','SCOTT')
    --------------------------------------------------------------------------------
    
      CREATE TABLE "SCOTT"."EMP"
       (    "EMPNO" NUMBER(4,0),
            "ENAME" VARCHAR2(10),
            "JOB" VARCHAR2(9),
            "MGR" NUMBER(4,0),
            "HIREDATE" DATE,
            "SAL" NUMBER(7,2),
            "COMM" NUMBER(7,2),
            "DEPTNO" NUMBER(2,0),
             CONSTRAINT "PK_EMP" PRIMARY KEY ("EMPNO")
    
    DBMS_METADATA.GET_DDL('TABLE','EMP','SCOTT')
    --------------------------------------------------------------------------------
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"  ENABLE,
             CONSTRAINT "FK_DEPTNO" FOREIGN KEY ("DEPTNO")
              REFERENCES "SCOTT"."DEPT" ("DEPTNO") ENABLE
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"
    
    SQL> SET LINESIZE 132
    SQL> SET pagesize 0
    SQL> SET LONG 1000000
    SQL> /
    
      CREATE TABLE "SCOTT"."EMP"
       (    "EMPNO" NUMBER(4,0),
            "ENAME" VARCHAR2(10),
            "JOB" VARCHAR2(9),
            "MGR" NUMBER(4,0),
            "HIREDATE" DATE,
            "SAL" NUMBER(7,2),
            "COMM" NUMBER(7,2),
            "DEPTNO" NUMBER(2,0),
             CONSTRAINT "PK_EMP" PRIMARY KEY ("EMPNO")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"  ENABLE,
             CONSTRAINT "FK_DEPTNO" FOREIGN KEY ("DEPTNO")
              REFERENCES "SCOTT"."DEPT" ("DEPTNO") ENABLE
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"
    
    SQL>
    
  • Returns the field data of database with data of type CLOB

    Hello..

    I have HT table with the CLOB field type... 12000 char length... the data is present on the ground... but when I select on this field only returns data for this field for any given row...

    pls know me wuts may b the problem...

    cheeerrss...

    Are you running SQL select * more? In order to check if the [VALUE LONG | http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12040.htm#sthref2800] parameter.

    HTH!

  • MouseOver CLOB fields in the spreadsheet poster a long text string

    I use SQL Developer 4.1.1.19.59. Running a query on a table with a CLOB field (for example, the view System V$ SQL) displays the CLOB column with «...» "at the end of the field. When I mouse over this column, I get a long string of text that extends on to my second monitor. A current colleague 4.0.0.12 version gets a beautiful bubble pop up that shows the wrapped around CLOB field is actually readable.

    Is there a setting that controls this? Or is it a (bug) difference between the two versions of the SQL Developer? If it is a parameter, I was not able to find it through preferences.

    Received a response from Oracle.

    Try to set the following preferences:
    -Open tools/preferences/environment
    -set the 'Look and Feel' = Oracle
    -define "Line terminator" = Platform Default

    He fixed it. I had the 'Look and Feel', set to "Windows". Change to 'Oracle' now annoys me long SQL statements in a little easier to read the pop-up box.

    I will still argue that it should display the text in this way, the 'Look and Feel' no matter what I choose. It will be fixed or changed in a later version.

    Thank you

    Brian

  • Select the query with the level line list where the clause

    Hi all

    I am creating a tabular presentation based on a SQL query that has a list of selection based on a query with a where clause clause that refers to a column in the original SQL query.

    The situation is, I have a table that stores the client_id, source_id, and build_id, lets call it client_source. I have a second table, build_source, containing source_id and build_id, one to many relations between the two (1 source_id could have build_id 1-7).

    Using a tabular presentation, I want to select the correspondent build_id to use in client_source, but the selection list should contain only the build_id for this particular source_id of lines.

    Here is an example of the SQL source of tabular presentation;

    Select
    s.ROWID,
    s.CLIENT_ID,
    s.SOURCE_ID,
    APEX_ITEM. SELECT_LIST_FROM_QUERY (1, s.BUILD_ID,)
    "Select display b.build_id, b.build_id return.
    b build_source where b.source_id = s.SOURCE_ID ') lst
    of s client_source

    what I want to achieve, it's as source_id "BOLD" match fields. When the query is built this way, I get an error of "invalid identifier" Oracle on s.SOURCE_ID during execution.

    Is there some special tags to be used to refer to the external column? I must be missing something because this looks like a pretty mundane problem.

    I am running on 4.1.0.00.32, on an Oracle 10 g release 10.2.0.4.0 Server Express request.


    I look forward to useful responses!


    See you soon,.
    Jason

    Published by: 1005131 on May 9, 2013 19:02

    Your selection by query list receives a static SQL. That SQL can't "see" the value of your s.source_id.
    But it would work like this:
    where b.source_id = ' | s.SOURCE_ID)

    You would be the value for the SQL concatenation. It is not ideal, but it will work.

    Jorge

  • Need for a check on a CLOB field constraint

    Hi all

    I have a problem similar to that of the thread here: CHECK the constraint on the CLOB column

    In summary, I have a table with a genetic sequence (CLOB because it often is > 4000 characters) field. I wish I had a constraint to refuse any character except (ACTG). I realize that a check constraint is not possible, but I tried a similar to trigger in the link.

    Unfortunately, it does nothing. The trigger is created and compiles, but does to catch any invalid character on insert or update.

    Code is:
    create or replace trigger gene_sequence_seq_biu_tr
    before insert or update on gene_sequence referencing old as old new as new
    for each row
    declare
       invalid_character EXCEPTION;
       PRAGMA EXCEPTION_INIT (invalid_character, -00001);
    begin
    -- REACHES THIS POINT
      for i in 1..DBMS_LOB.GETLENGTH(:new.seq) loop
    --  DOES NOT REACH THIS POINT
         if substr(:new.seq, i, 1) not in('A','C','T','G') then
             RAISE invalid_character;
             exit;
         end if;
      end loop;
    --  REACHES THIS POINT
    EXCEPTION
       WHEN invalid_character THEN
       RAiSE_APPLICATION_ERROR(num=> -20107, msg=> 'New DNA SEQUENCE contains Invalid character');
    end;
    /
    Any ideas? I'm referencing the sequence field correctly?

    Published by: darstar007 on 16 Sep, 2010 15:32

    Hello

    darstar007 wrote:
    This works very well also. Can I ask, that the function translate made here?

    Thank you

    TRANSLATE removes all the 'A,' c, ' t and ' G
    See the manual of the SQL language for more information.
    http://download.Oracle.com/docs/CD/B28359_01/server.111/b28286/functions204.htm#sthref2476

  • Change order number/special character artists

    I would like to know if there is a way to change the order of all the artists that begin with a number or a special character order. Currently, they are all sitting at the bottom of the list of the artist on the ipod (and iTunes) but I would like to have all displays at the top of this list.

    This is the sort order...  I think you would need to change the names of the artists so that they start with something that gets sorted at the top of the list in alphanumeric order.  For example, replace 10,000 Maniacs a_10, 000 Maniacs.

  • special character

    Hello

    in the groovy code,.

    I want to write

    FTRInstructionResult where (name = 'a' name')

    But ' nme contains an apostrophe. Foglight doesn't. How to tell foglight is a special character? And not the end of the expression.

    Thank you.

    The ITI is not Foglight who dislikes your characters

    It's groovy or java string syntax. If you wish to escape the Apostrophe with a backslash as follows

    ' a\ 'name '.

    Stefan

  • Search page based on query with Table on Layershift ADF Panel does not work correctly

    Hello

    I'm on 11.1.2.4 jdev and deployed my application on glassfish 3.1.2. I've hosted this application on Layershift externally.

    I created a search page based on query ADF with table Panel. All fields of research are working fine on weblogic Server integrated and my deployment local glassfish.

    However, on Layershift, when I enter some criteria of research in certain fields, it does not record.

    UPDATE, it seems that the problem is with the fields which are of the "String" ie. Name. Fields of data type Integer and Date seems fine.

    any ideas please?

    Thank you

    kdario, you're right, ViewCriteria does not use the correct syntax for mysql for the concatenation.

    The generated sql statement looks like this.

    SELECT * FROM (select student_id, student_name, from  student) QRSLT WHERE ( ( (UPPER(student_name) LIKE UPPER('%' || 'Per' || '%') ) ) )
    

    as DB MySql does not support | (double pipe sign), its sql causing failure.

    in order to support |, mysql requires to change the sql mode setting in the file my.cnf (on linux) in the

    # Set the SQL mode to strict
    sql-mode="PIPES_AS_CONCAT,STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
    

    After setting this parameter, its working fine now.

  • More than 1 SQL query with checkbox and error invalid number report

    Hi all

    I have two SQL query reports that each has an apex_item.checkbox and two processes for each report.  A report/process works very well.  It gives me an error of invalid number.

    In addition, another query SQL (editable report) gives me the following error when using the Multi line process, delete.

    ORA-06502: PL/SQL: digital or value error: character number conversion
    error ORA-06502: PL/SQL: digital or value error: character number conversion
    error
    Ok

    When I got a report from SQL query (with box and a process) and the query SQL (editable report) everything worked.  It stopped working when I added another SQL query report (with box and a process).

    A SQL query has the following in my query: apex_item.checkbox(3,email_id,'UNCHECKED') ""

    The other SQL query has the following: apex_item.checkbox(2,b.file_id,'UNCHECKED') ""

    Any help will be greatly appreciated,

    Sylvia

    Hi Reema,

    I've recreated the region and now it works!

    Thank you for this, looking at

    Sylvia

Maybe you are looking for

  • Recovery disk is deletes the data at the 2nd disk on Satellite A300?

    HelloI use a laptop Toshiba A300, which has 2 hard drives (250GB). The laptop has Windows Vista Home Edition 32-bit installed, but I want to change for Windows Vista 64-bit, which comes with the recovery disk, in order to use all 4 GB of RAM. I have

  • Sigh of account in trouble

    I tried to sigh in my Xbox 1 account, my account was let me sigh all day, but at a random time it suddenly stop. When I was signing I clicked on my account and loaded to the password screen but I have exhausted back me the sigh in screen counts and I

  • When you type an e-mail address?

    Why tap an email address I no longer see a red line under its or their e-mail address. What does that mean? or why is it happening.

  • Fondue cover guaranteed touchpad not working not

    Hi guys,. I left my pc probook 430 g2 PC table lamp was ~ 15 cm from the lamp. I kept my other PC in the same way. For some reason melted a little pc cover more and the screen showed a few more bright lines. There is also another left touchpad button

  • I forgot to manage the password for vista how to reset

    I changed my password for my administrator account in vista and now I am unable to connect to my computer