ORA00932 inconsistent datatypes For member methods in SQLJ Object called from SQLPlus

Hi, I would very much appreciate advice on the following problem, its a tricky one, here are the full details....
A) EXECUTIVE SUMMARY....
I have created an oracle object type by wrapping a SQLData java object with the Oracle Create type statement. I am using Oracle 9i on NT4. However despite following the very few Oracle examples I could find, I get the following error....
select value(aaa).testint() from dealsobjtab aaa
ORA-00932: inconsistent datatypes
select value(aaa).testme() from dealsobjtab aaa
ORA-00932: inconsistent datatypesHere is what I've done...
1) Create Java object using SQLData interface (see listing below)
2) Load the Java source to Oracle 9i
3) Run the Oracle Create Type statement to wrap the java class
4) Use the objects in a table and successfully insert rows and query attributes using SQLPlus
5) Find I can't pull back data from any instance methods without getting an "inconsistant datatypes" error for both string and int datatypes. (see below for queries and output from SQLPlus)
B) STEP BY STEP DETAILS FOLLOW......
1) Java Source (in file \dealcalcs\Dealtest.java)
package dealcalcs;
import java.sql.SQLException;
import oracle.jdbc.OracleConnection;
import oracle.jdbc.OracleTypes;
import java.sql.*;
public class Dealtest implements SQLData
public static final String SQLNAME = "SWITCHBLADE_DATA.DEALTEST";
public static final int SQLTYPECODE = OracleTypes.STRUCT;
protected java.math.BigDecimal m_dealid;
protected java.sql.Timestamp m_startdate;
protected String m_dealtype;
protected Double m_facevalue;
/* constructor */
public Dealtest() { }
public void readSQL(SQLInput stream, String type)
throws SQLException
setDealid(stream.readBigDecimal());
setStartdate(stream.readTimestamp());
setDealtype(stream.readString());
setFacevalue(new Double(stream.readDouble()));
if (stream.wasNull()) setFacevalue(null);
public void writeSQL(SQLOutput stream)
throws SQLException
stream.writeBigDecimal(getDealid());
stream.writeTimestamp(getStartdate());
stream.writeString(getDealtype());
if (getFacevalue() == null)
stream.writeBigDecimal(null);
else
stream.writeDouble(getFacevalue().doubleValue());
public String getSQLTypeName() throws SQLException
return SQLNAME;
/* accessor methods */
public java.math.BigDecimal getDealid() { return m_dealid; }
public void setDealid(java.math.BigDecimal dealid) { m_dealid = dealid; }
public java.sql.Timestamp getStartdate() { return m_startdate; }
public void setStartdate(java.sql.Timestamp startdate) { m_startdate = startdate; }
public String getDealtype() { return m_dealtype; }
public void setDealtype(String dealtype) { m_dealtype = dealtype; }
public Double getFacevalue() { return m_facevalue; }
public void setFacevalue(Double facevalue) { m_facevalue = facevalue; }
//These last two are the member methods I call
public String testme(){
String tmp = new String("testme worked");
return tmp;
public int testint(){
int tmp = 0;
tmp = 88;
return tmp;
2, 3, 4) Here is how I wrap the uploaded SQLJ object, create a table using it, and put a row in it....
create or replace type deal_t as object
     external name 'dealcalcs.Dealtest'
LANGUAGE JAVA USING SQLData (
DEALID NUMBER (11) external name 'dealid',
STARTDATE DATE external name 'startdate',
DEALTYPE VARCHAR2 (50) external name 'dealtype',
FACEVALUE FLOAT (49) external name 'facevalue',
MEMBER FUNCTION testme RETURN VARCHAR2
     EXTERNAL NAME 'testme() return java.lang.String',
MEMBER FUNCTION testint RETURN NUMBER
     EXTERNAL NAME 'testint() return int'
) not final
create table dealsobjtab of deal_t;
insert into dealsobjtab values ( deal_t(1, to_date('1/jan/1968'), 'NZD/NZD', 500))
COMMIT
5) Here I select attributes from the object table, and select using the two member methods, note that my member methods fail miserably, and advice on fixing this would be much appreciated....
select * from dealsobjtab aaa
DEALID STARTDATE DEALTYPE FACEVALUE
1 01/01/1968 NZD/NZD 500
1 row selected
select value(aaa).dealid from dealsobjtab aaa
VALUE(AAA).DEALID
1
1 row selected
select value(aaa).testint() from dealsobjtab aaa
ORA-00932: inconsistent datatypes
select value(aaa).testme() from dealsobjtab aaa
ORA-00932: inconsistent datatypes
Phew, that was a long email, I hope you are still awake after all that. I have no idea how to solve this, and would really appreciate some advice to get me going.
Yours Sincerely,
Michael Cato

But, i am receiving the error i have mentioned. is it depends on the java version also?
Please suggest..

