Expected number got CURSER - error

Hi,
I've created a second function to populate the SQL Type with the ref cursor returned from the first function.
My first function is:
function getCapatTransa(pprefix varchar2, ptransa number, pid_lprodso number default null) return ref_cursor is
   tmp ref_cursor;
   error varchar2(1500);
begin
    open tmp for select osif_ni.getCapatTransa(pprefix, ptransa, pid_lprodso) from dual;
    return tmp;
    exception
      when others then
       error := substr(sqlerrm,1,1500);
         raise_application_error('-20100', 'Eroare! '||error);
end getCapatTransa;And the second function (and also the according type is):
create or replace type transe_type as object(cod varchar2(40))
create or replace type t_transe_type as table of transe_type;
create or replace function get_transe_numere(pprefix varchar2, ptransa number, pid_lprodso number default null)
    return t_transe_type is
      v_transe  t_transe_type := t_transe_type();  -- Declare a local table structure and initialize it
      v_cnt     number := 0;
      v_rc      sys_refcursor;
      v_cod     varchar2(40);
   begin
     v_rc := osapi_ni.getCapatTransa(pprefix, ptransa, pid_lprodso);
     loop
       fetch v_rc into v_cod;
       exit when v_rc%NOTFOUND;
       v_transe.extend;
       v_cnt := v_cnt + 1;
       v_transe(v_cnt) := transe_type(v_cod);
     end loop;
     close v_rc;
     return v_transe;
  end;
  /When i try to call this second function, i got the error:
SQL>  select * from table(get_Transe_numere('0268',34334,24454354));
select * from table(get_Transe_numere('0268',34334,24454354))
ORA-00932: inconsistent datatypes: expected NUMBER got CURSER
ORA-06512: at "INFO.GET_TRANSE_NUMERE", line 10
ORA-06512: at line 1But i don't know why. Please help, tell me what's wrong, i can't understand.
Thanks

Hello
From what I can see you have two functions named getCapatTransa, one in osapi_ni and the other in osif_ni, but to my mind, uless they differ by return type i.e. osif_ni.getCapatTransa does not return a cursor type, you are opening a cursor that contains a cursor - so when you fetch you are fetching a cursor.
Note that I've changed the name of one of the functions rather than create the separate schemas.
SQL> create or replace function getCapatTransb(pprefix varchar2, ptransa number, pid_lprodso number default null) return sys_refcursor i
  2     tmp sys_refcursor;
  3     error varchar2(1500);
  4   begin
  5      open tmp for select pprefix as prefix, ptransa as transa, pid_lprodso as lprodso from dual;
  6      return tmp;
  7      exception
  8        when others then
  9         error := substr(sqlerrm,1,1500);
10           raise_application_error('-20100', 'Eroare! '||error);
11  end getCapatTransb;
12  /
Function created.
Elapsed: 00:00:00.10
SQL> create or replace function getCapatTransa(pprefix varchar2, ptransa number, pid_lprodso number default null) return sys_refcursor i
  2     tmp sys_refcursor;
  3     error varchar2(1500);
  4   begin
  5      open tmp for select getCapatTransb(pprefix, ptransa, pid_lprodso) from dual;
  6      return tmp;
  7      exception
  8        when others then
  9         error := substr(sqlerrm,1,1500);
10           raise_application_error('-20100', 'Eroare! '||error);
11  end getCapatTransa;
12  /
Function created.
Elapsed: 00:00:00.03
SQL> create or replace type transe_type as object(cod varchar2(40))
  2  /
Type created.
Elapsed: 00:00:00.15
SQL> create or replace type t_transe_type as table of transe_type
  2  /
Type created.
Elapsed: 00:00:00.01
SQL> create or replace function get_transe_numere(pprefix varchar2, ptransa number, pid_lprodso number default null)
  2      return t_transe_type is
  3        v_transe  t_transe_type := t_transe_type();  -- Declare a local table structure and initialize it
  4        v_cnt     number := 0;
  5        v_rc      sys_refcursor;
  6        v_cod     varchar2(40);
  7     begin
  8       v_rc := getCapatTransa(pprefix, ptransa, pid_lprodso);
  9       loop
