ORA-00932: inconsistent data types: expected NUMBER got BINARY

ORA-00932: inconsistent data types: expected NUMBER got BINARY
Hi,
Could anyone help in resolving my problem?
I ‘m developing cmp beans in Jbuilder X,
My database is Oracle 10g, running on Linux and Application server is Oracle10gAs. Running on Windows.
I can deploy my Entity EJB’s OK and look then up using finder methods as long as I’ve created the data directly in the database using SQL*Plus for instance.
In the database I have my primary keys defined as type NUMBER
In my EJB the corresponding number fields get mapped as java.math.BigDecimal.
which according to the Oracle JDBC specification is how they are mapped.
Problem:
When I try to create a new database entity through my EJB entity bean I get:-
Error "ORA-00932: inconsistent datatypes: expected NUMBER got BINARY".
The value of the number being used as the primary key in this example is 10.
Eg:-
BigDecimal pk = new BigDecimal(10);
TestBean test = home.create(pk);
The datatype in my EJB Deployment descriptor ejb-jar-xml <pri-key-class> is java.math.BigDecimal>
The jdbc driver defined in my application.xml is
oracle.jdbc.driver.OracleDriverand url="jdbc:oracle:thin..." in the connection.
I’ve even tried mapping a datatype as described in the Oracle FAQ’s but this didn’t work.
21.     I'm trying to deploy a CMP entity bean with a field type BigDecimal and the table creation fails with an error. How do I work around this?
You have to perform the following steps prior to deploy your application.
o     Define the mapping for java.math.BigDecimal in the database-schemas/oracle.xml as follows:
<type-mapping type="java.math.BigDecimal" name="number(20,8)" />o     Use this schema in your data-source as follows:-
<data-source
class="com.evermind.sql.DriverManagerDataSource"
name="OracleDS"
ejb-location="jdbc/OracleDS"
schema="database-schemas/oracle.xml"
connection-driver="oracle.jdbc.driver.OracleDriver"
username="scott"
password="tiger"
url="jdbc:oracle:thin:@localhost:1521:DEBU"
clean-available-connections-threshold="30"
rac-enabled="false"
inactivity-timeout="30"
/>

Further clarification of my problem.
Originally I said the error occurred when deploying EJB's
Correction: I can deploy them OK on the application server However the Error message occurs when I try to create a new EJB entity, the only value required is the Primary key which I pass as type BidDecimal.
If I create entries directly in the database my EJB findByPrimaryKey can find entities OK.
But I cant create new ones through EJB.
What realy baffels me is why I'm able to read data through the connection but not write.
The datatype in my EJB Deployment descriptor ejb-jar-xml <pri-key-class> is java.math.BigDecimal>
The jdbc driver defined in my application.xml is
oracle.jdbc.driver.OracleDriver
and url="jdbc:oracle:thin..." in the connection.