Similar Messages

  • 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

  • One Method is not getting called from of one BADI Customer_add_data

    Hi,
    I am Implementing one method BUILD_TEXT_FOR_CHANGE_DETAIL
    I have done coding part also and set breakpoint to check the data.
    I went to transaction XD01 and created one customer and check the execution but it didnt reach to the step where i placed the break point.
    I checked the  program    SAPMF02D from transaction x01   and searched for the method where its being called . But search for unsuccessful as no reaults has been found.
    Please help me in rectifing this issue.
    Thanks,
    Izaz.

    if the question is not clear please tell me i ll write it in detail

  • WHAT ABOUT FACE TIME?  I'D LIKE TO KNOW IF YOU NEED A PHONE NUMBER FOR YOURSELF TO USE IT TO CALL FROM YOUR COMPUTER

    WHAT ABOUT FACE TIME?  I'D LIKE TO KNOW IF YOU NEED A PHONE NUMBER FOR YOURSELF TO USE IT TO CALL FROM YOUR COMPUTER

    Do you have iMessage? I think as long as that person has iMessage you can use Face Time to call each other.

  • [svn:fx-4.0.0] 13647: this should actually fix the build - call the modified main target to call the bundle task for osmf and actually make the call from frameworks /build.xml

    Revision: 13647
    Revision: 13647
    Author:   [email protected]
    Date:     2010-01-19 17:04:22 -0800 (Tue, 19 Jan 2010)
    Log Message:
    this should actually fix the build - call the modified main target to call the bundle task for osmf and actually make the call from frameworks/build.xml
    QE notes:
    Doc notes:
    Bugs:
    Reviewer:
    Tests run:
    Is noteworthy for integration:
    Modified Paths:
        flex/sdk/branches/4.0.0/frameworks/build.xml

    Hi Renuka,
    The model classes get generated under gen_cmi folder at the time of model import.
    As far I know, the Web Dynpro build operation also re-generates these classes if reqd.
    That is why I asked you to delete the gen_* folder content & do a Project Rebuild operation.
    Or you can delete the model & try importing it again.
    If the problem persists with the generated classes then there is an issue/bug with the generation & I would recommend to raise an OSS message (WD Java component)
    Kind Regards,
    Nitin

  • Inconsistent datatypes error when inserting into a object

    I am trying to insert some test data into the table emp.I have managed to succesfully create the objects and types but when I try to insert into the emp table I get a inconsistent datatypes error however I have checked the datatypes and they all seem fine. Can anyone help me.
    thanks
    CREATE OR REPLACE TYPE Address_T AS object
    (ADDR1                VC2_40,
    ADDR2               VC2_40,
    CITY_TX          VC2_40,
    COUNTY_CD          VC2_40,
    POST_CD          VC2_40);
    CREATE OR REPLACE TYPE PERSON_T AS OBJECT (
    LNAME_TX           NAME_T,
    FNAME_TX           NAME_T,
    BIRTH_DATE          DATE,
    TELEPHONE          VC2_20,
    EMAIL               VC2_40);
    CREATE OR REPLACE TYPE EMP_T AS OBJECT (
    EMP_ID     NUMBER (10),
    PERSON     PERSON_T,
    ADDRESS ADDRESS_T,
    HIRE_DATE DATE)
    CREATE TABLE EMP OF EMP_T
    (EMP_ID NOT NULL PRIMARY KEY);
    INSERT INTO EMP VALUES (1,           
    PERSON_T('PETCH',
    'GAVIN',
    '23-JAN-80',
    '(01964)550700',
    '[email protected]'),
    ADDRESS_T('67 CANADA',
    'WALKINGTON',
    'BEVERLEY',
    'EAST YORKSHIRE',
    'HU17 7RL'),
    '11-FEB-02'
    ERROR at line 1:
    ORA-00932: inconsistent datatypes

    Gavin,
    What is your VC2_40 and NAME_T type definition? Your insert used these as varchar2, which is a built-in type not a user-defined type. If you explicitly define these to be varchar2's, the insert statement works fine.
    Regards,
    Geoff
    I am trying to insert some test data into the table emp.I have managed to succesfully create the objects and types but when I try to insert into the emp table I get a inconsistent datatypes error however I have checked the datatypes and they all seem fine. Can anyone help me.
    thanks
    CREATE OR REPLACE TYPE Address_T AS object
    (ADDR1                VC2_40,
    ADDR2               VC2_40,
    CITY_TX          VC2_40,
    COUNTY_CD          VC2_40,
    POST_CD          VC2_40);
    CREATE OR REPLACE TYPE PERSON_T AS OBJECT (
    LNAME_TX           NAME_T,
    FNAME_TX           NAME_T,
    BIRTH_DATE          DATE,
    TELEPHONE          VC2_20,
    EMAIL               VC2_40);
    CREATE OR REPLACE TYPE EMP_T AS OBJECT (
    EMP_ID     NUMBER (10),
    PERSON     PERSON_T,
    ADDRESS ADDRESS_T,
    HIRE_DATE DATE)
    CREATE TABLE EMP OF EMP_T
    (EMP_ID NOT NULL PRIMARY KEY);
    INSERT INTO EMP VALUES (1,           
    PERSON_T('PETCH',
    'GAVIN',
    '23-JAN-80',
    '(01964)550700',
    '[email protected]'),
    ADDRESS_T('67 CANADA',
    'WALKINGTON',
    'BEVERLEY',
    'EAST YORKSHIRE',
    'HU17 7RL'),
    '11-FEB-02'
    ERROR at line 1:
    ORA-00932: inconsistent datatypes

  • Difference between MAP member and ORDER member  method in PLSQL Object Type

    Hi all,
    I need to know clear explanation about the MAP and ORDER member method and its Difference.Please share if you know.
    thanks in advance.
    regards,
    Lokesh
    Edited by: 972864 on Dec 10, 2012 1:50 AM

    http://docs.oracle.com/cd/B28359_01/appdev.111/b28371/adobjbas.htm#autoId13

  • "Can't find bundle for base name" in a JavaBean called from a JSP

    I have quite a large EAR file which contains an EJB.jar file, a WAR file and various other jars used by the EJB.jar file. I the WAR file has a number of JSPs and now some JavaBeans. The JavaBeans live in their own jar which is deployed in the WEB-INF\lib directory. I am trying to use ResourceBundles for the error messages which are generated in the JavaBeans.
    Here is the problem. I have put the resource bundle properties files in the WEB-INF\classes directory and I can access them just fine from the JSPs. Not so from the JavaBeans, I get the following error:
    "Can't find bundle for base name webui-resources, locale en_US Can't find bundle for base name webui-resources, locale en_US ".
    I have tried just 'jarring' up the properties files into the JavaBeans jar but no dice.
    It 'smell's like a Classloader issue. Any help greatly appreciated.
    Ian.
    p.s. I am using JBoss 2.4.4 with Tomcat 3.2.3 and JDK 1.3.1_09 on XP.

    Here is my suggestion.
    Do you have the property file named "webui-resources_en_US.properties"?
    Here is the example
    language="en"
    country="US"
    locale = new Locale(language, country);
    bundle = ResourceBundle.getBundle("com.<companyname>.webui-resources");
    copy the webui-resources_en_US.properties file to the directory
    com.<companyname> in your workspace/IDE/localdirectory. or ftp that file to classes/com/companyname directory
    This should work. I am using it that way.
    which appserver r u using?

  • Run method of an object called twice before first completed

    Hello Everyone,
    I have an object which has a run method. What will happen if the run method is called while the object is currently executing its run method.
    Sincerely,
    Justin Dallas

    Its threads which execute code, not objects.
    If you call run() in two different threads at once, they will both execute run() at the same time. Whether this causes a problem or not depend on whether run() is thread-safe.

  • ORA-00932 (Inconsistent datatype) on BLOB field in a view using Forms 6i

    Hi
    I created a table having a BLOB column and populate it with images and also make queries on that table using form 6i but when I use a view to build a form which built on that table when I try to query I receive the following error :
    ORA-00932:Inconsistent datatype
    The view created as simple as SELECT * FROM MY_TABLE and there is no problem with other columns in that view but BLOB column. I am using FORMS 6i (6.0.8.11.3)
    I would be so glad if someone could help me.
    thanx.

    I solved this problem by installing Forms 6i Patch 4a.
    It was so easy, but I don't know if there is easier way to solve this problem.
    Behrooz.

  • (261205913) Q SYNCH-14 Is the client behavior still synchronous for buffered methods?

    Q<SYNCH-14> Is the client behavior still synchronous for buffered methods?
    Q<SYNCH-14> For buffered methods the client invocation is essentially asynchronous
    since the return type for the method is void. Quote from BEA Workshop documentation:
    If you add a message buffer to a method of your web service, incoming messages
    (invocations of the method) are buffered on the local machine. The method invocation
    returns to the client immediately. This prevents the client from waiting until
    your web service processes the request. Note that since the buffering occurs on
    your end of the wire, the client still must wait for the network roundtrip even
    though it will return a void result. But the client does not have to wait for
    your service to process the message

    Futher information about the possibility of callback:
    It may be possible for a synchronous only web service (i.e. MS .net) to even paticipant
    in the callback functionality of asynchronous web services. If the client implements
    the appropriate methods for the callback but listens for them on a different port
    or binding than the SOAP request, then web service may be able to build a response
    if the client's "callback URL" is submitted as the beginning part of a conversation.
    Watch the BEA developer forum (http://dev2dev.bea.com) for more information about
    this approach and other tips and techniques for building web services.
    "Adam FitzGerald" <[email protected]> wrote:
    >
    Q<SYNCH-03> I heard that MS .net only implements synchrnonus method? If
    this is true.
    Does it means my async methods will only work with J2EE clients?
    A<SYNCH-03> I do not know the limitations of .net but let me point out that
    is very
    difficult to provide asynchronous web service method invocation (this is
    different
    from an asynchronous web service). HTTP as a general communication protocol
    is based
    on a request and response paradigm so your client libraries will mostly
    likely be
    expecting a response even if it is empty (check the asynchronous example
    from today
    to see that the start method still returns an empty response). You must
    distinguish
    this from the notion of an asynchronous web service which is a business
    operation
    that occurs on the server whose return value/result is not directly associated
    with
    building response to the client. An asynchronous web service can (and generally
    will)
    be started and stopped with web service operations that are invoked synchronously.
    Thus MS .net clients can still be client to WLS hosted web services.

  • Error 'Inconsistent datatypes' with Java classes

    Hi,
    I have some Java classes loaded in Oracle 8.1.6, mapped as Object Types, so when I create one object from PL/SQL, JVM ought to create the matching Java object, communicating via the SQLData interface.
    Unfortunately, after the code:
    pippo:=OraMailer('mail.server.com','mymail');
    that creates the PL/SQL object, any code that use member procedures or function wrapping instance methods of the Java class fails with the error 932: Inconsistent datatypes.
    I looked for a mistake in my PL/SQL and Java code, but no error was found.
    It is very important: help me!!!
    Thx

    So here is what you are doing:
    ArrayList results = //get employees from database
    ListIterator langIt = results.listIterator();
    while (langIt.hasNext()) {
      Employee emp = langIt.next();
      String name2 = emp.getName();
      String SSNo = emp.getSSNum();
      results.add(name2);
      results.add(SSNo);
    }So you get a list or Employee objects, then you get an iterator over the list. For each Employee in the list you add the name and SSNo as Strings back to the same list. From the API for ConcurrentModificationException the exception can be thrown when you modify a collection while iterating over the collection - which is precisely what you are doing.
    The ListIterator interface allows you to modify the list through its own methods. Try using:
      langIt.add(name2);
      langIt.add(SSNo);instead.
    Why are you taking the name and SSNo out of the Employee object and placing them back in the same List anyway? That makes no sense to me.

  • A problem with inconsistent datatypes

    Whenever I try inserting a new record of type t_cliente_societa in my Cliente table, I get ORA-00932 inconsistent datatypes error and I'm not able to find the reason.
    Could anyone help me? Thanks in advance.
    I'll post my SQL code here. please ignore member functions for I havent' included the code necessary to create the needed tables.
    I defined some types useful for storing informations about the entities I have to deal with.
    The main type is t_cliente and its subtypes are t_cliente_pers and t_cliente_soc.
    I use polymorphism to insert records based on subtypes instancies into a table based on supertype.
    When I would add a new t_cliente_pers record, first I add it into Persona table and then into Cliente table.
    The latter contains a REF to Persona for I have several "persons" who aren't "clients" and I use a single table to store them all.
    create or replace TYPE t_indirizzo AS OBJECT (
    via VARCHAR(45),
    numero NUMBER(4),
    cap INTEGER(5),
    citta VARCHAR(30),
    provincia VARCHAR(30),
    regione VARCHAR(30),
    MEMBER FUNCTION indirizzoCompleto RETURN VARCHAR
    create or replace TYPE t_telefono AS OBJECT (
    num_tel NUMBER(15)
    create or replace TYPE t_telefono_array IS VARRAY(3) OF t_telefono
    create or replace TYPE t_anagrafica AS OBJECT (
    nome VARCHAR(45),
    cognome VARCHAR(45),
    sesso CHAR(1),
    cod_fiscale VARCHAR(16),
    data_nascita DATE
    create or replace TYPE t_ragioneSociale AS OBJECT (
    nome_soc VARCHAR(45),
    data_cost DATE,
    part_iva NUMBER(11)
    create or replace TYPE t_persona AS OBJECT (
    dati_anagrafici t_anagrafica,
    indirizzo t_indirizzo,
    email VARCHAR(45),
    telefono t_telefono_array
    create or replace TYPE t_societa AS OBJECT (
    ragione_sociale t_ragioneSociale,
    indirizzo t_indirizzo,
    email VARCHAR(45),
    telefono t_telefono_array,
    persona_rif t_persona
    create or replace TYPE t_cliente AS OBJECT (
    cod_cliente NUMBER(8),
    MEMBER FUNCTION incFatti RETURN NUMBER,
    MEMBER FUNCTION incSubiti RETURN NUMBER,
    MEMBER FUNCTION incFattiPeriodo RETURN NUMBER,
    MEMBER FUNCTION incSubitiPeriodo RETURN NUMBER,
    MEMBER FUNCTION nomeCliente RETURN VARCHAR,
    MEMBER FUNCTION tipoCliente RETURN VARCHAR
    ) NOT FINAL
    CREATE OR REPLACE TYPE BODY t_cliente AS
    MEMBER FUNCTION incFatti RETURN NUMBER
    IS incidenti NUMBER;
    BEGIN
    SELECT count(i. cod_incidente) INTO incidenti
    FROM Incidenti i, Mezzi m
    WHERE SELF.cod_cliente = m.possessore.cod_cliente AND m.num_targa = i.mezzo. num_targa AND i. responsabilita = ‘c’;
    RETURN (incidenti);
    END;
    MEMBER FUNCTION incSubiti RETURN NUMBER
    IS incidenti NUMBER;
    BEGIN
    SELECT count(i. cod_incidente) INTO incidenti
    FROM Incidenti i, Mezzi m
    WHERE SELF.cod_cliente = m.possessore.cod_cliente AND m.num_targa = i.mezzo. num_targa AND i. responsabilita = ‘s’;
    RETURN (incidenti);
    END;
    MEMBER FUNCTION incFattiPeriodo (da DATE, a DATE) RETURN NUMBER
    IS incidenti NUMBER;
    BEGIN
    SELECT count(i. cod_incidente) INTO incidenti
    FROM Incidenti i ,Mezzi m
    WHERE SELF. cod_cliente = m.possessore.cod_cliente AND m. num_targa = i.mezzo. num_targa AND i. responsabilita = ‘c’ AND (i.data BETWEEN da and a);
    RETURN (incidenti);
    END;
    MEMBER FUNCTION incSubitiPeriodo (da DATE, a DATE) RETURN NUMBER
    IS incidenti NUMBER;
    BEGIN
    SELECT count(i. cod_incidente) INTO incidenti
    FROM Incidenti i ,Mezzi m
    WHERE SELF. cod_cliente = m.possessore.cod_cliente AND m. num_targa = i.mezzo. num_targa AND i. responsabilita = ‘s’ AND (i.data BETWEEN da and a);
    RETURN (incidenti);
    END;
    MEMBER FUNCTION nomeCliente RETURN VARCHAR
    IS
    BEGIN
    RETURN TO_CHAR(cod_cliente);
    END;
    MEMBER FUNCTION tipoCliente RETURN VARCHAR
    IS
    BEGIN
    RETURN (‘u’);
    END;
    END ;
    create or replace TYPE t_cliente_pers UNDER t_cliente (
    persona REF t_persona,
    OVERRIDING MEMBER FUNCTION nomeCliente RETURN VARCHAR,
    OVERRIDING MEMBER FUNCTION tipoCliente RETURN VARCHAR
    ) NOT FINAL
    CREATE OR REPLACE TYPE BODY t_cliente_pers AS
    MEMBER FUNCTION nomeCliente RETURN VARCHAR
    IS nc VARCHAR(90) ;
    BEGIN
    SELECT concat(p.dati_anagrafici.nome, concat(' ',p.dati_anagrafici.cognome)) INTO nc
    FROM d;
    RETURN (nc);
    END;
    MEMBER FUNCTION tipoCliente RETURN VARCHAR
    IS
    BEGIN
    RETURN (‘p’);
    END;
    END ;
    create or replace TYPE t_cliente_soc UNDER t_cliente (
    societa t_societa,
    OVERRIDING MEMBER FUNCTION nomeCliente RETURN VARCHAR,
    OVERRIDING MEMBER FUNCTION tipoCliente RETURN VARCHAR
    ) NOT FINAL
    CREATE OR REPLACE TYPE BODY t_cliente_soc AS
    MEMBER FUNCTION nomeCliente RETURN VARCHAR
    IS
    BEGIN
    RETURN (ragione_sociale.nome_soc);
    END;
    MEMBER FUNCTION tipoCliente RETURN VARCHAR
    IS
    BEGIN
    RETURN (‘s’);
    END;
    END ;
    CREATE TABLE persona OF t_persona(
    dati_anagrafici NOT NULL,
    indirizzo NOT NULL,
    email NOT NULL,
    telefono NOT NULL,
    PRIMARY KEY (dati_anagrafici.cod_fiscale)
    CREATE TABLE cliente OF t_cliente(
    PRIMARY KEY (cod_cliente)
    CREATE SEQUENCE seqCliente
    START WITH 1
    INCREMENT BY 1
    MINVALUE 1
    NOMAXVALUE
    NOCYCLE;
    And finally this is the instruction that gives me problems.*
    INSERT INTO cliente VALUES(
    t_cliente_soc(
    seqCliente.NEXTVAL,
    t_societa(
    t_ragioneSociale('Adecco', '01-gen-1999', '12345678901'),
    t_indirizzo('Milano', '18', '21100', 'Varese', 'Varese', 'Lombardia'),
    '[email protected]',
    t_telefono_array(t_telefono('0332563214')),
    t_persona(
    t_anagrafica('Giulia', 'Macchi', 'f', 'MCCGLA80C23L682L', '23-gen-1980'),
    t_indirizzo('Tofane', '2', '23026', 'Arona', 'Novara', 'Piemonte'),
    '[email protected]',
    t_telefono_array(t_telefono('0322123456'), t_telefono('3337894561'))
    /

    I eliminated the entire database and recreated everything. Now it works... Thanks anyway.

  • Inconsistent datatypes: expected - got CHAR, Detail view bind variables

    Hi.
    Here is my problem:
    I have master detail views connected with a view link. Both of views have bind variables that hold some session info:
    It's a menu on database and I am trying to hide some values based on user permissions.
    When running application module, everything works fine. The problem occurs when I try to show menu as a tree table, or any other table, on a page.
    The root view executes fine, but then I get an
    "java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected - got CHAR"
    error in executeQueryForCollection method of detail view. (this method is overridden)
    Bind Variables are:
    - :menuRoot -> which holds value of Root node. (In detail view it's just a dummy variable. It is explaned later on why i used it.)
    - :listOfUserPermmission -> array of user permissions.
    My query looks like this:
    1.Master View:
    SELECT MetVMenu.CHILD_ID,
           MetVMenu.CHILD_IME_MODULA,
           MetVMenu.PARENT_ID,
           MetVMenu.PARENT_IME_MODULA,
           MetVMenu.ZST,
           MetVMenu.NIVO,
           MetVMenu.CHILD_NAZIV_V_MENIJU,
           MetVMenu.CHILD_TIP_MODULA,
           MetVMenu.CHILD_OPIS_MODULA
    FROM MET_V_MENU MetVMenu
    WHERE MetVMenu.PARENT_IME_MODULA like :menuRoot
    and MetVMenu.CHILD_IME_MODULA in (SELECT * FROM TABLE(CAST(:listOfUserPermission AS STRARRAY)))CHILD_IME_MODULA and PARENT_IME_MODULA are also names of permissions.
    2.View Link that connects master.CHILD_ID and detail PARENT_ID
    3.Detail view, that then links to itself... to get the tree menu.
    SELECT MetVMenu.CHILD_ID,
           MetVMenu.CHILD_IME_MODULA,
           MetVMenu.PARENT_ID,
           MetVMenu.PARENT_IME_MODULA,
           MetVMenu.ZST,
           MetVMenu.NIVO,
           MetVMenu.CHILD_NAZIV_V_MENIJU,
           MetVMenu.CHILD_TIP_MODULA,
           MetVMenu.CHILD_OPIS_MODULA
    FROM MET_V_MENU MetVMenu
    WHERE :menuRoot like 'a'
    and
    MetVMenu.CHILD_IME_MODULA in (SELECT * FROM TABLE(CAST(:listOfUserPermission AS STRARRAY)))4. ViewLink that connects CHILD_ID and PARENT_ID of this "detail" view.
    Both views executeQuery methods are overridden to set Bind variables before execution.
    I get an arrayList of strings (permissions) from session and then convert it to Array.
         ArrayList permmissionsArray = (ArrayList)MyUserSession.getSessionValue("permissions");
         Array permissions = new Array(permissionsArray.toArray());
            HashMap context = new HashMap();
            context.put(DomainContext.ELEMENT_SQL_NAME, "STRARRAY");
            context.put(DomainContext.ELEMENT_TYPE, String.class);
            if(permissions != null){
                permissions.setContext(null, null, context);
                setlistOfUserPermission(permissions);
         //Here I set menuRoot variable.
         I also noticed that there are problems with how I define bind variables (the order matters).
    So when i didn't use menuRoot variable in detail view I got the
    “inconsistent datatypes: expected - got CHAR"
    error in application module.

    I went through those links, and I am sure the user has enough rights on STRARRAY object.
    I noticed that when running application module things work fine if I firstly execute RootView - Master view.
    and then double click on VL which shows detail view in table.
    The error occurs if I click on ViewLink first. I am not sure if I am even "allowed" to do that.
    I set the parameters with "setNamedWhereClauseParam" and print them out before i call super.executeQueryForCollection() and this the output i get:
    ExecuteQueryForCollectionRoot
    Permission: [AdfIn2Ogrodje.ROOT, AdfIn2Ogrodje.ADMINISTRACIJA, HOME]
    [87] MetVMenuRoot1 ViewRowSetImpl.setNamedWhereClauseParam(listOfUserPermission, oracle.jbo.domain.Array@e1af74d9)
    [88] MetVMenuRoot1 ViewRowSetImpl.setNamedWhereClauseParam(menuRoot, AdfIn2Ogrodje.ROOT)
    //Print before execution.
    EXECUTE_MENUROOT menuRoot: AdfIn2Ogrodje.ROOT
    EXECUTE_MENUROOT permission: oracle.jbo.domain.Array@e1af74d9
        Permission: AdfIn2Ogrodje.ROOT
        Permission: AdfIn2Ogrodje.ADMINISTRACIJA
        Permission: HOME
    [89] MetVMenuRoot1>#q computed SQLStmtBufLen: 537, actual=447, storing=477
    [90] SELECT MetVMenu.CHILD_ID,         MetVMenu.CHILD_IME_MODULA,         MetVMenu.PARENT_ID,         MetVMenu.PARENT_IME_MODULA,         MetVMenu.ZST,         MetVMenu.NIVO,         MetVMenu.CHILD_NAZIV_V_MENIJU,         MetVMenu.CHILD_TIP_MODULA,         MetVMenu.CHILD_OPIS_MODULA FROM MET_V_MENU MetVMenu WHERE MetVMenu.PARENT_IME_MODULA like :menuRoot and MetVMenu.CHILD_IME_MODULA in (SELECT * FROM TABLE(CAST(:listOfUserPermission AS STRARRAY)))
    [91] ViewObject: [adfin2.menu.model.views.MetVMenuRoot]MetMenuAppModule.MetVMenuRoot1 Created new QUERY statement
    [92] Bind params for ViewObject: [adfin2.menu.model.views.MetVMenuRoot]MetMenuAppModule.MetVMenuRoot1
    [93] Binding null of type 12 for "menuRoot"
    [94] Binding null of type 12 for "listOfUserPermission"
    protected void executeQueryForCollection(Object object, Object[] object2, int i) {
            System.out.println("ExecuteQueryForCollectionRoot");
            setParametersForSessionTest(); // method where i set the parameters.
            printExecute(); // printing
            super.executeQueryForCollection(object, object2, i);
        }After a few clicks on OK button the query executes normally.
    What I am guessing is, that executeQueryForCollection just takes whatever is in object2 and that's null at the beginning.
    I tried to use this method, which sets the bind variables in object2. And it gives me "Invalid column type" error.
    http://packtlib.packtpub.com/library/9781849684767/ch04lvl1sec07

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

    Hi,
    I have writen PL/SQL packages for data loging through pipe lined function for better peformance.The below packages has been compiled sucessfully but during the run time it shows an error
    like "ORA-00932: inconsistent datatypes: expected - got -".
    CREATE OR REPLACE PACKAGE pkg_mkt_hub_load
    AS
         PROCEDURE sp_final_load_mkt_hub;
           FUNCTION fnc_pipe_tot_lvl_idx_mon_hub
        (pi_input_cur IN SYS_REFCURSOR)
       RETURN tot_lvl_idx_mon_tt
       PIPELINED;
    END pkg_mkt_hub_load;
    CREATE OR REPLACE PACKAGE BODY pkg_mkt_hub_load
    AS
      c_default_limit CONSTANT PLS_INTEGER:=5000;
      c_created_dt    CONSTANT DATE:=SYSDATE;
      c_created_user  CONSTANT VARCHAR2(20):='SYSTEM';
      c_updated_dt    CONSTANT DATE:=SYSDATE;
      c_updated_user  CONSTANT VARCHAR2(20):='SYSTEM';
      -- to get the debug desc for updating process log table
      vg_debug_log_desc mkt_process_log.debug_log_desc%TYPE;
      --to get process log key
      vg_process_log_ky mkt_process_log.process_log_ky%TYPE;
       -- reset the all variables.
      PROCEDURE sp_reset_global_variables;
      PROCEDURE sp_final_lvl_idx_mon_hub;
      --PROCEDURE sp_final_lvl_idx_dly_hub;
      FUNCTION fnc_pipe_tot_lvl_idx_mon_hub
        (pi_input_cur IN SYS_REFCURSOR)
       RETURN tot_lvl_idx_mon_tt
       PIPELINED
      AS
       vl_lvl_idx_mon_cur_data tot_lvl_idx_mon_tt;
       BEGIN
         LOOP
          FETCH pi_input_cur BULK COLLECT INTO vl_lvl_idx_mon_cur_data LIMIT c_default_limit;
          EXIT WHEN vl_lvl_idx_mon_cur_data.COUNT = 0;
          FOR i IN 1 .. vl_lvl_idx_mon_cur_data.COUNT
          LOOP
            PIPE ROW (tot_lvl_idx_mon_ot(vl_lvl_idx_mon_cur_data(i).SSIA_INDEX_ID,
            vl_lvl_idx_mon_cur_data(i).start_date,vl_lvl_idx_mon_cur_data(i).currency,
          vl_lvl_idx_mon_cur_data(i).level1,vl_lvl_idx_mon_cur_data(i).type,
          vl_lvl_idx_mon_cur_data(i).RETURN_MONTH,vl_lvl_idx_mon_cur_data(i).RETURN_3MONTHS,
          vl_lvl_idx_mon_cur_data(i).RETURN_6MONTHS,vl_lvl_idx_mon_cur_data(i).RETURN_YTD,
          vl_lvl_idx_mon_cur_data(i).RETURN_1YEAR,vl_lvl_idx_mon_cur_data(i).RETURN_3YEARS,
          vl_lvl_idx_mon_cur_data(i).RETURN_5YEARS,vl_lvl_idx_mon_cur_data(i).RETURN_10YEARS,
          vl_lvl_idx_mon_cur_data(i).MARKET_CAP));
          END LOOP;
          END LOOP;
          CLOSE pi_input_cur;
          RETURN;
       END fnc_pipe_tot_lvl_idx_mon_hub;     
       PROCEDURE sp_final_lvl_idx_mon_hub
       AS
       BEGIN
       MERGE INTO mkt_total_lvl_indx_mon_hub idxhub  
       USING TABLE(pkg_mkt_hub_load.fnc_pipe_tot_lvl_idx_mon_hub(CURSOR(SELECT idxmap.ssia_index_code,idxstg.start_date,idxstg.currency,idxstg.level1,idxstg.type,
           idxstg.return_month,idxstg.return_3months, idxstg.return_6months, idxstg.return_ytd, idxstg.return_1year,
           idxstg.return_3years, idxstg.return_5years,idxstg.return_10years,idxstg.market_cap
         FROM   mkt_total_lvl_indx_mon_stg idxstg,
                 md_vendor_index_map idxmap
         WHERE  idxmap.source = idxstg.source
                 AND idxmap.base_currency = idxstg.currency
                 AND idxmap.return_type = idxstg.TYPE
                 AND idxmap.mkt_index_id = idxstg.vendor_code
                 AND idxmap.monthly = 'Y'
                 AND idxmap.file_type = 'T'))) idxmonstg
         ON (idxhub.ssia_index_id=idxmonstg.ssia_index_id)
         WHEN MATCHED THEN
         UPDATE set effective_date=idxmonstg.start_date,
                      CURRENCY=idxmonstg.currency,
                      INDEX_LEVEL=idxmonstg.LEVEL1,
                      TYPE=idxmonstg.type,
                      return_month=idxmonstg.return_month,
                      return_3months=idxmonstg.return_3months,
                      return_6months=idxmonstg.return_6months,
                      return_ytd=idxmonstg.return_ytd,
                      return_1year=idxmonstg.return_1year,
                      return_3years=idxmonstg.return_3years,
                      return_5years=idxmonstg.return_5years,
                      return_10years=idxmonstg.return_10years,
                      market_cap=idxmonstg.market_cap,
                      updated_dt=SYSDATE,
                      updated_user='MICHAEL'
         WHEN NOT MATCHED THEN
          INSERT (  ssia_index_id,
                    effective_date,
                      currency,
                      INDEX_LEVEL,
                      TYPE,
                      return_month,
                      return_3months,
                      return_6months,
                      return_ytd,
                      return_1year,
                      return_3years,
                      return_5years,
                      return_10years,
                      market_cap,
                      created_dt,
                      created_user)
         VALUES(        idxmonstg.ssia_index_id,
                      idxmonstg.start_date,
                      idxmonstg.currency,
                      idxmonstg.LEVEL1,
                      idxmonstg.type,
                      idxmonstg.return_month,
                      idxmonstg.return_3months,
                      idxmonstg.return_6months,
                      idxmonstg.return_ytd,
                      idxmonstg.return_1year,
                      idxmonstg.return_3years,
                      idxmonstg.return_5years,
                      idxmonstg.return_10years,
                      idxmonstg.market_cap,
                   SYSDATE,
                   'MICHAEL');     
       END sp_final_lvl_idx_mon_hub;
       PROCEDURE sp_final_load_mkt_hub
       as
       BEGIN
        sp_final_lvl_idx_mon_hub;
       END sp_final_load_mkt_hub;
       PROCEDURE Sp_reset_global_variables
       AS
       BEGIN
       vg_debug_log_desc := NULL;
       END sp_reset_global_variables;      
    END pkg_mkt_hub_load;
    SHOW ERRORS  Error:
    ERROR at line 1:
    ORA-00932: inconsistent datatypes: expected - got -
    ORA-06512: at "GPAIHMKTDTA.PKG_MKT_HUB_LOAD", line 33
    ORA-06512: at "GPAIHMKTDTA.PKG_MKT_HUB_LOAD", line 55
    ORA-06512: at "GPAIHMKTDTA.PKG_MKT_HUB_LOAD", line 92
    ORA-06512: at line 1
    types scripts:
    create or replace type tot_lvl_idx_mon_ot as object
    (SSIA_INDEX_ID  VARCHAR2(60),
    start_date date,
    CURRENCY               VARCHAR2(10),
    LEVEL1                  NUMBER(31,11),
    TYPE                    VARCHAR2(31) ,
    RETURN_MONTH            NUMBER(31,11),
    RETURN_3MONTHS          NUMBER(31,11),
    RETURN_6MONTHS          NUMBER(31,11),
    RETURN_YTD              NUMBER(31,11),
    RETURN_1YEAR            NUMBER(31,11),
    RETURN_3YEARS           NUMBER(31,11),
    RETURN_5YEARS           NUMBER(31,11),
    RETURN_10YEARS          NUMBER(31,11),
    MARKET_CAP              NUMBER(31,11));
    create or replace type tot_lvl_idx_mon_tt is table of tot_lvl_idx_mon_ot;how to resolve this issue?

    >
    could you please pointed out whether ref cursor used method correct or not?
    >
    The use looks correct but without your tables and DDL we can't even try to reproduce the problem.
    Notice how you had to break down the process to find out the query that is causing the problem?
    select *
    from TABLE(pkg_mkt_hub_load.fnc_pipe_tot_lvl_idx_mon_hub(CURSOR(SELECT . . .Unfortunately, this is where you should have started when you began creating the process.
    You are trying to design, implement and debug a process using code that has 3,4, 5 or more layers and objects and tables that have a dozen or more columns.
    That is not the way I would recommend especially if you do not have experience with some of the pieces like object types and tables, pipelined functions and ref cursors. You are trying to deal with too many complications at the same time.
    Here is how I would approach this if I were you.
    1. Get the process to work first and then build on it. Start by copying and hacking up what you already have.
    2. Create a very simple version of each of the pieces
    3. Create an object type like 'tot_lvl_idx_mon_ot' with only one or two columns.
    4. Create an object type like 'tot_lvl_idx_mon_tt' as a table of that simple object type
    5. Create a pipelined function that uses the two new simple types, simply hard-codes a value for one or two rows and then pipes out the rows.
    6. Use a simple query like the last one you posted to query the simple pipelined function
    select *
    from TABLE(pkg_mkt_hub_load.simpe_pipeline_function(CURSOR(SELECT . . .Work on that simple set of objects until you have the process defined and working.
    Then expand the now working example to use get the data values dynamically and to use more complicated objects.
    Start with something simple that works. Then build on it.
    It will take a lot less time and will point out other issues with your approach to this. Also, if you try a simple version using the SCOTT emp or dept table and it doesn't work you can post the code and we can try to reproduce it and help find the problem.

Maybe you are looking for