Function issue:  inconsistent datatypes?

Hi all.
I'm having an issue with a function that converts coordinates to a spatial data type.
My database version is:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
PL/SQL Release 11.2.0.2.0 - Production
CORE     11.2.0.2.0     Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
Here's my package that I'm using
create or replace package make_geometry
as
            function get_geometry_from_coords (p_coords in clob  )
          return sdo_geometry;
end;
create or replace package body make_geometry
as
          function get_geometry_from_coords (p_coords in clob)
          return sdo_geometry
          is
             v_geometry sdo_geometry;
          begin
             --with t as (select p_coords coords from dual)
          select MDSYS.SDO_GEOMETRY(2003,8307,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1)
                              ,cast(multiset(
                                  select ordset
                                 from (
                                        select regexp_substr( regexp_replace(
                                                                            replace(p_coords,chr(10))
                                                                             ,' {1,}',',')
                                                              ,'[^,]+',1,level)  ordset
                                              ,rownum rn
                                          from dual
                                                           connect by level <= length(regexp_replace(regexp_replace(
                                                                                               replace(p_coords,chr(10))
                                                                                               ,' {1,}',','),'[^,]+')) + 1
                                        where mod(rn,3) <> 0
                    ) as sdo_ordinate_array))
              into v_geometry
              from dual;
              return v_geometry;
          end;
