SQL error: ORA-00932: inconsistent data types: expected - was -.

Hello
When I am tring to run under sql statement I ORA-00932.

Select extractvalue ("< rrr > 13 < /rrr > ',' / rrr'") twice;

How to extract this value?

Select extractvalue (XMLTYPE ('13'),'/ rrr') twice;

Tags: Database

Similar Questions

  • -Error ORA-00932: inconsistent data types: expected TANK got the NUMBER

    Here is my report query...
    select 
    *
    from   DW_RFA_JOBDATA
    where  FINISH_TIME >= :P1_START_DATE 
    and FINISH_TIME < :P1_END_DATE
         AND RFA_FLAG = (CASE :P1_JOB_CLASSIFICATION WHEN '0' THEN 'LSF'
                                      WHEN '1' THEN 'NON-LSF' 
                                      ELSE RFA_FLAG END)
    The column data type RFA_FLAG is NUMBER(*,0)... I'm view RSA and RSA - not the area of selection, but I get the error ORA-00932: inconsistent data types: expected TANK got the NUMBER >

    I have created a static LOV with LST display 0 return
    Display NON - RSA 1 return...

    Could any body please help me in truble shooting error? How to to convert the data type to number, I have no privileges to make changes to the table...

    Mark you my previous answer as correct? (MOST POINTS!  :))

  • ORA-00932: inconsistent data types: expected - was -.

    DECLARE
    STR VARCHAR2(2000):='<SerachVal>1234</SerachVal>';
    L_OUT VARCHAR2(1000);
    BEGIN
    SELECT EXTRACTVALUE(STR,'/SerachVal') INTO L_OUT FROM DUAL;
    DBMS_OUTPUT.PUT_LINE(L_OUT);
    END;
    
    
    error:
    
    PL/SQL: ORA-00932: inconsistent datatypes: expected - got -
    PL/SQL: SQL Statement ignored
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    SQL> set serverout on
    SQL> DECLARE
      STR   VARCHAR2(2000):='1234';
      L_OUT VARCHAR2(1000);
    BEGIN
      SELECT EXTRACTVALUE(XMLTYPE(STR),'/SerachVal') INTO L_OUT FROM DUAL;
      DBMS_OUTPUT.PUT_LINE(L_OUT);
    END;  2    3    4    5    6    7
      8  /
    1234
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    
  • ORA-00932: inconsistent data types: expected - got CURSER

    Hi all

    I created a function and tried to run SQL Plus, but I get an error

    ORA-00932: inconsistent data types: expected - got CURSER

    I tried to debug for centuries, but are unable to the root of what could be the problem. I'd appreciate any help or idea people could offer

    The only consolation I take from this is that Oracle have typo in one of their error messages :)



    SQL MORE CODE
    select * FROM TABLE(CAST(tsoraimpdb.QueryAuthorsFunc(116, 1, -1, 1, 0) as tsoraimpdb.ENTITYIDTABLE));
    THE FUNCTION CODE
    CREATE OR REPLACE FUNCTION &HKImpDB_Schema_Name..QueryAuthorsFunc 
    (
    aKGID NUMBER,
      aPageNumber NUMBER,              -- The page interested
      aPageSize NUMBER,                -- Number of records per page
      aOffset NUMBER,                  -- The offset = number of records already got
      aTotalRecord NUMBER          -- Total number of users in the database
    )
    RETURN sys_refcursor
    as
    l_FuncCur sys_refcursor;
    l_TotalRecord NUMBER(10) := aTotalRecord;
    l_Offset NUMBER(10) := aOffset;
    l_PagingTable TEMP_T_TABLE:= TEMP_T_TABLE();
    
    -- paging set up
    l_MinRecordsOnAPge NUMBER(10); --last record on the previous page
    l_MaxRecordsOnAPge NUMBER(10); --last record on the current page
    begin
    DBMS_OUTPUT.PUT_LINE('start');
    select KnowdePos(rownum,p.ID) bulk collect into l_PagingTable
      FROM KnowledgeGene kg
      INNER JOIN HKResource r ON kg.KGOwner = r.ID
      INNER JOIN Person p ON r.PersonID = p.ID
    WHERE kg.kgid = akgid
    ORDER BY p.FirstName + ' ' + p.LastName;
    
    l_TotalRecord := l_PagingTable.count; -- get total records
    DBMS_OUTPUT.PUT_LINE(  l_TotalRecord);
    
    if aPageSize > 0 then
      if aPageNumber <= 0 then
              Raise_application_error(-20003,'Invalid Page Number');
      else
          l_MinRecordsOnAPge := (aPageNumber-1)*aPageSize;
          l_MaxRecordsOnAPge := aPageNumber*aPageSize;
      end if;
    else -- if @PageSize < 0 return all records
        l_Offset := 0;
        l_MinRecordsOnAPge := 0;
        l_MaxRecordsOnAPge := l_TotalRecord;
    END if;
    
    -- return results for the correct page
    open l_FuncCur for
    SELECT pos
      from HKResource r
      INNER JOIN Person p ON r.PersonID = p.ID
      inner join TABLE(CAST(l_PagingTable AS TEMP_T_TABLE)) on pos = p.id
      WHERE KnowdeID > l_MinRecordsOnAPge - l_Offset AND KnowdeID <= l_MaxRecordsOnAPge - l_Offset;
    
    return l_FuncCur;
    EXCEPTION when NO_DATA_FOUND then null;
    end;

    You cannot get the ref cursor in a table like this. Either use a PL/SQL program to extract the lines of ref cursor and display them via dbms_output.put_line (or something) or load the results into a collection and then cast the collection in a table in your select statement.

  • ORA-00932: inconsistent data types: expected DATE receipt NUMBER to call OIC OCIStmtExecute OBIEE 11g

    Hi friends,

    I get this error: ORA-00932: inconsistent data types: expected DATE got the NUMBER to the call of the OIC OCIStmtExecute when I'm putting the filter on the date column condition.

    "Sun Time". " Day' < = cast (MAX ("Sun time" "." ")) Date day")) and"Sun Time ". "' Day ' > = TIMESTAMPADD (SQL_TSI_MONTH,-1, cast (MAX ("Sun time".) "Day") as date). "

    I sank the date max, but if I get the above error. I think max (date) creates the problem.

    Please suggest your opinion on that.

    Thank you.

    Thank you for your suggestions.

    I used the variable, and it helped.

    "Sun Time". " Date' <= valueof(maxdate)="" and="" "dim-time"."date"="">= TIMESTAMPADD (SQL_TSI_MONTH-1, VALUEOF (Maxdate))

  • ADF: ORA-00932: inconsistent data types: expected - got TANK

    I get this error while casting. ORA-00932: inconsistent data types: expected - got TANK
    I had departments such as front number... .but must be able to take over the alpha characters... so I changed my Bind Variables in my model: Array string (decimal Big)

    This is the error:

    where dept in (SELECT * FROM TABLE (CAST (: depts AS glc.))) NUMTABTYPE)))

    How can I solve this?... probably need to delete interpreters from here... .but how I it... any help is appreciated.

    I also Type:
    create or replace TYPE NUMTABTYPE in the TABLE to the number; (also I tried to change this option for create or replace TYPE NUMTABTYPE in the TABLE to the varchar2 (200);)

    I changed the table to a string and

    [oracle.jbo.domain.Number]"with java.lang.String to support also supports departments alpha characters... dept can be AB123 (string) or 3344 (number only)

    The entire query
    ============
    SELECT * FROM (SELECT
    NVL ("DEPT", "Grand Total") as DEPT,
    PERIOD_YEAR,
    In summary (round ("Jan real CDA")) 'real Jan CDA. "
    In summary (round ("Feb real CDA")) 'Feb CDA real. "
    In summary (round ("Mar real CDA")) 'Mar CDA real. "
    In summary (round ("Apr CDA")) real 'Real CDA Apr',
    In summary (round ("peut CDA")) real "can actual CDA."
    In summary (round ("Jun real CDA")) 'Jun CDA real. "
    sum (round ("Jul real CDA")) 'Real CDA Jul',
    In summary (round ('Aug real CDA")) 'Aug CDA real."
    In summary (round ("Ms real CDA")) 'Ms CDA real. "
    In summary (round ("Oct real CDA")) 'Oct CDA real. "
    In summary (round ("Nov real CDA")) 'real CDA Nov. "
    In summary (round ('Dec real CDA")) 'Dec CDA real."
    In summary (round ("Jan CDA Budget")) 'Budget of CDA Jan. "
    In summary (round ("Feb CDA Budget")) 'Feb CDA Budget. "
    In summary (round ("Mar CDA Budget")) 'Mar CDA Budget. "
    In summary (round ("Apr CDA Budget")) 'Apr CDA Budget. "
    In summary (round ("can CDA Budget")) 'Budget of CDA can. "
    In summary (round ("Jun CDA Budget")) 'Jun CDA Budget. "
    In summary (round ("Jul CDA Budget")) 'Jul CDA Budget. "
    In summary (round ("Aug CDA Budget")) 'Aug CDA Budget. "
    In summary (round ("Sep CDA Budget")) 'Ms CDA Budget. "
    In summary (round ("Oct CDA Budget")) 'Oct CDA Budget. "
    In summary (round ("Nov CDA Budget")) 'Nov CDA Budget. "
    In summary (round ("CDA Budget Dec")) 'Dec CDA Budget. "
    In summary (round ('Total Budget uncorrected')) "Annual_Budget."
    In summary (round ("Total Budget")) "Revised_BUDGET."
    sum (round ("real CDA")) "YTD_ACTUALS."
    In summary (round ("Jan Actual")) "Jan_ACTUAL."
    In summary (round ('Jan Budget')) "Jan_BUDGET."
    In summary (round ("Jan Actual")) "JanYTDACTUAL."
    In summary (round ('Jan Budget')) "JanYTDBUDGET."
    sum (round ("real Feb")) "Feb_ACTUAL."
    In summary (round ('Feb Budget')) "Feb_BUDGET."
    sum (round ("real Mar")) "Mar_ACTUAL."
    In summary (round ("Budget de Mar")) "Mar_BUDGET."
    sum (round ("real Apr")) "Apr_ACTUAL."
    In summary (round ("Apr Budget")) "Apr_BUDGET."
    In summary (round ("can real")) "May_ACTUAL."
    In summary (round ("Budget can")) "May_BUDGET."
    sum (round ("real Jun")) "Jun_ACTUAL."
    In summary (round ('Jun Budget')) "Jun_BUDGET."
    sum (round ("real Jul")) "Jul_ACTUAL."
    In summary (round ('Jul Budget')) "Jul_BUDGET."
    sum (round ("real Aug")) "Aug_ACTUAL."
    In summary (round ('Aug Budget')) "Aug_BUDGET."
    sum (round ("real Sep")) "Sep_ACTUAL."
    In summary (round ('Ms Budget')) "Sep_BUDGET."
    sum (round ("real Oct")) "Oct_ACTUAL."
    In summary (round ('Oct Budget')) "Oct_BUDGET."
    sum (round ("real Nov")) "Nov_ACTUAL."
    In summary (round ('Nov Budget')) "Nov_BUDGET."
    sum (round ("real Dec")) "Dec_ACTUAL."
    In summary (round ("Dec Budget")) "Dec_BUDGET."
    sum (round ("Jan Budget" + "Jan Budget Adj")) "Jan_Budget_Orig."
    sum (round ("Budget Feb" + "Feb Budget Adj")) "Feb_Budget_Orig."
    sum (round ("Mar Budget" + "Mar Budget Adj")) "Mar_Budget_Orig."
    sum (round ("Apr Budget" + "After Budget Adj")) "Apr_Budget_Orig."
    sum (round ("Budget can" + "Can Budget Adj")) "May_Budget_Orig."
    sum (round ("Jun Budget" + "Jun Budget Adj")) "Jun_Budget_Orig."
    sum (round ("Jul Budget" + "Jul Budget Adj")) "Jul_Budget_Orig."
    sum (round ("Aug Budget" + "August Budget Adj")) "Aug_Budget_Orig."
    sum (round ("Ms Budget" + "Ms Budget Adj")) "Sep_Budget_Orig."
    sum (round ("Oct Budget" + "Oct Budget Adj")) "Oct_Budget_Orig."
    sum (round ("Budget Nov" + "Nov Budget Adj")) "Nov_Budget_Orig."
    sum (round ('Dec Budget '' + '' Dec Budget Adj")) 'Dec_Budget_Orig '.
    GLC. GLC_BUDANAL_ACT_BUD_ADJ_VAR_V mainanal
    where dept in (SELECT * FROM TABLE (CAST (: depts AS glc.))) NUMTABTYPE))) and period_year =: year and substr ("OBJECT", 1, 3). =: excludeObject
    and mainanal. FERC not like 4% '
    Group by the Department, period_year) QRSLT ORDER BY DEPT

    As you say your table does not number but the strings. If you must change the table in an array of strings.

    Timo

  • Error ORA-00932: inconsistent data types

    Hello world

    I'm having a small problem with the error ORA-00932: inconsistent data types. The code below is what I'm working on. The error is on line 12:
    "vStmt: = ' select DDH_HOST_NM, DDH_SCHEMA_NR from ' | '. vSchema |'. < table > @ < DB_LINK > '; ». This is because DDH_HOST_NM is a VARCHAR2 and DDH_SCHEMA_NR a number.

    I know what is the error and where it is but I can't work on how to solve this problem. I tried to use to_char on DDH_SCHEMA_NR but that does not.

    Anyone have an idea how I can fix this problem?

    Thank you
    N.S.N.O.

    DECLARE
    vSchema varchar2 (1000);
    vStmt varchar2 (1000);
    Version number (38);
    CURSOR c_schemas IS
    Select "< SCHEMA-NAME >" as "< scheme name >" twice;
    BEGIN
    Open c_schemas;
    LOOP
    SEEK c_schemas INTO vSchema;
    EXIT WHEN c_schemas % NOTFOUND;
    vStmt: = ' select DDH_HOST_NM, DDH_SCHEMA_NR from ' | vSchema |'. < table > @ < DB_LINK > ';
    Run immediately vStmt in version;
    dbms_output.put_line(vSchema||) e '|| Version);
    END LOOP;
    CLOSE C_schemas;
    END;

    The problem is that you choose 2 columns in a single variable?

    vStmt: = ' select DDH_HOST_NM, DDH_SCHEMA_NR from ' | vSchema |'.

    @';
    Run immediately vStmt in version ;

    This must be either

    vStmt: = ' select DDH_SCHEMA_NR from ' | vSchema |'.

    @';
    Run immediately vStmt in version;

    or

    vStmt: = ' select DDH_HOST_NM, DDH_SCHEMA_NR from ' | vSchema |'.

    @';
    Run immediately vStmt in vHostNm, version;

    where vHostNm should set as a variable too.

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

    Hello
    in 10g R2:
    SQL> select count(*) from sysman.MGMT_METRICS_RAW;
    select count(*) from sysman.MGMT_METRICS_RAW
                                *
    ERROR at line 1:
    ORA-01578: ORACLE data block corrupted (file # 3, block # 27080)
    ORA-01110: data file 3: 'D:\BASE\DB\DATA\SYSAUX01.DBF'
    SQL> select * from sysman.MGMT_METRICS_RAW where rowid=27080;
    select * from sysman.MGMT_METRICS_RAW where rowid=27080
                                                     *
    ERROR at line 1:
    ORA-00932: inconsistent datatypes: expected - got NUMBER
    How to convert the rowid to be accepted in this query?
    Thank you

    This isn't the rowid. This is the block #.

  • ORA-00932: inconsistent data types: expected BLOB, CLOB had TANK

    Hello
    When exporting with the EXP utility, I have the following error:
    . exporting private type synonyms
    . exporting object type definitions
    . exporting system procedural objects and actions
    . exporting pre-schema procedural objects and actions
    . exporting cluster definitions
    EXP-00056: ORACLE error 932 encountered
    ORA-00932: inconsistent datatypes: expected BLOB, CLOB got CHAR
    My question is:
    what is the schema? Can there invalid objects by preventing him from EXP (see the Note 339938.1 on metalink).

    Thank you.

    A way perhaps to query dba_feature_usage_statistics that shows in use and query dba_registry features which also shows the features installed.

    HTH - Mark D Powell.

  • ORA-00932: inconsistent data types: expected DATE got the NUMBER

    SELECT DISTINCT NVL (jtf.NAME, 'No Sales Credit') NAME, ract.customer_trx_id,
                    ract.trx_number, ract.bill_to_customer_id,
                    NVL (ract.primary_salesrep_id, -3) primary_salesrep_id,
                    rac.customer_name custname,
                    /*xx_nyl_sa_order_type
                                           (NVL (ract.ship_to_site_use_id,
                                                 ract.bill_to_site_use_id
                                                ),
                                            DECODE (ract.ship_to_site_use_id,
                                                    NULL, 'B',
                                                    'S'
                                                   )
                                           ) S_TYPE,RACTL.INTERFACE_LINE_ATTRIBUTE2,*/
                    xx_nyl_cust_address
                                       (NVL (ract.ship_to_site_use_id,
                                             ract.bill_to_site_use_id
                                            ),
                                        DECODE (ract.ship_to_site_use_id,
                                                NULL, 'B',
                                                'S'
                                               )
                                       ) address,
                      NVL (ractl.extended_amount, 0)
                    * NVL (ract.exchange_rate, 1) itm_sales,
                      NVL (ractl.quantity_invoiced, 0)
                    + NVL (ractl.quantity_credited, 0) qty,
                    item_dtl.itemid itemid, item_dtl.itemno itemno,
                    item_dtl.segment2, item_dtl.segment3,
                    item_dtl.attribute7 attribute7,
                    item_dtl.attribute8 attribute8,
                    item_dtl.attribute12 attribute12, item_dtl.itemdesc itemdesc,
                    ractl.inventory_item_id invid,
                --ract.ship_to_site_use_id,
    --                ract.bill_to_site_use_id,
                                                  ractl.customer_trx_line_id
               FROM ra_customer_trx_all ract,
                    ra_customer_trx_lines_all ractl,
                    jtf_rs_salesreps jtf,
                    ra_customers rac,
                    ra_cust_trx_types_all ractt,
                    hr_all_organization_units hr,
                    (SELECT DISTINCT iim.item_id itemid,
                                     msi.inventory_item_id invid,
                                     iim.item_no itemno,
                                     stk_dtl.segment2 segment2,
                                     stk_dtl.segment3 segment3,
                                     iim.attribute7 attribute7,
                                     iim.attribute8 attribute8,
                                     iim.attribute12 attribute12,
                                     iim.item_desc1 itemdesc
                                FROM ic_item_mst iim,
                                     mtl_system_items_b msi,
                                     (SELECT mtl.segment2, mtl.segment3,
                                             gmi.item_id
                                        FROM mtl_categories_b mtl,
                                             fnd_id_flex_structures_vl fndi,
                                             gmi_item_categories gmi
                                       WHERE gmi.category_id = mtl.category_id
                                         AND fndi.id_flex_structure_name =
                                                                      'Item Group'
                                         AND fndi.id_flex_num = mtl.structure_id) stk_dtl
                               WHERE iim.item_no = msi.segment1
                                 AND stk_dtl.item_id = iim.item_id) item_dtl
              WHERE ract.customer_trx_id = ractl.customer_trx_id
                AND ractl.line_type = 'LINE'
                AND ract.cust_trx_type_id = ractt.cust_trx_type_id
                AND hr.organization_id = ractl.org_id
                AND JTF.ORG_ID = RACT.ORG_ID
    --       AND ractl.inventory_item_id = 8880
                AND item_dtl.invid = ractl.inventory_item_id
                AND ractt.default_status NOT LIKE 'VD'
                AND ractl.inventory_item_id IS NOT NULL
                AND jtf.salesrep_id(+) = ract.primary_salesrep_id
                AND rac.customer_id = ract.bill_to_customer_id
                AND NVL
                       (ractl.interface_line_attribute2,
                        NVL
                           (xx_nyl_sa_order_type
                                                (NVL (ract.ship_to_site_use_id,
                                                      ract.bill_to_site_use_id
                                                     ),
                                                 DECODE (ract.ship_to_site_use_id,
                                                         NULL, 'B',
                                                         'S'
                                                        )
                                                ),
                            'Order'
                           )
                       ) =
                       NVL
                          (:p_sales_type,
                           NVL
                              (ractl.interface_line_attribute2,
                               NVL
                                  (xx_nyl_sa_order_type
                                                (NVL (ract.ship_to_site_use_id,
                                                      ract.bill_to_site_use_id
                                                     ),
                                                 DECODE (ract.ship_to_site_use_id,
                                                         NULL, 'B',
                                                         'S'
                                                        )
                                                ),
                                   'Order'
                                  )
                              )
                          )
                AND NVL (jtf.NAME, 'No Sales Credit')
                       BETWEEN NVL (:p_salesmen_from,
                                    NVL (jtf.NAME, 'No Sales Credit')
                                   )
                           AND NVL (:p_salesmen_to,
                                    NVL (jtf.NAME, 'No Sales Credit')
                                   )
                AND rac.customer_name BETWEEN NVL (:p_customer_from,
                                                   rac.customer_name
                                                  )
                                          AND NVL (:p_customer_to,
                                                   rac.customer_name
                                                  )
                AND trunc(ract.trx_date) BETWEEN trunc(:p_year_from) AND trunc(:p_year_to)

    user9093700 wrote:

    TRUNC(ract.trx_date, 'YYYY') between :p_year_from and :p_year_to
    

    ORA-01843: not one month valid

    Well, you won't get definitive answers unless you provide the requested information.
    What type of p_year_from and data p_year_to?
    Guessing based on your last two answers, it is VARCHAR2, isn't it?
    Convert to date and compare:

    trunc(ract.trx_date) between to_date(:p_year_from,'DD/MM/YYYY') AND to_date(:p_year_to,'DD/MM/YYYY')
    

    That said, store dates as string is a major shortcoming. Consider to store and maintain dates in the form of dates.

  • ORA-00932: inconsistent data types: expected NUMBER obtained CURSER

    Hello

    I created a function that returns the cursor

    try to use the same report in

    Apex 4.2.3

    Select double hapx_details(:p5_brnach,:p5_remark)

    Help, please

    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 variable) Apex need to run to the region to report.

    Say you have a region that reports of departments (Department variable is zero) or employed in a service (Department non-null variable).

    You have a page element called P1_DEPT that specifies the Department.

    You create the function call following the report:

    () MyDynamicReport

    depatvalue =>: P1_DEPT,-value of variable in apex

    deptvariable-online "P1_DEPT" - the apex variable name

    );

    The function can now determine what is SQL and who will return to the Apex engine for processing:

    create or replace function MyDynamicReport (deptValue number, deptVar varchar2) return varchar2 is

    sqlQuery varchar2 (1000);

    Start

    If deptValue is null then

    -no service selected, so ask all the departments

    sqlQuery: = ' select * from dept by dept_id';

    on the other

    -service selected, so display employees in the Department

    -(and use the link provided in the SQL query variable)

    sqlQuery: = ' select * from emp where dept_id = :'|| deptVar | "order by emp_id;

    end if;

    return (sqlQuery);

    end;

    When you create a ref cursor, you pass the VALUE of the variable for the ref cursor to be used as a variable binding.

    With a dynamic query Apex, you must pass the NAME of the variable for the function to use and add in the text of the dynamic query.

    To using a function table of pipeline to do this, is rather silly.

  • ORA-00932: inconsistent data types: expected NUMBER INTERVAL

    How to overcome error mentioned topic for blowing the application


    Select b.corporationname, c.corporationname, a.nativeid as documentID, a.conversationid, a.doctimestamp,trunc(86400*(sysdate-a.doctimestamp)/60/60) BIZDOC hours, partner b, partner c where DOCTIMESTAMP < sysdate-1/24 and DOCTIMESTAMP > sysdate-3 and a.USERSTATUS = = b.partnerid 'Ramasasmy' and a.senderid and a.receiverid = c. partnerid order by hours desc



    Thank you
    REDA

    TIME will extract the hour of interval CURRENT_TIMESTAMP party - doctimestamp

    I agree that Solomon, if the INTERVAL given by CURRENT_TIMESTAMP - doctimestamp is greater than a day that it wouldn't work, thank you for the correction.

  • ORA-00932: inconsistent data types: expected NUMBER obtained DATE

    Hi all

    I have problem in the creation of report of the foregoing, it is can someone help me in this.

    Here is the code

    -------------------------

    Select ar_tab.account_number,

    ar_tab.party_name,

    ar_tab.trans_type,

    ar_tab.trans_type_name,

    ar_tab.invoice_currency_code,

    ar_tab.trx_num,

    ar_tab.trans_date,

    ar_tab.gl_date,

    ar_tab.due_date,

    (nvl (ar_tab.fcy_amt, 0) - nvl (ar_tab.ar_fcy_amt_due, 0)) outstanding_amount,.

    (case when trunc(:p_to_date) - trunc (ar_tab.trans_date) < = 0 then (ar_tab.inr_amt - ar_tab.ar_acctd_amt_due) end else 0) current_bal

    of (hca.account_number select account_number,)

    Party_name HP.party_name,

    CTA.customer_trx_id customer_trx_id,-, acl.name, collector_name

    Decode (ps.class,

    "INV', 'the Bill."

    "MD", "Débit Memo"

    "CM", "Credit memo")

    trans_type,

    rctt. Name trans_type_name,

    rctt.cust_trx_type_id cust_trx_type_id,

    CTA.invoice_currency_code invoice_currency_code,

    Hou.location_code location_code,

    PS.trx_number trx_num,

    PS.trx_date trans_date,

    PS.gl_date gl_date,

    PS.due_date end_date,

    PS.amount_due_original fcy_amt,

    round ((ps.amount_due_original * nvl (ps.exchange_rate, 1)), 2) inr_amt.

    PS.exchange_rate exchange_rate,

    PS.amount_due_remaining amount_due_remaining_fcy,

    PS.acctd_amount_due_remaining amount_remaining_inr,

    (select round (sum (nvl (a.amount_applied * nvl (ps.exchange_rate, 1), 0)), 2))

    of ar_receivable_applications_all one

    where a.applied_payment_schedule_id = ps.payment_schedule_id

    -a.APPLIED_CUSTOMER_TRX_ID = ps. CUSTOMER_TRX_ID

    and a.display = 'Y '.

    and trunc (a.gl_date) between: p_from_date and: p_to_date

    Group of a.applied_payment_schedule_id)

    ar_acctd_amt_due,

    (select round (sum (nvl (a.amount_applied, 0)), 2))

    of ar_receivable_applications_all one

    where a.applied_payment_schedule_id = ps.payment_schedule_id

    and a.display = 'Y '.

    and trunc (a.gl_date) between: p_from_date and: p_to_date

    Group of a.applied_payment_schedule_id)

    ar_fcy_amt_due

    of apps.ar_payment_schedules_all ps,.

    Apps.hz_cust_accounts AOB,

    HP apps.hz_parties,-, acl apps.ar_collectors

    Apps.ra_customer_trx_all cta,

    Apps.ra_cust_trx_types_all rctt,

    hr_organization_units_v hou

    where hca.cust_account_id = ps.customer_id

    and ps.customer_trx_id = cta.customer_trx_id

    and cta.cust_trx_type_id = rctt.cust_trx_type_id

    and ps.class <>"LMP".

    and hca.account_number = nvl (: p_cust_code, hca.account_number)

    and ps.class = nvl (: p_class, ps.class)

    and ps.class in ('INV', 'DM')

    and cta.invoice_currency_code <>'INR '.

    and hou.organization_id = cta.org_id

    and cta.org_id = nvl (: p_org_id, cta.org_id)

    and hp.party_id = hca.party_id

    and ps.invoice_currency_code <>'INR '.

    and rctt.org_id = cta.org_id

    and ps.amount_adjusted is null - added July 10, 2012

    and trunc (ps.gl_date) between nvl (: p_from_date, trunc (ps.gl_date))

    and nvl (: p_to_date, trunc (ps.gl_date))) ar_tab

    - AND AR_TAB. Amount_Remaining_INR <>0

    where (nvl (ar_tab.inr_amt, 0) - nvl (ar_tab.ar_acctd_amt_due, 0)) <>0

    OK well understood.

    But I asked you the query that you have changed as suggested by me.

    I guess you changed your query into a toad and copy then paste into the generator. So I want to check the query how you changed according to my suggestion.

    because, I've modified your request and took the new report and inserted, works very well.

  • Why I get this error? ORA-00932: inconsistent data types

    It's my stored procedure, I created to select only the exact amount of records per page to a GridView (for ASP.NET):
    CREATE OR REPLACE
    PROCEDURE SELECT_COMMAND
    (pTable IN VARCHAR2
    , pFields IN VARCHAR2
    , pSortField IN VARCHAR2
    , pPageIndex IN NUMBER
    , pTotalRecs IN NUMBER
    , pResultSet OUT SYS_REFCURSOR
    ) AS
    BEGIN  
      EXECUTE IMMEDIATE 
      'SELECT ' || pFields || ' FROM '
      || '(SELECT '|| pFields ||', ROW_NUMBER() OVER(ORDER BY '|| pSortField ||') ROW_NUM '
      || 'FROM '|| pTable ||') WHERE ROW_NUM BETWEEN '|| to_char(pPageIndex*pTotalRecs) ||' AND '
      || to_char((pPageIndex+1)*pTotalRecs)    
      INTO pResultSet;
      -- Plus 1 to our index because GridView is a zeroth index collection
    END SELECT_COMMAND;
    I then do a test case with the following parameters:
    declare
    p_test sys_refcursor;
    begin
    select_command('v_sig_devices', '"JOB", "LINE"', '"DEVICE_ID"', 0, 10, p_test);
    end;
    But I get the following error:

    >
    Error report: ORA-00932: inconsistent data types: expected - was -.
    ORA-06512: at the 'SIM '. SELECT_COMMAND', line 10
    ORA-06512: at line 4 level
    00932 00000 - ' incompatible data types: wait %s %s got. "
    >

    At first Oracle gave me an error because the figures were not a string. Can I convert it to a string (with to_char) and Oracle is still not satisfied! Any ideas as to why this is happening?

    Thanks for any help you can provide.

    Suppose you want sth. as

    ...
    OPEN pResultSet FOR 'SELECT ' || pFields || ' FROM '
      || '(SELECT '|| pFields ||', ROW_NUMBER() OVER(ORDER BY '|| pSortField ||') ROW_NUM '
      || 'FROM '|| pTable ||') WHERE ROW_NUM BETWEEN '|| to_char(pPageIndex*pTotalRecs) ||' AND '
      || to_char((pPageIndex+1)*pTotalRecs)  ;
    ...
    
  • Expression-matter ORA-00932: inconsistent data types

    I'm trying to use the following condition

    Select

    case

    When

    Count (exception.exception_number) > 1

    then 0

    on the other

    ENTITY_TYPE_DEF.NAME

    end name

    With the exception of the table, exception_number has a varchar2 data type. My requirement is such that if the number of exception number is greater than 1, it should show 0 (integer) and if not then see the name column of the entity_type_def table (varchar2).

    My query fails with the following error

    ERROR on line 7:

    ORA-00932: inconsistent data types: expected NUMBER obtained TANK

    Please could someone suggest a workaround solution for above question.

    Hello.

    For example,.

    Select

    case

    When

    Count (exception.exception_number) > 1

    then "0"

    on the other

    ENTITY_TYPE_DEF.NAME

    end name

Maybe you are looking for