10         fetch v_rc into v_cod;
11         exit when v_rc%NOTFOUND;
12         v_transe.extend;
13         v_cnt := v_cnt + 1;
14         v_transe(v_cnt) := transe_type(v_cod);
15       end loop;
16       close v_rc;
17       return v_transe;
18    end;
19    /
Function created.
Elapsed: 00:00:00.03
SQL> select * from table(get_Transe_numere('0268',34334,24454354));
select * from table(get_Transe_numere('0268',34334,24454354))
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected NUMBER got CURSER
ORA-06512: at "JJACOB_APP.GET_TRANSE_NUMERE", line 10
ORA-06512: at line 1So you would need to either change this to be
create or replace function get_transe_numere(pprefix varchar2, ptransa number, pid_lprodso number default null)
    return t_transe_type is
      v_transe  t_transe_type := t_transe_type();  -- Declare a local table structure and initialize it
      v_cnt     number := 0;
      v_rc      sys_refcursor;
      v_cod     varchar2(40);
   begin
     v_rc := getCapatTransa(pprefix, ptransa, pid_lprodso);
     loop
       fetch v_rc into v_cod;
       exit when v_rc%NOTFOUND;
       v_transe.extend;
       v_cnt := v_cnt + 1;
       v_transe(v_cnt) := transe_type(v_cod);
     end loop;
     close v_rc;
     return v_transe;
  end;
  / Or you would need to modify the loop in the table function to deal with the nested cursor.
HTH
David