end;
/basically, it takes a list of coordinates, in the following format:
with t as (select '130.88214073599997,-12.377589935499998,0 130.88189276799997,-12.378437734999997,0 130.88164895999998,-12.379271400499997,0 ' coords from dual)replaces the spaces with commas and splits the resultant string by comma, then removes the third coordinate in each set (sets delimited by spaces in above example) and converts the result to sdo_geometry type.
This logic is not where my problem is occurring
If I run the query found in the package separately, it works fine:
SQL> with t as (select '130.88214073599997,-12.377589935499998,0 130.88189276799997,-12.378437734999997,0 130.88164895999998,
-12.379271400499997,0 ' coords from dual)
  2            select MDSYS.SDO_GEOMETRY(2003,8307,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1)
  3                                ,cast(multiset(
  4                                    select ordset
  5                                   from (
  6                                          select regexp_substr( regexp_replace(
  7                                                                              replace(coords,chr(10))
  8                                                                               ,' {1,}',',')
  9                                                                ,'[^,]+',1,level)  ordset
10                                                ,rownum rn
11                                            from t
12                                                             connect by level <= length(regexp_replace(regexp_replace(
13                                                                                                 replace(coords,chr(10))
14                                                                                                 ,' {1,}',','),'[^,]+')) +
1
15                                                               )
16                                          where mod(rn,3) <> 0
17                      ) as sdo_ordinate_array))
18                from dual;
MDSYS.SDO_GEOMETRY(2003,8307,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),CAST(MULTISET(SELECTORDSETFROM(SELECTREGEXP_SUBSTR(REGE
XP_REPL
SDO_GEOMETRY(2003, 8307, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARRAY(130.882141, -12.37759, 130.881893, -12.378
438, 13
0.881649, -12.379271, NULL))but if I call the function:
SQL> with t as (select '130.88214073599997,-12.377589935499998,0 130.88189276799997,-12.378
-12.379271400499997,0 ' coords from dual)
  2  select make_geometry.get_geometry_from_coords(coords)
  3    from t;
select make_geometry.get_geometry_from_coords(coords)
ERROR at line 2:
ORA-00932: inconsistent datatypes: expected NUMBER got CLOB
ORA-06512: at "HR.MAKE_GEOMETRY", line 13If I change the package to expect varchar2 the above example coordinate list works fine, but obviously that doesn't work when the coordinate list exceeds 4000 characters.
any thoughts?

not sure that is the problem:
SQL> create table foo (mr_clob clob);
Table created.
SQL>
SQL> insert into foo values ('testing'||chr(10)||'testing');
1 row created.
SQL>
SQL> select replace(mr_clob,chr(10),'blah') from foo;
REPLACE(MR_CLOB,CHR(10),'BLAH')
testingblahtesting
1 row selected.

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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Inconsistent datatypes: expected NUMBER got CHAR error

    Hi,
    I have the following table
    create GLOBAL TEMPORARY TABLE br_total_rtn_data_tmp
    code varchar(50)     NOT NULL,
    name                         varchar(255),     
    cum_ytd_rtn_amt          varchar(255),     
    cum_one_mon_rtn_amt          varchar(255)     ,
    cum_thr_mon_rtn_amt          varchar(255)     ,
    cum_six_mon_rtn_amt          varchar(255),
    cum_nine_mon_rtn_amt     varchar(255),
    cum_one_yr_rtn_amt          varchar(255),
    cum_thr_yr_rtn_amt          varchar(255),
    cum_five_yr_rtn_amt          varchar(255),
    cum_ten_yr_rtn_amt          varchar(255),
    cum_lof_rtn_amt               varchar(255),
    avg_anl_one_yr_rtn_amt     varchar(255),
    avg_anl_thr_yr_rtn_amt     varchar(255),
    avg_anl_five_yr_rtn_amt     varchar(255),
    avg_anl_ten_yr_rtn_amt     varchar(255),
    avg_anl_lof_rtn_amt          varchar(255),
    cum_prev_1m_month_end     varchar(255),
    cum_prev_2m_month_end     varchar(255)
    )ON COMMIT PRESERVE ROWS;
    I have a case statement
    CASE
                 WHEN code = 'MDN' THEN
                           max(case when p.m_date = v_prev2_yr_mon and p.period_type = '1M' then p.mdn /100  else null end)
                 WHEN code = 'QRT' THEN
                      max(case when p.m_date = v_prev2_yr_mon and p.period_type = '1M' then p.quartile  else null end)
                 WHEN code = 'PCT' THEN
                      max(case when p.m_date = v_prev2_yr_mon and p.period_type = '1M' then p.pct_beaten / 100 else null end)
                 WHEN code = 'RNK' THEN
                           case when (p.m_date = v_prev2_yr_mon and p.period_type = '1M'  and p.rank is  null and p.cnt is null)
                        THEN
                                       P.RANK
                        else
                                        p.rank||'/'||p.cnt
                        end           
                 ELSE NULL
                 END CASE The output for code = RNK should be somewhat like 3/5 which is rank/count
    but i get the error "Inconsistent datatypes: expected NUMBER got CHAR error" when i put p.rank||'/'||p.cnt
    How can that be solved.
    ORacle version is 10g.

    Taken from the documentation of the CASE expression:
    "For a simple CASE expression, the expr and all comparison_expr values must either have the same datatype (CHAR, VARCHAR2, NCHAR, or NVARCHAR2, NUMBER, BINARY_FLOAT, or BINARY_DOUBLE) or must all have a numeric datatype. If all expressions have a numeric datatype, then Oracle determines the argument with the highest numeric precedence, implicitly converts the remaining arguments to that datatype, and returns that datatype.
    For both simple and searched CASE expressions, all of the return_exprs must either have the same datatype (CHAR, VARCHAR2, NCHAR, or NVARCHAR2, NUMBER, BINARY_FLOAT, or BINARY_DOUBLE) or must all have a numeric datatype. If all return expressions have a numeric datatype, then Oracle determines the argument with the highest numeric precedence, implicitly converts the remaining arguments to that datatype, and returns that datatype."
    You need to use the same data type for all your expressions. If you want to return a string, then you need to convert the remaining numbers explicitly to strings. E.g. you could try something like this:
    CASE
                 WHEN code = 'MDN' THEN
                           to_char(max(case when p.m_date = v_prev2_yr_mon and p.period_type = '1M' then p.mdn /100  else null end), 'TM')
                 WHEN code = 'QRT' THEN
                      to_char(max(case when p.m_date = v_prev2_yr_mon and p.period_type = '1M' then p.quartile  else null end), 'TM')
                 WHEN code = 'PCT' THEN
                      to_char(max(case when p.m_date = v_prev2_yr_mon and p.period_type = '1M' then p.pct_beaten / 100 else null end), 'TM')
                 WHEN code = 'RNK' THEN
                           case when (p.m_date = v_prev2_yr_mon and p.period_type = '1M'  and p.rank is  null and p.cnt is null)
                        THEN
                                       to_char(P.RANK, 'TM')
                        else
                                        p.rank||'/'||p.cnt
                        end           
                 ELSE NULL
                 END CASE I see another potential issue, you're mixing aggregate functions with non-aggregate expressions, this can only work if these non-aggregate expressions are part of the group by clause, but you haven't posted the complete statement so I can only guess.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle:
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

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

  • 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

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

  • Decode Function issue

    Hi all,
    i want compare two rows in a table. so i used decode function to compare the values, whether its matched or not.
    One of my table column has Long data type.
    Decode(a.col1,b.col1,'Match','NotMatch')
    col1 - is long data type.
    when i use long data type, i got below error,
    is there anyway to rectify this error.
    SQL Error: ORA-00932: inconsistent datatypes: expected NUMBER got LONG
    00932. 00000 - "inconsistent datatypes: expected %s got %s"
    Thanks in advance.
    Regards,
    Santhosh

    >
    You can't use ANY function on a LONG column. This restriction is not limited to DECODE.
    >
    Not quite correct.
    You can use TO_LOB on a LONG column but only in the select list of a subquery in an INSERT statement.
    See TO_LOB in the SQL Language doc
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions205.htm#SQLRF06134
    >
    TO_LOB converts LONG or LONG RAW values in the column long_column to LOB values. You can apply this function only to a LONG or LONG RAW column, and only in the select list of a subquery in an INSERT statement.
    Before using this function, you must create a LOB column to receive the converted LONG values. To convert LONG values, create a CLOB column. To convert LONG RAW values, create a BLOB column.
    You cannot use the TO_LOB function to convert a LONG column to a LOB column in the subquery of a CREATE TABLE ... AS SELECT statement if you are creating an index-organized table. Instead, create the index-organized table without the LONG column, and then use the TO_LOB function in an INSERT ... AS SELECT statement.
    You cannot use this function within a PL/SQL package. Instead use the TO_CLOB or TO_BLOB functions.

  • 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

  • Inconsistent datatypes:expected - got - error in handling xml

    hi i am getting the error Error(45,12): PL/SQL: ORA-00932: inconsistent datatypes: expected - got - in this procedure
    i tried a lot and landed in confused state..
    create or replace
    PROCEDURE BT_CPE_XML_READ1 IS
    dest_clob CLOB;
    src_clob BFILE := BFILENAME('DOC_PATH', 'tester.xml');
    dst_offset number := 1 ;
    src_offset number := 1 ;
    lang_ctx number := DBMS_LOB.DEFAULT_LANG_CTX;
    warning number;
    ex number;
    v_cast xmltype;
    v_varchar varchar2(32767);
    BEGIN
    DBMS_LOB.CREATETEMPORARY(dest_clob,true);
    ex := dbms_lob.fileexists(src_clob);
    if ex = 1 then
    INSERT INTO test_clob(id, file_name, XML_FILE_COLUMN, timestamp)
    VALUES(1001, 'test.xml', empty_clob(), sysdate)
    RETURNING XML_FILE_COLUMN INTO dest_clob;
    DBMS_LOB.OPEN(src_clob, DBMS_LOB.LOB_READONLY);
    DBMS_LOB.LoadCLOBFromFile(
    DEST_LOB => dest_clob
    , SRC_BFILE => src_clob
    , AMOUNT => DBMS_LOB.GETLENGTH(src_clob)
    , DEST_OFFSET => dst_offset
    , SRC_OFFSET => src_offset
    , BFILE_CSID => DBMS_LOB.DEFAULT_CSID
    , LANG_CONTEXT => lang_ctx
    , WARNING => warning
    DBMS_OUTPUT.ENABLE(100000);
    DBMS_LOB.CLOSE(src_clob);
    COMMIT;
    DBMS_OUTPUT.PUT_LINE('Loaded XML File using DBMS_LOB.LoadCLOBFromFile: (ID=1001).');
    v_cast :=xmltype(dest_clob);
    --dbms_output.put_line(v_cast);
    select extractvalue(XML_FILE_COLUMN,'/modifyProductPortfolioRequest/ns1:stateCode') from test_clob;
    end if;
    END BT_CPE_XML_READ1;
    is there any other way to get the value(xml)from the clob column of a table

    I see two issues off a quick eye-ball of the code<br><br>
    #1) You insert an empty clob into your table, load a local variable with the XML from disk, and then query the table. You never insert the XML into the table so you are querying on an empty column in the table.<br><br>
    #2) extractValue allows a third parm which is the namespace string. Since your XPath contains ns1: you'll need to use the third parm

  • Inconsistent datatypes: expected - got -

    hi i am getting the error Error(45,12): PL/SQL: ORA-00932: inconsistent datatypes: expected - got - in this procedure
    i tried a lot and landed in confused state..
    create or replace
    PROCEDURE BT_CPE_XML_READ1 IS
    dest_clob CLOB;
    src_clob BFILE := BFILENAME('DOC_PATH', 'tester.xml');
    dst_offset number := 1 ;
    src_offset number := 1 ;
    lang_ctx number := DBMS_LOB.DEFAULT_LANG_CTX;
    warning number;
    ex number;
    v_cast xmltype;
    v_varchar varchar2(32767);
    BEGIN
    DBMS_LOB.CREATETEMPORARY(dest_clob,true);
    ex := dbms_lob.fileexists(src_clob);
    if ex = 1 then
    INSERT INTO test_clob(id, file_name, XML_FILE_COLUMN, timestamp)
    VALUES(1001, 'test.xml', empty_clob(), sysdate)
    RETURNING XML_FILE_COLUMN INTO dest_clob;
    DBMS_LOB.OPEN(src_clob, DBMS_LOB.LOB_READONLY);
    DBMS_LOB.LoadCLOBFromFile(
    DEST_LOB => dest_clob
    , SRC_BFILE => src_clob
    , AMOUNT => DBMS_LOB.GETLENGTH(src_clob)
    , DEST_OFFSET => dst_offset
    , SRC_OFFSET => src_offset
    , BFILE_CSID => DBMS_LOB.DEFAULT_CSID
    , LANG_CONTEXT => lang_ctx
    , WARNING => warning
    DBMS_OUTPUT.ENABLE(100000);
    DBMS_LOB.CLOSE(src_clob);
    COMMIT;
    DBMS_OUTPUT.PUT_LINE('Loaded XML File using DBMS_LOB.LoadCLOBFromFile: (ID=1001).');
    v_cast :=xmltype(dest_clob);
    --dbms_output.put_line(v_cast);
    select extractvalue(XML_FILE_COLUMN,'/modifyProductPortfolioRequest/ns1:stateCode') from test_clob;
    end if;
    END BT_CPE_XML_READ1;
    is there any other way to get the value(xml)from the clob column of a table

    I see two issues off a quick eye-ball of the code<br><br>
    #1) You insert an empty clob into your table, load a local variable with the XML from disk, and then query the table. You never insert the XML into the table so you are querying on an empty column in the table.<br><br>
    #2) extractValue allows a third parm which is the namespace string. Since your XPath contains ns1: you'll need to use the third parm

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

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

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

  • Inconsistent datatypes: expected - got CLOB (Urgent!!)

    Hi All,
    I am getting this error " inconsistent datatypes: expected - got CLOB" for a region based upon a SQL query. The base table contains a CLOB field but that is empty.
    Also, something strange is happening. This error comes for some users and doesn't come for some others. There is no authorization scheme on the page or on the region or on the column.
    I am using HTML DB 1.5.
    I don't know what am i missing. But, any help will be highly appreciated. It is quite urgent.
    Thanks in advance
    Monika

    I have something more to add to this issue.
    The CLOB field has been marked as a "Sortable" column. I think, this is creating problem as Oracle doesn't allow to sort on LOBs.
    But, again the behaviour here is not consistent. For some combinations of Sortable columns, there is no error and for some others error comes. Also, the CLOB column position in report attributes is affecting the behaviour.
    Does anybody have any idea on this unexpected behaviour.
    Thanks
    Monika

Maybe you are looking for

  • Can't print from my laptop to network printer HP CP1515n

    Hi, in our office we have a HP CP1515n printer on the network set to a static ip. Everyone but me can print on it so I guess the printer is set up correctly. Even I was able to print on it till a couple of weeks ago. I don't remmember changing anythi

  • Sharing only users cannot connect to Lion Server

    Dear all, I stumbled across a funny problem, that I tried to resolve all day. I just wanted to add a sharing only user for my girlfriends new MacBook that she could use to connect to a shared Time Machine Volume. If I add a new standard user, this us

  • Image Capture over a network

    Hi All Seeing there's no discussion page for Image Capture I thought this would be the next best place to ask. I can't seem to save directly to my NSA drive using Image Capture. Am I missing something or is this correct. Thanks In Advance Tim

  • How to make client application

    hi.... help me...^ ^ how to make client application(not standalone..) I seached bea document.. but I can't it. if someone have sample(.ear or .jar), I hope you it share...

  • CL_BTF - Again

    hi guys is anybody out there who used this editor already; i'm wondering why CL_BTF (which implement IF_BTF) is realized as a single-Ton class; is there a restriction on the text framework or can this be avoided by implementing the BTF-Framework on m