Similar Messages

  • Ora-00932 inconsistent data type expected date got number

    Hi all,
    I have got an error ora-00932 inconsistent data type expected date got number in the below part of query.
    NVL (TRUNC (wdj.date_completed), '14-NOV-2012')
    BETWEEN NVL (TRUNC(:p_wo_completion_date_from),
    NVL (TRUNC(wdj.date_completed), '14-NOV-2012')
    AND TRUNC(:p_wo_completion_date_to)
    can u please help me to resolve the error mentioned.
    Thanks in advance.
    Regards,
    Ravi

    NVL(TRUNC (wdj.date_completed),to_date('14-NOV-2012','dd-MON-yyyy'))
         BETWEEN
              NVL (
                    TRUNC(to_date(:p_wo_completion_date_from,'mm/dd/yyyy hh12:mi:ss am')),
                   NVL (TRUNC(to_date(wdj.date_completed,'mm/dd/yyyy hh12:mi:ss am')),
                              to_date('14-NOV-2012','dd-MON-yyyy'))
            AND TRUNC(to_date(:p_wo_completion_date_to,'mm/dd/yyyy hh12:mi:ss am'))

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

    when run this code then get the above error why please , image column long raw data type , and can i get length from long raw data type pleaee can send me example if you can and thanks alot
    declare
    src_lob blob;
    pos integer :=214748364337;
    buf varchar2(32000);
    begin
    select image into ( src_lob) from emp where empno=7900;
    buf:=dbms_lob.getlength( src_lob);
    dbms_output.put_line(buf);
    end;

    Your question has nothing to do with XQuery and is more appropriate for the {forum:id=75} forum. You will also need to include which line is raising the error message. It would be best to post the entire error message in your thread instead of just part of it in the subject.
    Out of curiosity, why are you returning .getLength, which returns a number, into a varchar2(32000) field? Seems overkill.

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

  • Problems with java constructor: "inconsistent data types" in SQL query

    Hi,
    I tried to define a type "point3d" with some member functions, implemented in java, in my database. Therefor I implemented a class Point3dj.java as you can see it below and loaded it with "loadjava -user ... -resolve -verbose Point3dj.java" into the database.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    package spatial.objects;
    import java.sql.*;
    public class Point3dj implements java.sql.SQLData {
    public double x;
    public double y;
    public double z;
    public void readSQL(SQLInput in, String type)
    throws SQLException {
    x = in.readDouble();
    y = in.readDouble();
    z = in.readDouble();
    public void writeSQL(SQLOutput out)
    throws SQLException {
    out.writeDouble(x);
    out.writeDouble(y);
    out.writeDouble(z);
    public String getSQLTypeName() throws SQLException {
    return "Point3dj";
    public Point3dj(double x, double y, double z)
    this.x = x;
    this.y = y;
    this.z = z;
    public static Point3dj create(double x, double y, double z)
    return new Point3dj(x,y,z);
    public double getNumber()
         return Math.sqrt(this.x*this.x + this.y*this.y + this.z*this.z);
    public static double getStaticNumber(double px, double py, double pz)
         return Math.sqrt(px*px+py*py+pz*pz);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Additionally, I created the corresponding type in SQL by
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    CREATE OR REPLACE TYPE point3dj AS OBJECT EXTERNAL NAME
    'spatial.objects.Point3dj' LANGUAGE JAVA USING SQLDATA (
    x FLOAT EXTERNAL NAME 'x',
    y FLOAT EXTERNAL NAME 'y',
    z FLOAT EXTERNAL NAME 'z',
    MEMBER FUNCTION getNumber RETURN FLOAT
    EXTERNAL NAME 'getNumber() return double',
    STATIC FUNCTION getStaticNumber(xp FLOAT, yp FLOAT, zp FLOAT) RETURN FLOAT
    EXTERNAL NAME 'getStaticNumber(double, double, double) return double')
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    After that I tried some SQL commands:
    create table pointsj of point3dj;
    insert into pointsj values (point3dj(2,1,1));
    SELECT x, a.getnumber() FROM pointsj a;Now, the problem:
    Everything works fine, if I delete the constructor
    public Point3dj(double x, double y, double z)
    this.x = x;
    this.y = y;
    this.z = z;
    in the java class, or if I replace it with a constructor that has no input arguments.
    But with this few code lines in the java file, I get an error when executing the SQL command
    SELECT x, a.getnumber() FROM pointsj a;The Error is:
    "ORA-00932: inconsistent data types: an IN argument at position 1 that is an instance of an Oracle type convertible to an instance of a user defined Java class expected, an Oracle type that could not be converted to a java class received"
    I think, there are some problems with the input argument of the constructor, but why? I don't need the constructor in SQL, but it is used by a routine of another java class, so I can't just delete it.
    Can anybody help me? I would be very glad about that since I already tried a lot and also search in forums and so on, but wasn't successful up to new.
    Thanks!

    Dear Avi,
    This makes sense when it is a short code sample (and i think i've done that across various posts), but sometime this is too long to copy/paste, in these cases, i refer to the freely available code samples, as i did above on this forum; here is the quote.
    Look at examples of VARRAY and Nested TABLES of scalar types in the code samples of my book (chapter 8) http://books.elsevier.com/us//digitalpress/us/subindex.asp?maintarget=companions/defaultindividual.asp&isbn=9781555583293&country=United+States&srccode=&ref=&subcode=&head=&pdf=&basiccode=&txtSearch=&SearchField=&operator=&order=&community=digitalpress
    As you can see, i was not even asking people to buy the book, just telling them where to grab the code samples.
    I appreciate your input on this and as always, your contribution to the forum, Kuassi

  • ORA-00932: inconsistent datatypes: expected DATE got NUMBER --TO_DATE()

    ORA-00932: inconsistent datatypes: expected DATE got NUMBER
    ORA-06512: at "BDSN.GENERAL", line 272
    ORA-06512: at line 73
    i have fec_alta="10/10/2007" and hor_alta="15:00:00"
    and i am converting to DATE with the TO_DATE function
    but when inserting i am having this error ORA-00932
    is
    fmodif DATE;
    fmodif:=TO_DATE(fec_alta||' '||hor_alta,'DD/MM/YYYY HH24:MI:ss');
    str:= 'insert into '||v_table||'(AF_NUM_IDENTIF,AF_NUM_ALIAS,AF_TIPO_REGISTRO,AF_NUMBRD,AF_FALTA,AF_COD_USU_A,AF_FMODIF,AF_COD_USU_M,AF_MOTIVO,AF_CONDUCTA,AF_TIPO,AF_NUMSERIE,AF_NUMSERIE_SIMPL,AF_NUMSERIE_FON,AF_MARCA,AF_MODELO,AF_MODELO_SIMPL,AF_CALIBRE,AF_ORG_REC,AF_ENT_INT,AF_TIPO_DOC_ORIG_A,AF_FECHA_DOC_ORIG_A,AF_PROC_JUDICIAL,AF_APROCJUD,AF_REF_POLI,AF_OBSV,AF_NUMBRD_BDSN,AF_FEXPIR,AF_RFID,AF_FOTO,AF_GRUPO) values ( '||num_identif||' , '||num_alias||' , '||tipo_registro||' , 0 , sysdate , '||cod_usu_a||' , '||fmodif||', '||cod_usu_m||' , '||motivo||' , '||conducta||' , '||tipo||' , '||numserie||' , '||numserie_simpl||' , '||numserie_fon||' , '||marca||' , '||modelo||' , '||modelo_simpl||' , '||calibre||' , '||org_rec||' , '||ent_int||' , '||tipo_doc||' , sysdate , '||proc_jud||' , '||aprocjud||' , '||ref_pol||' , '||obsv||' , '||numbrd_bdsn||' , sysdate , ''N'' , ''N'' , ''N'' )';
    execute immediate str;
    thanks

    Invalid Month error in PL/SQL
    ¿what is fec_alta? I suppose is a type date
    Modify
    fmodif:=TO_DATE(fec_alta||' '||hor_alta,'DD/MM/YYYY HH24:MI:ss');
    For
    fmodif:=TO_DATE( to_char(fec_alta, 'DD/MM/YYYY') ||' '||hor_alta,'DD/MM/YYYY HH24:MI:ss');

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

    I have a DAC task that is failing and I am getting the message below in the logs
    ORA-00932: inconsistent datatypes: expected NUMBER got DATE
    Attached below is the SQL for the mapping concerned, I am trying to figure this out so that I can run this ETL successfully.
    Any leads would be greatly appreciated.
    READER_1_1_1> CMN_1761 Timestamp Event: [Fri Nov 15 17:00:29 2013]
    READER_1_1_1> RR_4035 SQL Error [
    ORA-00932: inconsistent datatypes: expected NUMBER got DATE
    ORA-00932: inconsistent datatypes: expected NUMBER got DATE
    Database driver error...
    Function Name : Fetch
    SQL Stmt : SELECT
    PS_ITEM_DST.BUSINESS_UNIT_GL , PS_ITEM_DST.ACCOUNT , PS_ITEM_DST.ALTACCT , PS_ITEM_DST.DEPTID , PS_ITEM_DST.OPERATING_UNIT , PS_ITEM_DST.PRODUCT , PS_ITEM_DST.FUND_CODE , PS_ITEM_DST.CLASS_FLD , PS_ITEM_DST.PROGRAM_CODE , PS_ITEM_DST.BUDGET_REF , PS_ITEM_DST.AFFILIATE , PS_ITEM_DST.AFFILIATE_INTRA1 , PS_ITEM_DST.AFFILIATE_INTRA2 , PS_ITEM_DST.CHARTFIELD1 , PS_ITEM_DST.CHARTFIELD2 , PS_ITEM_DST.CHARTFIELD3 , PS_BI_LINE.PROJECT_ID , PS_ITEM_DST.STATISTICS_CODE , PS_ITEM.CUST_ID , PS_ITEM.ADDRESS_SEQ_NUM , PS_BI_HDR.SHIP_TO_CUST_ID , PS_BI_HDR.SHIP_TO_ADDR_NUM , PS_BI_HDR.SOLD_TO_CUST_ID , PS_BI_HDR.SOLD_TO_ADDR_NUM , PS_ITEM_DST.FOREIGN_AMOUNT , PS_ITEM_DST.MONETARY_AMOUNT , PS_ITEM_DST.FOREIGN_CURRENCY , PS_ITEM_DST.CURRENCY_CD , PS_ITEM_DST.BUSINESS_UNIT , PS_ITEM_DST.ITEM , PS_ITEM_DST.ITEM_LINE , PS_ITEM_DST.ITEM_SEQ_NUM , PS_ITEM_DST.DST_SEQ_NUM , PS_ITEM_DST.JOURNAL_ID , PS_ITEM_DST.JOURNAL_DATE , PS_ITEM_DST.JOURNAL_LINE , PS_ITEM_DST.GL_DISTRIB_STATUS , PS_ITEM_DST.LEDGER_GROUP , PS_ITEM_DST.LEDGER , SALESPERSON.EMPLID , PS_ITEM_ACTIVITY.COLLECTOR , PS_ITEM_ACTIVITY.ENTRY_TYPE , PS_ITEM_ACTIVITY.ENTRY_REASON , PS_ITEM_ACTIVITY.BANK_SETID , PS_ITEM_ACTIVITY.BANK_CD , PS_ITEM_ACTIVITY.BANK_ACCT_KEY , PS_ITEM_ACTIVITY.DEPOSIT_ID , PS_ITEM_ACTIVITY.PAYMENT_SEQ_NUM , PS_ITEM_ACTIVITY.GROUP_TYPE , PS_ITEM_ACTIVITY.POST_DT , PS_ITEM_ACTIVITY.ACCOUNTING_DT , PS_ITEM.BAL_AMT , PS_ITEM.ORIG_ITEM_AMT , PS_ITEM.ITEM_STATUS , PS_ITEM.PYMNT_TERMS_CD , PS_ITEM.DUE_DT , PS_ITEM.PO_REF , PS_ITEM.PO_LINE , PS_ITEM.ASOF_DT , PS_BI_HDR.DT_INVOICED , PS_BI_HDR.INVOICE_DT , PS_GROUP_CONTROL.OPRID , PS_ITEM.BUSINESS_UNIT_OM , PSPRCSRQST.RUNDTTM , PS_JRNL_HEADER.DTTM_STAMP_SEC , PSPRCSRQST1.RUNDTTM , PS_BI_HDR.LAST_UPDATE_DTTM , PS_JRNL_HEADER.JRNL_HDR_STATUS , PS_BI_LINE.TAX_CD , PS_BI_LINE.QTY , PS_BI_LINE.LAST_UPDATE_DTTM , PS_JRNL_HEADER.UNPOST_SEQ , PS_ITEM_DST.BUSINESS_UNIT_PC , PS_ITEM_DST.ACTIVITY_ID , PS_ITEM_DST.ANALYSIS_TYPE , PS_ITEM_DST.RESOURCE_TYPE , PS_ITEM_DST.RESOURCE_CATEGORY , PS_ITEM_DST.RESOURCE_SUB_CAT , PS_BI_LINE.CONTRACT_NUM
    FROM
    PS_ITEM_DST,
    PS_ITEM_ACTIVITY,
    PS_ITEM,
    PS_BI_HDR,
    PS_BI_LINE,
    PS_GROUP_CONTROL,
    PSPRCSRQST,
    PSPRCSRQST PSPRCSRQST1,
    PS_JRNL_HEADER,
    (SELECT A.SETCNTRLVALUE, B.SUPPORT_TEAM_MBR, B.EMPLID
    FROM PS_SET_CNTRL_REC A, PS_MEMBER_PERSON B
    WHERE A.SETID = B.SETID AND A.RECNAME = 'MEMBER_PERSON') SALESPERSON
    WHERE
    PS_ITEM_DST.BUSINESS_UNIT = PS_ITEM_ACTIVITY.BUSINESS_UNIT(+) AND PS_ITEM_DST.CUST_ID = PS_ITEM_ACTIVITY.CUST_ID(+) AND PS_ITEM_DST.ITEM = PS_ITEM_ACTIVITY.ITEM(+) AND PS_ITEM_DST.ITEM_LINE = PS_ITEM_ACTIVITY.ITEM_LINE(+) AND PS_ITEM_DST.ITEM_SEQ_NUM = PS_ITEM_ACTIVITY.ITEM_SEQ_NUM(+) AND PS_ITEM_DST.BUSINESS_UNIT = PS_ITEM.BUSINESS_UNIT(+) AND PS_ITEM_DST.CUST_ID = PS_ITEM.CUST_ID(+) AND PS_ITEM_DST.ITEM = PS_ITEM.ITEM(+) AND PS_ITEM_DST.ITEM_LINE = PS_ITEM.ITEM_LINE(+) AND PS_ITEM.BUSINESS_UNIT_BI = PS_BI_HDR.BUSINESS_UNIT(+) AND PS_ITEM.ITEM = PS_BI_HDR.INVOICE(+) AND PS_ITEM_DST.BUSINESS_UNIT_GL = PS_BI_LINE.BUSINESS_UNIT(+) AND PS_ITEM_DST.ITEM = PS_BI_LINE.INVOICE(+) AND PS_ITEM_DST.ITEM_SEQ_NUM = PS_BI_LINE.LINE_SEQ_NUM(+) AND PS_ITEM_ACTIVITY.GROUP_ID = PS_GROUP_CONTROL.GROUP_ID(+) AND PS_ITEM_ACTIVITY.GROUP_BU = PS_GROUP_CONTROL.GROUP_BU(+) AND PS_ITEM_DST.PROCESS_INSTANCE = PSPRCSRQST.PRCSINSTANCE(+) AND PS_ITEM_DST.BUSINESS_UNIT_GL = PS_JRNL_HEADER.BUSINESS_UNIT(+) AND PS_ITEM_DST.JOURNAL_ID = PS_JRNL_HEADER.JOURNAL_ID(+) AND PS_ITEM_DST.JOURNAL_DATE = PS_JRNL_HEADER.JOURNAL_DATE(+) AND PS_JRNL_HEADER.UNPOST_SEQ(+) = 0 AND PS_JRNL_HEADER.PROCESS_INSTANCE = PSPRCSRQST1.PRCSINSTANCE(+) AND PS_ITEM_ACTIVITY.BUSINESS_UNIT = SALESPERSON.SETCNTRLVALUE(+) AND PS_ITEM_ACTIVITY.SALES_PERSON = SALESPERSON.SUPPORT_TEAM_MBR(+)
    AND PS_ITEM_ACTIVITY.ENTRY_TYPE <> 'CR'
    --AND PS_ITEM_DST.GL_DISTRIB_STATUS <> 'I'
    --AND PS_ITEM_DST.GL_DISTRIB_STATUS ='D'

    It might be data issue.
    You may narrow down using length of the particular column.
    ex: date column length less than 8 or 10 might be an issue

  • ORA-00932: inconsistent datatypes: expected DATE got NUMBER at OCI call OCIStmtExecute in OBIEE 11g

    Hi Friends,
    I am getting this error : ORA-00932: inconsistent datatypes: expected DATE got NUMBER at OCI call OCIStmtExecute when I am trying to put the filter condition on the date column.
    "Dim-Time"."Day" <= cast(MAX("Dim-Time"."Day") as date)  and "Dim-Time"."Day" >= TIMESTAMPADD(SQL_TSI_MONTH, -1,cast(MAX("Dim-Time"."Day") as date).
    I have casted the max date but though I am getting the above error. I am thinking max(date) is creating the problem.
    Please suggest your on opinion this.
    Thanks.

    Not sure why you need cast in your statement if at all it is required then you need to do as below
    cast("Dim-Time"."Day"  as date)<= cast(MAX("Dim-Time"."Day") as date)  and cast("Dim-Time"."Day"  as date) >= TIMESTAMPADD(SQL_TSI_MONTH, -1,cast(MAX("Dim-Time"."Day") as date).
    ~ http://cool-bi.com

  • Error message - ORA-00932: inconsistent datatypes: expected CHAR got NUMBER

    Here is my Report Query...
    select
    from   DW_RFA_JOBDATA
    where  FINISH_TIME >= :P1_START_DATE
    and FINISH_TIME < :P1_END_DATE
         AND RFA_FLAG = (CASE :P1_JOB_CLASSIFICATION WHEN '0' THEN 'LSF'
                                      WHEN '1' THEN 'NON-LSF'
                                      ELSE RFA_FLAG END)The column RFA_FLAG data type is NUMBER(*,0)... i am displaying LSF and Non-LSF in the select list box , but i get the error ORA-00932: inconsistent datatypes: expected CHAR got NUMBER >
    I have created static LOV with LSF display 0 return
    NON-LSF display 1 return..
    Could any body please help me in truble shooting the error ? how do i convert datatype into number i dont have any privileges to make changes to the table...

    Are there multiple columns in the table you are using from your LOV?
    Your LOV select is:
    select
    from   DW_RFA_JOBDATA
    where  FINISH_TIME >= :P1_START_DATE
    and FINISH_TIME < :P1_END_DATE
         AND RFA_FLAG = (CASE :P1_JOB_CLASSIFICATION WHEN '0' THEN 'LSF'
                                      WHEN '1' THEN 'NON-LSF'
                                      ELSE RFA_FLAG END)Maybe try this:
    select
    from   DW_RFA_JOBDATA
    where  FINISH_TIME >= :P1_START_DATE
    and FINISH_TIME < :P1_END_DATE
         AND TO_CHAR(RFA_FLAG) = DECODE(:P1_JOB_CLASSIFICATION,'0','LSF','1','NON-LSF',RFA_FLAG)

  • PL/SQL: ORA-00932: inconsistent datatypes: expected UDT got NUMBER

    Hi all,
    Wondering if you could assist? I'm exploring User Types and having a small problem. I'm getting the above error for a user type I have created which I'm calling in a function. Here's what my code looks like which I'm running the 'scott' schema for testing purposes
    SQL> CREATE OR REPLACE TYPE NBR_COLL AS TABLE OF NUMBER;
    2 /
    Type created.
    SQL> create or replace FUNCTION first_rec_only
    2 (
    3 NUM_ID IN NUMBER
    4 ) RETURN NUMBER IS
    5 v_num NBR_COLL;
    6 BEGIN
    7 select deptno into v_num from dept;
    8 RETURN v_num(v_num.FIRST);
    9 END first_rec_only;
    10 /
    Warning: Function created with compilation errors.
    SQL> show errors
    Errors for FUNCTION FIRST_REC_ONLY:
    LINE/COL ERROR
    7/4 PL/SQL: SQL Statement ignored
    7/11 PL/SQL: ORA-00932: inconsistent datatypes: expected UDT got
    NUMBER
    SQL>
    Any clues to what I'm doing wrong? Cheers.

    The deptno column is a number, you cannot directly select a number into your type, you need to use your type's constructor.
    Something like:
    CREATE OR REPLACE FUNCTION first_rec_only (NUM_ID IN NUMBER) RETURN NUMBER IS
       v_num NBR_COLL;
    BEGIN
       SELECT nbr_coll(deptno) INTO v_num from dept;
       RETURN v_num(v_num.FIRST);
    END first_rec_only;Note that although this will compile, it will throw ORA-01422: exact fetch returns more than requested number of rows when you run it. you need to either use the input parameter as a predicate on your query against dept, use rownum = 1 in the query or use bulk BULK COLLECT INTO, depending on what exactly you want to accomplish.
    John

  • 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 expected number got date

    in sql developer :
    select 12 a from dual
    where :dela+1<sysdate
    gives me that error . why ???? Any idea ?
    select 12 a from dual
    where :dela<sysdate ---- is correct .
    and i have in a select in a cursor in forms :
    a) obs :d.data can have hour 15 for example ; :datamea is dd-mon-yyyy;
    d.data>=:datamea+1 ;
    or is it better to put
    trunc(d.data)>:datamea
    And between : substr(dd.account,1,3) in('419') and dd.account like '419%' is there any diffrence ?
    Thanks a lot !!!

    SQL> select * from dual where NULL+1 < SYSDATE;
    select * from dual where NULL+1 < SYSDATE
    ERROR at line 1:
    ORA-00932: inconsistent datatypes: expected NUMBER got DATE
    SQL>  select * from dual where NULL < SYSDATE-1;
    no rows selectedif you compare (NULL+1) with date, it will not work
    you could do also
    SQL>  select * from dual where cast(NULL as date)+1<sysdate;
    no rows selected
    SQL>

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

    DEAR JDEV TEAM,
    I JUST TRY TO RUNNING ITERATE SAMPLE OF OTN SAMPLE.
    I RECEIVE ABOVE MENTION ERROR. HOW TO FIX IT ?
    BEST REGARDS
    BORIS

    SQL> create table test (c1 timestamp);
    Table created.
    SQL> insert into test values(systimestamp);
    1 row created.
    SQL> select trunc(86400*(sysdate-c1)/60/60) as hours from test;
    select trunc(86400*(sysdate-c1)/60/60) as hours from test
    ERROR at line 1:
    ORA-00932: inconsistent datatypes: expected NUMBER got INTERVAL DAY TO SECOND
    SQL> select trunc(86400*(sysdate-cast(c1 as date))/60/60) as hours from test;
         HOURS
             0Edited by: jeneesh on Oct 20, 2008 5:27 PM
    And you can understnad the reason for the error from the below output
    SQL> select systimestamp - c1 from test;
    SYSTIMESTAMP-C1
    +000000000 00:02:35.329017

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

    Hello,
    My query:
    select name,mime_type,blob_content
    from htmldb_application_files
    error:ORA-00932: inconsistent datatypes: expected NUMBER got BLOB
    What's going on?
    Tom

    Hi,
    So how can I check content of 'blob_content'?
    Tom

Maybe you are looking for

  • How do i convert a pdf to a jpeg in adobe reader xi?

    how do i convert a pdf to a jpeg in adobe reader xi? thanks

  • My last 17" MacBook Pro?

    Just like in this thread (https://discussions.apple.com/message/18617731#18617731), I cannot believe that Apple has abandoned the 17" market.  As a web designer and photographer, I absolutely need (and LOVE) the extra room and impact the 17" display

  • How to do good Issue with S/N from DI API

    Hai, I want to do good Issue with Serial Number using DI API but I got an error message <b>"\[IGE1.DocEntry]\[line:0],item serial is not found in Whse SR-5155 - 1 - R5155KGS ' (-5002)" </b> here is the code Set oGoodIssue = oCompanyDI.GetBusinessObje

  • Urgent :---XI 3.0 INSTALLATION ERROR

    Dear Friends, i have installed all the components of Xi 3.0. And now i m in the post installation steps. while creating RFC connection for INTERGRATION_DIRECTORY_HMI as per the documentation ...in logon/Security i selected Basic Authentication .. pop

  • Finder - setting Directories

    Hi, A query from a newbie who is transferring QuatroPro spreadsheets from a PC to Mac & wishes to place them in a specially created set of directories. Using the mkdir command I created under my Home Directory another in the second column then anothe