Similar Messages

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

  • Expected NUMBER got CURSER - wierd

    Hi guys,
    Using oracle express 10.2.
    Im getting very strange behavior when trying to retorn a recordset from a function.
    If i run the following in sqldeveloper it returns the 3 colums in a single column like this
    rstest
    {<1=1,2=2,3=3>,}
    if i run it in the web interface it returns
    ORA-00932: inconsistent datatypes: expected NUMBER got CURSER
    type cur_type is ref cursor;
    function rsTest return cur_type;
    FUNCTION rstest
    RETURN cur_type
    IS
    rs cur_type;
    BEGIN
    OPEN rs FOR SELECT 1,2,3 FROM dual;
    RETURN rs;
    END rstest;
    select rstest from dual;
    any ideas, im really stuck.
    thanks

    Let me explain,
    The function you are using returns a CURSOR which is embeded in a column, the only way you can read the cursor is by fetching its value and looping it.
    This function you have is ment to return cursor(which is not a data type like NUMBER or VARCHAR), the calling environment has to fetch it and iterate it to understand the data received.
    SQL Loader is just formating the vlaue in that way so its readable for you. :)

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

    hi
    i have created a function returning cursor
    and trying to use the same for report in
    apex 4.2.3
    select hapx_details(:p5_brnach,:p5_remark) from dual
    please help
    function is ;;;
    create or replace function hapx_details
    brcode in d009022.lbrcode%type,
    lheading in varchar2)
    return sys_refcursor
    is
    x_cursor   sys_refcursor;
    vquery varchar2(1000);
    begin
       if upper(trim(lheading))='TERMDEPOSITS' THEN
       vquery:='select lbrcode,t_cust(lbrcode,prdacctid) custno,short_acno(prdacctid) acno,ACNAME(LBRCODE,PRDACCTID) NAME,t_ost_new(lbrcode,prdacctid,SYSDATE) bal from dep_mast where lbrcode=brcode';
       elsif upper(trim(lheading))='ADVANCES' THEN
       VQUERY:='SELECT LBRCODE,CUSTNO,SHORT_ACNO(LBRCODE,PRDACCTID)ACNO,NAMETITLE,LONGNAME NAME ,t_ost_new(lbrcode,prdacctid,SYSDATE) bal FROM ac_mast WHERE LBRCODE=BRCODE AND (LBRCODE,TRIM(SUBSTR(PRDACCTID,1,8))) IN (SELECT LBRCODE,TRIM(PRDCD) FROM D009021 WHERE MODULETYPE IN (13,14,30)) AND ACCTSTAT<>3';
       ELSE
       VQUERY:='SELECT LBRCODE,CUSTNO,SHORT_ACNO(LBRCODE,PRDACCTID)ACNO,NAMETITLE,LONGNAME NAME,t_ost_new(lbrcode,prdacctid,SYSDATE) bal FROM ac_mast WHERE LBRCODE=BRCODE AND (LBRCODE,TRIM(SUBSTR(PRDACCTID,1,8))) IN (SELECT LBRCODE,TRIM(PRDCD) FROM D009021 WHERE MODULETYPE IN (11,12)) AND ACCTSTAT<>3';
       END IF;
       OPEN X_CURSOR FOR
       VQUERY;
       RETURN X_CURSOR;
    END HAPX_DETAILS;

    The proper way is to define a function that returns the SQL statement (with bind variables) that Apex need to execute for the report region.
    Let's say you have a region that reports either on departments (department variable is null)or employees in a department (department variable not null).
    You have a page item call P1_DEPT that specifies the department.
    You create the following function call for the report:
    MyDynamicReport(
      depatvalue => :P1_DEPT,  -- value of apex variable
      deptvariable => 'P1_DEPT' -- name of apex variable
    The function can now determine what the SQL is and return that to the Apex engine for processing:
    create or replace function MyDynamicReport( deptValue number, deptVar varchar2 ) return varchar2 is
      sqlQuery varchar2(1000);
    begin
      if deptValue is null then
         -- no department selected, so query all departments
        sqlQuery := 'select * from dept order by dept_id';
      else
         -- department selected, so display employees in department
         -- (and use the supplied bind variable in the SQL query)
        sqlQuery := 'select * from emp where dept_id = :'||deptVar||' order by emp_id';
      end if;
      return( sqlQuery );
    end;
    When creating a ref cursor, you pass the VALUE of the variable for the ref cursor to use as a bind variable.
    With an Apex dynamic query, you need to pass the NAME of the variable for the function to use and add into the dynamic query text.
    Using a pipeline table function instead for this, is idiotic.

  • Ora-00932 "expected number got -"... error comes and goes

    We have several procedures in a package which get called by an asp.net application. The procedures return a sys_refcursor as an out param, by going OPEN param FOR big complicated query. There are about seven procedures which encapsulate different queries. Sometimes, this package seems to just get into a bad mood.
    The symptom is, every time the application calls one of the procedures, it gets back the error "ORA-00932: inconsistent datatypes: expected NUMBER got -", with the line number being the beginning of the "OPEN param FOR" statement. But then, if I open SQL Developer and fiddle around with the package, the error goes away... like, sometimes if I manually invoke one of the procedures in script form from the SQL Developer window, it returns successfully there, and then for the rest of the day the application works fine. Then on some other day the app starts getting the error again. Recompiling the package also sometimes changes the state between erroring and working.
    I don't see how the error message can be a real error if these changing circumstances allow the procedure to work sometimes but not other times with the same data. I also don't understand what "got -" is supposed to mean. I'm scared about what will happen if we ship something behaving this way. Any clues out there as to what is going on?

    I have identified a possible workaround. There's an inner subquery that goes something like this:
    SELECT fields FROM ( subquery_a UNION ALL subquery_b ) LEFT OUTER JOIN table_c ON (condition)
    This in turn gets outer-joined to another subquery. Anyway, when I rewrite this subquery so there's no inside UNION ALL, the error goes away.
    At least in a simplified case.
    [edit] It looks like I have to avoid outer Union Alls as well.
    [edit] And CONNECT_BY_ROOT.
    [edit] And if I don't join one less-essential table. These three conditions actually each lead to three separate errors, any one of which will stop ODP.Net in its tracks though the query runs fine in sql plus or sqldeveloper. Using CONNECT_BY_ROOT causes the "expected NUMBER got -" error (even though the field I'm using it on is varchar2), the UNION ALL causes the internal error, and the harmful join causes a "end-of-file on communication channel". I can cause each of these independently of the other two, and I need three separate workarounds to get my product running!
    I am starting to conclude that ODP.Net, which I was ordered to use because it's so much better than the Microsoft driver, is a sack o sewage.
    Message was edited by:
    pointy
    Message was edited by:
    pointy

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

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

  • 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 NUMBER got LONG

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

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

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

    Hello,
    I get this error:
    ORA-00932: inconsistent datatypes: expected NUMBER got LABEL
    During an export of a rather large database. I've seen some threads that are similar to this issue but never one relating to doing a table export to .dmp file.
    Can anyone help me understand it?

    Forgot to mention...
    9.2.0.4 Database
    9.2.0.6 Clusterware for RAC

  • 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

  • Expected Number got LONG

    Hi,
    When I give the below query at SQL prompt. Iam getting an error "*ORA-00932: inconsistent datatypes: expected NUMBER got LONG*".
    SqlExport=`sqlplus -s username/password@databasename << EOF
    spool test1.txt;
    set linesize 1000;
    set PAGESIZE 0 space 0 feedback off echo off verify off heading off;
    set termout off trimspool on;
    SELECT column1,column2,column3,column4,....................column14 FROM table WHERE cond1,cond2;
    exit sql.sqlcode;
    commit;
    spool off;
    EXIT;
    EOF`
    My guess is in the above query column4 contains large data. so the Sqlexport variable is not able to hold that many records. Please let me know If Iam wrong and please let me know solution for this.

    You may have a problem with the large size of the result - but only once you have managed to create it. The ORA-00932 shows you have raised an exception within your SQL call, so something has gone wrong there. You can prove this by changing your shell script to:
    sqlplus -s username/password@databasename << EOF
      spool test1.txt;
      set linesize 1000;
      set PAGESIZE 0 space 0 feedback off echo off verify off heading off;
      set termout off trimspool on;
      SELECT column1,column2,column3,column4,....................column14
      FROM table
      WHERE cond1,cond2;  -- what are these conditions exactly?
      exit sql.sqlcode;
      commit;            -- no need for this, you never started a transaction
      spool off;
    EXIT;
    EOF
    result=$?
    if [ $result -eq 0 ]
    then
        Sqlexport=`cat test1.txt`
    else
        echo "ERROR ...."
    fiWhat are the WHERE conditions exactly? Are you comparing a LONG with a NUMBER (or with any other datatype)?
    HTH
    Regards Nigel

  • Database error -ora-00932: inconsistent datatypes: expected number got date

    The above error is generated on our new 11g OAS when we execute a specific workbook with a calculation with a case statement. The case statement is displayed below.
    The error does not occur on our 10g OAS. Any ideas as to the cause/solution?
    CASE WHEN Organization.Department IN ('1028','1023') THEN Organization."Specific Departments Desc" ELSE Organization."Department Desc" END
    Thanks,
    Jerre

    Pl identify exact version of Discoverer and OS versions, along with how you know this statement is generating this error. Pl see if you can enable a trace to find the cause of the error
    How To Find Oracle Discoverer Diagnostic and Tracing Guides (Doc ID 290658.1)
    http://download.oracle.com/docs/cd/E12839_01/bi.1111/b40107/logging_diagnostics.htm
    HTH
    Srini

