Oracle/PLSQL: ORA-00932 ErrorError: ORA-00932: inconsistent datatypes

I am getting this error in a PL/SQL package, using SQL using the NVL function.
Oracle/PLSQL: ORA-00932 ErrorError: ORA-00932: inconsistent datatypes. Cause: You tried to perform an operation between two different datatypes, but the datatypes are not compatible.
I do not get this error on a 10.2.0.4 instance of the database running in Windows.
Anyone come accross this type of issue in 11g Rel.2 or after migrating from 10g to 11g??
Thanks.

Dear user520935,
What are the contents of the package? Where do you exactly get that error?
http://ora-00932.ora-code.com/
Have you checked the metalink about it? There are lots of articles about it.
Ogan

Similar Messages

  • Oracle 10g Issue [ORA-00932: inconsistent datatypes: expected ]

    Hi,
    The following Code Snippet works fine in Oracle 9i DB but gives "ORA-00932: inconsistent datatypes: expected - got -; " error in 10g DB. We are facing lot of issues with this since we migrated application to 10g
    create or replace procedure cca is
    TYPE Cur_OPCols_Typ IS REF CURSOR;
    l_Cur_OPCols Cur_OPCols_Typ;
    str VARCHAR2(32767) :='select sysdate, 123 from dual';
    TYPE StringTyp IS TABLE OF VARCHAR2(7000) INDEX BY BINARY_INTEGER;
    capture StringTyp;
    BEGIN
         Open l_Cur_OPCols FOR str;
         FETCH l_Cur_OPCols BULK COLLECT INTO capture;
    dbms_output.put_line (capture.COUNT);
         Close l_Cur_OPCols;
    END cca;
    Please advise...
    Regards,
    Chinmay

    But...
    SQL> select * from v$version;
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    PL/SQL Release 9.2.0.1.0 - Production
    CORE    9.2.0.1.0       Production
    TNS for Solaris: Version 9.2.0.1.0 - Production
    NLSRTL Version 9.2.0.1.0 - Production
    <br>
    <br>
    "afiedt.buf" 13 lines, 370 characters
      1  declare
      2   TYPE Cur_OPCols_Typ IS REF CURSOR;
      3   l_Cur_OPCols Cur_OPCols_Typ;
      4   str VARCHAR2(32767) :='select sysdate, 123 from dual';
      5   TYPE StringTyp IS TABLE OF VARCHAR2(7000) INDEX BY BINARY_INTEGER;
      6   capture StringTyp;
      7  BEGIN
      8   Open l_Cur_OPCols FOR str;
      9   FETCH l_Cur_OPCols BULK COLLECT INTO capture;
    10   dbms_output.put_line (capture.COUNT);
    11   Close l_Cur_OPCols;
    12* END cca;
    SQL> /
    declare
    ERROR at line 1:
    ORA-00932: inconsistent datatypes: expected - got -
    ORA-06512: at line 9                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • [Oracle 8i] ORA-00932 Inconsistent Datatypes

    Hopefully this is a quick question to answer. In running a query I get the 'inconsistent datatypes' error, and I've narrowed the error down to one part of my query:
    SELECT     CASE     
              WHEN     sopn.plan_start_dt < SYSDATE     THEN SYSDATE
              ELSE     sopn.plan_start_dt
         END                                             
    FROM     SOPN sopn(replacing SYSDATE with an actual hard-coded date doesn't work either)
    The field sopn.plan_start_dt is definitely a date datatype. If I do a simple query for just that field with a date parameter in my where statement, it works just fine, for example:
    SELECT     sopn.plan_start_dt
    FROM     SOPN sopn
    WHERE     sopn.plan_start_dt<SYSDATEdoes not give me any errors.
    I'm guessing there's something wrong with my case statement, or maybe case statements with date parameters are something Oracle 8i doesn't get along with...
    If anyone can tell me why my case statement is causing an 'inconsistent datatype' error, I'd appreciate it. Thanks!

    Well, this tells me column sopn.plan_start_dt datatype is not DATE. CASE requires all branches to return same type expressions. Most likely sopn.plan_start_dt is VARCHAR2 and it is very bad coding to rely on implicit comversions. Use TO_DATE with proper format. For example:
    SELECT     CASE     
              WHEN     TO_DATE(sopn.plan_start_dt,'DD-MON-YY') < SYSDATE     THEN SYSDATE
              ELSE     TO_DATE(sopn.plan_start_dt,'DD-MON-YY')
         END                                             
    FROM     SOPN sopnSY.

  • ORA-00932: inconsistent datatypes: expected - got - In 11g, WORKS in 9i!

    Hello,
    Involved in migration of a 9i database to 11g, R2. One of our procedures works in 9i but in 11g gives us "ORA-00932: inconsistent datatypes: expected - got - "
    We tracked down the error in a statement where oracle does a fetch into a sys_refcursor. The fetch happens on a dynamically constructed select statement ( built by varchar concatenation).
    The select statement selects 3 fields, but the fetch into passes 2 variables to the fetch statement. This causes ORA-00932 in 11g R2, but works in 9i.
    Below is a modified procedure we built to demonstrate the problem. if you compile and test, you will see that the procedure runs in 9i but not 11g.
    create or replace procedure testORA00932 is
    v_now date;
    v_fsqltext varchar2(2000);
    v_curs sys_refcursor;
    begin
    v_fsqltext := 'select sysdate, sysdate+1 from dual'; -- select 2 fields
    open v_curs for v_fsqltext;
    loop
    fetch v_curs into v_now; -- fetch 1 field, this statement fails in 11g (ORA-00932), works in 9i
    dbms_output.put_line(v_now);
    exit when v_curs%notfound;
    end loop;
    close v_curs;
    end;
    Is there a compatibility flag we can turn on to resove this problem?
    Edited by: chrisl08 on Mar 29, 2012 11:11 PM

    After researching this a little more, this is a know bug to oracle: Bug 4381035
    According to Oracle, the only available workaround is to provide the same number of define variables as columns in the SELECT statement.

  • Help with error select case statement (ORA-00932: inconsistent datatypes)

    Hi,
    I'm struggling to get my sql query work on Oracle..
    I have a table MyTable with 5 columns ( Column1, Column2, Column3, Column4, Column5 ) all are of type NVARCHAR2.
    I need to check whether Column 3, Column 4 are empty or not in that order..and if they values then I wanna append it to Column2.
    For example
    If a row contains the following values,
    Column 2 = a.b
    Column 3 = 123
    Column 4 = xyz
    then column CA = a.b/123/xyz where column CA = temp column
    If either Column 3 or Column 4 is empty/null, then I don't need to append value for that column..
    For example
    Column 2 = a.b
    Column 3 = either NULL or ''
    Column 4 = xyz
    then CA = a.b/xyz where column CA = temp column
    similarly..
    Column 2 = a.b
    Column 3 = 123
    Column 4 = either NULL or ''
    then CA = a.b/123 where column CA = temp column
    Here is my query..
    select MyTable.Column1 as CA0,
    MyTable.Column2 as CA1,
    MyTable.Column3 as CA2,
    MyTable.Column4 as CA3,
    MyTable.Column5 as CA4,
    MyTable.Column2 + CASE WHEN MyTable.Column3 > '' THEN '/' + MyTable.Column3 ELSE '' END + CASE WHEN MyTable.Column4 > '' THEN '/' + MyTable.Column4 ELSE '' END CA
    from MyTable;
    This query works just fine against SQL Server db, but gainst Oracle I'm getting
    ORA-00932: inconsistent datatypes: expected NUMBER got CHAR
    00932. 00000 - "inconsistent datatypes: expected %s got %s"
    Could you please let me know what I'm doing wrong. I need to get this query working on both SQL Server and Oracle..
    Please let me know your suggestions and thoughts..
    Cheers,

    I need to check whether Column 3, Column 4 are empty or not in that order..and if they values then I wanna append it to Column2. In Oracle, you can do it this way - no need to do all kinds of difficult things:
    select col2||col3||col4
      from tbl

  • ORA-00932: inconsistent datatypes: expected - got CURSER

    Hi all,
    I created a Function and tried to execute it from SQL Plus, but am getting an error
    ORA-00932: inconsistent datatypes: expected - got CURSER
    I have been trying to debug for ages, but cant get to the root of what the problem might be. I would appreciate any help or idea's people could offer
    The only comfort I take from this is that Oracle have a typo in one of their error messages :)
    SQL PLUS CODE
    select * FROM TABLE(CAST(tsoraimpdb.QueryAuthorsFunc(116, 1, -1, 1, 0) as tsoraimpdb.ENTITYIDTABLE));FUNCTION CODE
    CREATE OR REPLACE FUNCTION &HKImpDB_Schema_Name..QueryAuthorsFunc
    aKGID NUMBER,
      aPageNumber NUMBER,              -- The page interested
      aPageSize NUMBER,                -- Number of records per page
      aOffset NUMBER,                  -- The offset = number of records already got
      aTotalRecord NUMBER          -- Total number of users in the database
    RETURN sys_refcursor
    as
    l_FuncCur sys_refcursor;
    l_TotalRecord NUMBER(10) := aTotalRecord;
    l_Offset NUMBER(10) := aOffset;
    l_PagingTable TEMP_T_TABLE:= TEMP_T_TABLE();
    -- paging set up
    l_MinRecordsOnAPge NUMBER(10); --last record on the previous page
    l_MaxRecordsOnAPge NUMBER(10); --last record on the current page
    begin
    DBMS_OUTPUT.PUT_LINE('start');
    select KnowdePos(rownum,p.ID) bulk collect into l_PagingTable
      FROM KnowledgeGene kg
      INNER JOIN HKResource r ON kg.KGOwner = r.ID
      INNER JOIN Person p ON r.PersonID = p.ID
    WHERE kg.kgid = akgid
    ORDER BY p.FirstName + ' ' + p.LastName;
    l_TotalRecord := l_PagingTable.count; -- get total records
    DBMS_OUTPUT.PUT_LINE(  l_TotalRecord);
    if aPageSize > 0 then
      if aPageNumber <= 0 then
              Raise_application_error(-20003,'Invalid Page Number');
      else
          l_MinRecordsOnAPge := (aPageNumber-1)*aPageSize;
          l_MaxRecordsOnAPge := aPageNumber*aPageSize;
      end if;
    else -- if @PageSize < 0 return all records
        l_Offset := 0;
        l_MinRecordsOnAPge := 0;
        l_MaxRecordsOnAPge := l_TotalRecord;
    END if;
    -- return results for the correct page
    open l_FuncCur for
    SELECT pos
      from HKResource r
      INNER JOIN Person p ON r.PersonID = p.ID
      inner join TABLE(CAST(l_PagingTable AS TEMP_T_TABLE)) on pos = p.id
      WHERE KnowdeID > l_MinRecordsOnAPge - l_Offset AND KnowdeID <= l_MaxRecordsOnAPge - l_Offset;
    return l_FuncCur;
    EXCEPTION when NO_DATA_FOUND then null;
    end;

    Ok, I think you could rewrite that as:
    CREATE OR REPLACE PROCEDURE &HKImpDB_Schema_Name..QueryInterestedUsers
      akgid int,
      aPageSize int,     -- Number of records per page
      aPageNumber int,      -- The page interested
      aOffset int,          -- The offset = number of records already got
      aExcludeCategoryUser int,-- default(1), -- whether to exclude category users
      aTotalRecord out NUMBER,  -- Total number of users in the database
      aCur out sys_refcursor
    AS
      -- paging set up
      l_MinRecordsOnAPge NUMBER(10); --last record on the previous page
      l_MaxRecordsOnAPge NUMBER(10); --last record on the current page
      l_TopLevelTopicGroup NUMBER(10);
    BEGIN
      if aPageSize <= 0  or aPageNumber <= 0 then
        Raise_application_error(-20003,'Invalid Page Size or Page Number');
      else
        l_MinRecordsOnAPge := (aPageNumber-1)*aPageSize;
        l_MaxRecordsOnAPge := aPageNumber*aPageSize;
      end if;
      l_TopLevelTopicGroup := --currently not defined anywhere??!!?!
      open aCur for
      WITH excluded_users as (--exclude default user
                              SELECT ID as PersonID
                              FROM   Person
                              where  Username = 'default'
                              UNION ALL
                              -- exclude authors
                              SELECT p.ID as PersonID
                              FROM   KnowledgeGene kg
                                     INNER JOIN HKResource r ON kg.KGOwner = r.ID
                                     INNER JOIN Person p ON r.PersonID = p.ID
                              WHERE  kg.kgid = akgid
                              UNION ALL
                              -- exclude categories users if applicable
                              SELECT ua.PersonID
                              FROM   HKGroup g
                                     INNER JOIN UserAccount ua ON g.AccountID = ua.AccountID
                              WHERE  g.ParentID = l_TopLevelTopicGroup
                              and    aExcludeCategoryUser = 1),
               PagingList as (SELECT rownum as ID,
                                     p.ID AS PersonID,
                                     P.Firstname||' '||P.LastName AS UserText,
                                     p.AvatarFilename
                              FROM   PanelKG
                                     INNER JOIN Panel ON PanelKG.PanelID = Panel.PanelID -- MyHyperknowledge panels that contain this KG
                                     INNER JOIN HKResource ON Panel.ResourceID = HKResource.ID -- the people who own the panels
                                     INNER JOIN Person P ON HKResource.PersonID = P.ID
                                     INNER JOIN PanelType pt ON pt.id = panel.panelid
                                     INNER JOIN ProfileVisibility pv ON pv.PersonID = P.ID -- check visibility
                                     INNER JOIN section sn ON sn.id = pv.SectionID
                              WHERE  PanelKG.KGID = akgid
                              AND    pt.name = 'MyHyperknowledge'
                              AND    sn.name = 'MyHyperknowledge'
                              AND    PanelKG.IsValid = 1
                              AND    pv.Visible = 1
                              AND    p.ID NOT IN (SELECT PersonID
                                                  FROM   excluded_users))
      -- return results for the correct page
      SELECT PersonId,
             UserText,
             AvatarFilename
      FROM   PagingList
      WHERE  ID > l_MinRecordsOnAPge - aOffset
      AND    ID <= l_MaxRecordsOnAPge - aOffset;
      ORDER BY usertext; -- moved the order here, as it didn't make sense to leave it in the subquery!
    END QueryInterestedUsers;
    / Please also take note of the fact that you don't appear to have defined a value for "l_TopLevelTopicGroup" anywhere!
    HTH

  • ORA-00932: inconsistent datatypes: expected NUMBER got REF db.emp_person_ty

    hello,
    from the forum general questions invited me to enter this thread.
    Re: ORA-00932: inconsistent datatypes: expected NUMBER got REF db.emp_person_ty
    Can you help me?

    here's all the transactions after downloading oracle:
    -start application start database;
    -started get started with oracle database application 11g express edition;
    -selected application express menu;
    -'re logged in with the credentials defined sys + password to the installation;
    created a workspace with:
    - Username: db;
    - Application username: dbase;
    - Added password;
    - Open the workspace I went on sql workshop;
    - Then I clicked on sql commands;
    - And I put the following commands:
    - CREATE TYPE emp_person_typ AS OBJECT (
    name VARCHAR2(30),
    manager REF emp_person_typ );
    -CREATE TABLE emp_person_obj_table OF emp_person_typ;
    -INSERT INTO emp_person_obj_table VALUES (
    emp_person_typ ('John Smith', NULL));
    -SELECT *
    FROM emp_person_obj_table;
    -at this point I will get the following errors:
    ORA-00932: inconsistent datatypes: expected NUMBER got REF db.emp_person_typ
    I only do these operations I did! I did not change anything but these problems presented to me.
    I also tried on two different machines but nothing changes. help me!!!

  • ORA-00932: inconsistent datatypes: expected UDT got NUMBER

    Hello Friends...
    i got this error while inserting record ..
    ORA-00932: inconsistent datatypes: expected UDT got NUMBER
    wht is that UDT ??
    Thanks..

    You cannot insert into your table STUDENT using the COURSE_TAB collection, since the column SUB is defined as a single object type.
    So either you have to modify your insert into two inserts as follows;
    INSERT INTO STUDENT VALUES(1,COURSE('1','ORACLE') )
    INSERT INTO STUDENT VALUES(1,COURSE('2','JAVA') )
    /or you have to modify your table structure so you can store a nested table, which will allow you to have a single insert
    something like this:
    drop table s
    drop type course_tab
    create or replace type course_type as  object (
    CNO CHAR(1),
    C_CNAME VARCHAR2(10)
    CREATE or replace  TYPE course_tab AS TABLE OF course_type;
    create table s ( c course_tab )
    nested table c store as course_list
    -- You can now have a single insert as follows:
      1* insert into s (c) values ( course_tab ( course_type('1','Java'), course_type('2','Oracle'))  )
    SQL> /
    1 row created.Be careful of using nested tables though. asktom reckons one should not use them.
    P;

  • ORA-00932: inconsistent datatypes: expected NUMBER got LONG

    Hi,
    I am facing problem while issuing the command:
    ORA-00932: inconsistent datatypes: expected NUMBER got LONG
    SELECT TEXT FROM USER_VIEWS WHERE TEXT LIKE '%ASCII%'
    Any help will be needful for me
    Thanks and Regards

    Please go through this
    If you try to search a LONG column, this is what will happen:
    SQL> select record_no, comments
    2 from long_demo
    3 where
    4 comments like '%LONG%';
    comments like '%LONG%'
    ERROR at line 4:
    ORA-00932: inconsistent data types
    That's right; you can't search the contents of a LONG column. Here's what happens if you try to apply a function to a LONG column.
    SQL> select record_no, substr(comments,1,5)
    2 from long_demo;
    select record_no, substr(comments,1,5)
    ERROR at line 1:
    ORA-00932: inconsistent data types
    Again, Oracle won't enable you to apply a function to a LONG column. In a sense, you can think of a LONG column as a large container into which you can store or retrieve data--;but not manipulate it.
    I have taken this content from
    http://docs.rinet.ru/Oru7na95/ch10.html
    which I refer to when I get stuck up. Hope this helps you.

  • ORA-00932: inconsistent datatypes: expected - got CHAR in 10.1.3 ADF BC.

    "ORA-00932: inconsistent datatypes: expected - got CHAR"
    i got SQL error during statement preparation. Statement: SELECT Emp.EMPNO, Emp.ENAME, Emp.JOB, Emp.MGR, Emp.HIREDATE, Emp.SAL, Emp.COMM, Emp.DEPTNO, Emp.ROWID FROM EMP Emp WHERE (EMPNO in (SELECT * FROM TABLE(CAST(:no AS TABLE_OF_NO))))
    Oct 29, 2008 1:53:09 PM oracle.adf.controller.faces.lifecycle.FacesPageLifecycle addMessage
    WARNING: ORA-00932: inconsistent datatypes: expected - got CHAR
    while running the emp.jspx page.
    Thanks
    Rama.
    Edited by: user634195 on Oct 31, 2008 5:10 AM
    Edited by: user634195 on Oct 31, 2008 5:13 AM

    "ORA-00932: inconsistent datatypes: expected - got CHAR"
    i got SQL error during statement preparation. Statement: SELECT Emp.EMPNO, Emp.ENAME, Emp.JOB, Emp.MGR, Emp.HIREDATE, Emp.SAL, Emp.COMM, Emp.DEPTNO, Emp.ROWID FROM EMP Emp WHERE (EMPNO in (SELECT * FROM TABLE(CAST(:no AS TABLE_OF_NO))))
    Oct 29, 2008 1:53:09 PM oracle.adf.controller.faces.lifecycle.FacesPageLifecycle addMessage
    WARNING: ORA-00932: inconsistent datatypes: expected - got CHAR
    while running the emp.jspx page.
    Thanks
    Rama.
    Edited by: user634195 on Oct 31, 2008 5:10 AM
    Edited by: user634195 on Oct 31, 2008 5:13 AM

  • Error: PL/SQL ORA-00932 inconsistent datatype when using LONG value

    Good morning:
    I am using a work PL/SQL script where I am using a LONG value in a cursor. When I execute it, I am receiving:
    PL/SQL ORA-00932 inconsistent datatype:  expected NUMBER got LONG
    set serveroutput ON SIZE 1000000
    set heading off               
    set feedback off               
    set trimspool off              
    set echo off
    set term off                  
    set pagesize 0        
    SPOOL &so_outfile;
    DECLARE
      v_data_file          varchar2(30);
    --   v_sch_code            varchar2(10);
    --   v_instance_name       varchar2(10);
        ws_path            payroll.pybutfl.pybutfl_utl_file_path%TYPE;
        v_data_line           VARCHAR2 (2000)                              := NULL;
        fhandle_o             UTL_FILE.file_type;
        v_line_count          NUMBER                                       := 0;
        v_selected_count      NUMBER                                       := 0;
        v_error_count         NUMBER                                       := 0;
        v_written_count       NUMBER                                       := 0;
        v_error_text          VARCHAR2 (50)       := ' AMACONF_ERR: Unable to write the line. ';
        v_errm                VARCHAR2 (255);
        v_sqlerrm             VARCHAR2 (255);
        v_payment_type        VARCHAR2(10);
    CURSOR C1 IS
    select RTRIM
            AMRCONF_PIDM_ERR            ||'|'||
            AMRCONF_IDEN_CODE_ERR       ||'|'||
            AMRCONF_ENTRY_DATE_ERR      ||'|'||
            AMRCONF_CONFID_IND_ERR      ||'|'||
           *AMRCONF_COMMENT_ERR        ||'|'||*
            AMRSUBJ_SUBJ_CODE_ERR       ||'|'||
            ERROR_CODE                  ||'|'||
            ERROR_CODE_TEXT                 ) data_line
            from WSUALUMNI.AMRCONF_ERR;
    BEGIN
    DBMS_OUTPUT.put_line ('Program Generating AMACOMT Mass Update Error File ');
    IF UTL_FILE.is_open (fhandle_o)
        THEN  
       UTL_FILE.fclose (fhandle_o);
    END IF;
    /* Name The File Here */
    v_data_file := ('Amaconf_error.txt');
    SELECT RTRIM (pybutfl_utl_file_path)
          INTO ws_path
          FROM payroll.pybutfl;
          fhandle_o := UTL_FILE.fopen (ws_path, v_data_file, 'w');
          DBMS_OUTPUT.put_line ('UTLFILE file for this run is: ' || ws_path||'/'||v_data_file);
          v_written_count := 0;  
    FOR c1_rec IN C1 LOOP
          BEGIN
            v_selected_count := v_selected_count + 1;
            v_data_line := rtrim(c1_rec.data_line);
            UTL_FILE.put_line (fhandle_o, v_data_line);
            v_written_count := v_written_count + 1;
        EXCEPTION
         WHEN OTHERS
          THEN
           DBMS_OUTPUT.put_line (v_error_text);
           v_error_count := v_error_count + 1;
        END;
    END LOOP;
         DBMS_OUTPUT.put_line ('Number of Records Selected: ' || v_selected_count);
         DBMS_OUTPUT.put_line ('Number of Records Written: ' || v_written_count);
          IF UTL_FILE.is_open (fhandle_o)
          THEN
             UTL_FILE.fclose (fhandle_o);
          END IF;
    END;
    SPOOL OFF;If I comment out the "AMRCONF_COMMENT_ERR ||'|'||" line, then the script works fine. The table was created as:
    Create Table WSUALUMNI.AMRCONF_ERR
        AMRCONF_PIDM_ERR             NUMBER (8)    NOT NULL,
        AMRCONF_IDEN_CODE_ERR        VARCHAR2(5)   NOT NULL,
        AMRCONF_ENTRY_DATE_ERR       DATE          NOT NULL,
        AMRCONF_CONFID_IND_ERR       VARCHAR2(1),
        AMRCONF_COMMENT_ERR          LONG,         
        AMRSUBJ_SUBJ_CODE_ERR        VARCHAR2(5)   NOT NULL,
        ERROR_CODE                   VARCHAR2(12)  NOT NULL,
        ERROR_CODE_TEXT              VARCHAR2(50)  NOT NULL
    ); I don't get what is the problem here in the script.

    Hi,
    Feew suggestions
    1) LONG is a deprecated type hence if possible start working on changing that column
    2) CLOB will your preferred datatype over LONG.
    3) you cannot use RTRIM on long.
    here is a very quick example
    drop table h
    create table h (x long,y varchar2(100))
    select rtrim(x) from h
    select rtrim(y) from hSolution:
    [http://www.oracle.com/technology/oramag/code/tips2003/052503.html]
    need a better solution change the datatype to clob and
    drop table h
    create table h (x clob,y varchar2(100))
    select  dbms_lob.substr( x, 4000, 1 ) from h
    select rtrim(y) from hCheers!!!
    Bhushan

  • Get ORA-00932 inconsistent datatype when passing parameter in tableadapter

    I have to build a Dataset to use as source for Microsoft rdlc-Report.
    In the Dataset I create a tableadapter using plain SQL.
    In my SELECT-Command I have to pass a Date parameter:
    I've tested a SELECT like in the following example:
    SELECT a.field1, a.field2, field3
    FROM table a 
    WHERE a.createdate < :IN_DATE In the tableadapter query-builder I get data, but after storing the command I get following error-message:
    ORA-00932 inconsistent datatypes expected date got number
    Later I have to pass the Date parameter in a Function like
    SELECT a.field1, a.field2, getvalue(a.field3,:IN_DATE) FROM table aIm using ODP.NET 11g on a 10g Oracle DB server.
    Is there a possibility to pass a Date parameter?
    I hope anyone has a tipp...
    Roswitha

    Check the OracleParameter here: http://www.oracle.com/technology/pub/articles/mastering_dotnet_oracle/cook_masteringdotnet.html
    Ming Man

  • ORA-00932: inconsistent datatype: expected SYS.ALERT_TYPE

    Hi,
    I am developing a c# application for getting notifications from SYS.ALERT_QUE (maintained by oracle for alerts). When I try to enque something in queue(SYS.ALERT_QUE) it throws an exception "ORA-00932: inconsistent datatype: expected SYS.ALERT_TYPE". I tried the same code for different queue(cretaed by me in SYS) and it is running fine and getting notification messages too.Do I need to add some additional parameter to access SYS.ALERT_QUE? I am posting the code plz let me know what needs to be done to this code to work for SYS.ALERT_QUE.
    OracleConnection con = new OracleConnection(constr);
    // Create queue
    OracleAQQueue queue = new OracleAQQueue("sys.alert_que", con);
    try
    // Open connection
    con.Open();
    // Set message type for the queue
    queue.MessageType = OracleAQMessageType.Xml;
    queue.NotificationConsumers = new string[1] { "SUBSCRIBER1" };
    // Add the event handler to handle the notification. The
    // MsgReceived method will be invoked when a message is enqueued
    queue.MessageAvailable +=
    new OracleAQMessageAvailableEventHandler(Notification.MsgReceived);
    Console.WriteLine("Notification registered...");
    // Begin txn for enqueue
    OracleTransaction txn = con.BeginTransaction();
    Console.WriteLine("Now enqueuing message...");
    // Prepare messages with XML payload
    OracleAQMessage[] enqMsgs = new OracleAQMessage[1];
    OracleXmlType msg1 = new OracleXmlType(con, "<PERSON><FIRSTNAME>Bob</FIRSTNAME></PERSON>");
    enqMsgs[0] = new OracleAQMessage(msg1);
    OracleAQAgent[] agent = new OracleAQAgent[1];
    agent[0] = new OracleAQAgent("SUBSCRIBER1");
    enqMsgs[0].Recipients = agent;
    enqMsgs[0].SenderId = new OracleAQAgent("SENDER1");
    // Prepare to Enqueue
    queue.EnqueueOptions.Visibility = OracleAQVisibilityMode.OnCommit;
    // Enqueue message array
    queue.EnqueueArray(enqMsgs);
    txn.Commit();
    // Loop while waiting for notification
    while (isNotified == false)
    System.Threading.Thread.Sleep(2000);
    catch (Exception e)
    Console.WriteLine("Error: {0}", e.Message);
    }

    Asif,
    As the error message indicates, there is no mapping between java boolean type and PL/SQL data type.
    No, BOOLEAN type in PL/SQL is not mapped to boolean in java.
    As a workaround, I suggest using an int.
    Good Luck,
    Avi.
    P.S. I think the Java in the Oracle Database forum is more appropriate for your question.

  • Sync error....ORA-00932 Inconsistent datatypes

    Hey all,
    I am getting the following error when syncing:
    MS-9109 n@86e554 (this seems to be random string) || ORA-00932: inconsistent datatypes
    Now, I've narrowed it down to the field that causes this error to occur. It is important to note that if I don't touch the field (just keep the initial value from the initial sync to 8.1.7, things sync fine.
    The error only occurs if I change the field value in 9iLite (which I am doing through me eVB app).
    In 9iLite it is defined as:
    Data_Type = Number, Len = 5, N = Y, Prec = 5, Scale = 4
    In 8.1.7 it is defined as:
    Data_type = Number (5,4) Null = N
    I'm not sure why in Lite null is Y and in 8.1.7 null is N. I just let Oracle create the lite tables based on my snapshot. At any rate, the field is not null.
    Does anyone have any thoughts? Does anyone know what the first part (MS-9109) of the error message is about? I can't find anything on it in Google.
    Thx.
    Darren

    Well,
    If fixed my problem. I just re-wrote the sql I had defined in the snapshot for the table in question. Still not sure why it didn't initally work as I didn't change the logic at all.
    Darren.

  • Why do I get this error? ORA-00932: inconsistent datatypes

    This is my stored procedure I've created to select only the exact amount of records per page for a GridView (for ASP.NET):
    CREATE OR REPLACE
    PROCEDURE SELECT_COMMAND
    (pTable IN VARCHAR2
    , pFields IN VARCHAR2
    , pSortField IN VARCHAR2
    , pPageIndex IN NUMBER
    , pTotalRecs IN NUMBER
    , pResultSet OUT SYS_REFCURSOR
    ) AS
    BEGIN 
      EXECUTE IMMEDIATE
      'SELECT ' || pFields || ' FROM '
      || '(SELECT '|| pFields ||', ROW_NUMBER() OVER(ORDER BY '|| pSortField ||') ROW_NUM '
      || 'FROM '|| pTable ||') WHERE ROW_NUM BETWEEN '|| to_char(pPageIndex*pTotalRecs) ||' AND '
      || to_char((pPageIndex+1)*pTotalRecs)   
      INTO pResultSet;
      -- Plus 1 to our index because GridView is a zeroth index collection
    END SELECT_COMMAND;I then do a test case with the following paremeters:
    declare
    p_test sys_refcursor;
    begin
    select_command('v_sig_devices', '"JOB", "LINE"', '"DEVICE_ID"', 0, 10, p_test);
    end;But I get the following error:
    >
    Error report: ORA-00932: inconsistent datatypes: expected - got -
    ORA-06512: at "SIM.SELECT_COMMAND", line 10
    ORA-06512: at line 4
    00932. 00000 - "inconsistent datatypes: expected %s got %s"
    >
    At first Oracle gave me an error because the numbers were not a string. Then I convert them into a string (with to_char) and Oracle is still not happy! Any ideas as to why this is happening?
    Thanks for any help that you can provide.

    You don't select into ref cursors, you open them:
    SQL> create table t(c varchar2(1));
    Table created.
    SQL> insert into t values ('a');
    1 row created.
    SQL> insert into t values ('b');
    1 row created.
    SQL> insert into t values ('c');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> create or replace
      2  procedure p (p_ref out sys_refcursor) as
      3  begin
      4     open p_ref for 'select c from t';
      5  end;
      6  /
    Procedure created.
    SQL> var results refcursor
    SQL> exec p(:results);
    PL/SQL procedure successfully completed.
    SQL> print results
    C
    a
    b
    c

Maybe you are looking for

  • Create Ship to Party and Sold to Party for distr. channel 10 in VA01

    Hello all: When creating sales order for a material in VA01 with sales Org 1000, distribution channel 10, division 00, system does not give me any Ship to Party and Sold to Party with the above combination How to create ship to party and sold to part

  • How long should it take for a new podcast episode to show up in iTunes?

    Greetings, I have a podcast listed in iTunes and it showed up fine after they listed it. However, about 6 hours ago I uploaded a new episode (number 2 - woohoo) and it's not showing up in iTunes yet. Obviously when I fired up iTunes it downloaded it

  • 1099 Misc reporting

    am trying to run 1099 forms, I am using tcode S_P00_07000134 - Generic Withholding Tax Reporting. When I run program I only see Copy B, which is for the vendors records, I will still need Copy A in order to send to Federal. Does anyone knows the proc

  • Table purchase requisition

    Hi, I would like to know where the information regards the purcharse requisition are being stored and especially the field release strategy FRGSX. thank you.

  • PLEASE HELP ME..!! Mac shut down improperly..!!

    Hi.. I had to improperly shut down my mac (the power button) a couple of times for the first time today..Needless to say i'm not happy and am concerned because incidents like these use to result in missing files on windows which later resulted in fre