Maybe you are looking for

  • STO Stock not going to receive

    Dear All, I have raised STO, created delivery and done PGI.   Now stock is in Transit whcih can be tracked sing MB5T. Due to accident this stock is not going to receive by receving plant.  How to handle this situtation as the stock will always shows

  • Remove Black Border Around Embedded Flash Video

    Hi- I have searched on the Web without luck, so again I have to turn tot he forum for help. I believe this should be simple and straightforward, but doesn't appear so. I have a simple little Flash video embedded in a plain old web page created with D

  • When upgrading the software my screen locked with image music connector with lights flashing how do I get out of this?

    I have a new latest apple tv.  I was asked do I want a software upgrade, when I said yes, after 5 minutes the screen locked with an image of a connector cable with music. I pulled the power, the hdmi and reconnected and it went back to the image on t

  • Can't start kwakd service in systemd

    Does anyone have kwakd running on systemd? I tried everything I could think of, but the result is always the same: $ 0.restart kwakd Job for kwakd.service failed. See 'systemctl status kwakd.service' and 'journalctl -n' for details. $ systemctl statu

  • IPhone strange reset when in e-mail client

    Since the update for the iPhone 2 weeks ago, the iPhone has a strage reset when I am deleting or sending e-mail. The screen goes black, and within 10 seconds or so it goes to Home. When I go back into mail, all the e-mails I deleted reappear, while e