-Error function of incompatible data types

Hi all

I created a function that will take 3 IN parameters and return the result in type. Here's the code.

Created a table type:

{code}

CREATE OR REPLACE TYPE FEATURES_ROW_TYPE

AS AN OBJECT

(VARCHAR2 (100) OF THE ENVIRONMENT)

MNR VARCHAR2 (100),

GUID VARCHAR2 (100),

USER_ID VARCHAR2 (1000).

RGN VARCHAR2 (100),

RGN_NM VARCHAR2 (5000).

FEATURE_NAME VARCHAR2 (5000).

DATE OF LAST_SIGON_DATE

);

CREATE OR REPLACE TYPE FEATURES_TABLE_TYPE

AS THE FEATURES_ROW_TYPE TABLE;

{code}

Here's the function:

{code}

CREATE OR REPLACE FUNCTION FETCH_FEATURES_FN (P_ENVIRONMENT IN VARCHAR2,

P_FEATURE_ID NUMBER,

P_RGN IN VARCHAR2

)

RETURN FEATURES_TABLE_TYPE

IS

V_ROWS FEATURES_TABLE_TYPE: = FEATURES_TABLE_TYPE ();

V_CUR_ENV VARCHAR2 (100);

V_ENV VARCHAR2 (50);

V_WHERE VARCHAR2 (1000);

V_SQL VARCHAR2 (10000);

BEGIN

V_ENV: = '@DBL_ ' | P_ENVIRONMENT;

V_CUR_ENV: = P_ENVIRONMENT;

IF P_RGN = "ALL" THEN

V_WHERE: = ' WHERE FD. WPP_FTR_IK = ' | P_FEATURE_ID;

ON THE OTHER

V_WHERE: = ' WHERE FD. WPP_FTR_IK = ' | P_FEATURE_ID | "AND FD. RGN = ' | '''' || P_RGN | '''';

END IF;

V_SQL: =.

"WITH USER_DATA ' | ' ' ||

"ACE" | ' ' ||

' (SELECT DISTINCT EB. GUID, AD. USER_ID_ACCT_AFFECTED AS USER_ID, MAX (TRANSACTION_TS) AS LAST_SIGNON_DATE ' | ' ' ||

"TO WPP_EBIZ_ACCT" | V_ENV | '  EB'                                                                || ' ' ||

"INNER JOIN WPP_SECURITY_AUDIT_LOG | V_ENV | ' AD'                                                   || ' ' ||

' ON EB. GUID = AD. USER_UNIQUE_ID_ACCT_AFFECTED ' | ' ' ||

' WHERE AD. APP_NAME = "consumer" AND AD. TRANSACTION_TYPE_CD = "SIGN_ON" AND AD. FEATURE_NAME = "sign" AND AD. TRANSACTION_RESULT_CD = "S" ' | ' ' ||

' GROUP BY EB. GUID, AD. USER_ID_ACCT_AFFECTED ' | ' ' ||

'), ' || ' ' ||

"FEATURE_DATA" | ' ' ||

'AS '           || ' ' ||

"(MY SEPARATE SELECT." MNR, EB. GUID, MY. RGN, RGN. RGN_NM, FTR. WPP_FTR_IK, FTR. NM AS FEATURES_SUPPORTED ' | ' ' ||

"TO WPP_MBRSHP_ACCT" | V_ENV | "MY" | ' ' ||

"INNER JOIN WPP_EBIZ_ACCT | V_ENV | ' EB WE MY. WPP_EBIZ_ACCT_IK = EB. WPP_EBIZ_ACCT_IK' | ' ' ||

"INNER JOIN WPP_RGN | V_ENV | «RGN WE MY.» RGN = RGN. RGN_ID ' | ' ' ||

"INNER JOIN WPP_RGN_APLCTN_STS | V_ENV | ' RGN_ST ON RGN_ST. RGN_ID = RGN. RGN_ID ' | ' ' ||

"INNER JOIN WPP_FTR_APLCTN | V_ENV | ' FTR_APP ON FTR_APP. WPP_FTR_APLCTN_IK = FTR_APP. WPP_FTR_APLCTN_IK ' | ' '||

"INNER JOIN WPP_FTR | V_ENV | "FTR ON FTR. WPP_FTR_IK = RDFS. WPP_FTR_IK' | ' ' ||

') ' || ' ' ||

"SELECT DISTINCT"HINT1"LIKE ENVIRONMENT, | ' ' ||

"FD. MNR, FD. GUID, UD. USER_ID, FD. RGN, FD. RGN_NM, FD. FEATURES_SUPPORTED ACE FEATURE_NAME, TO_DATE (TRUNC (UD. LAST_SIGNON_DATE)) AS LAST_SIGNON_DATE' | ' ' ||

"FROM FEATURE_DATA INNER JOIN USER_DATA UD ON FD FD. GUID = UD. GUID ' | ' ' || V_WHERE;

-DBMS_OUTPUT. PUT_LINE (V_SQL);

RUN IMMEDIATELY V_SQL

BULK COLLECT INTO V_ROWS;

RETURN V_ROWS;

END FETCH_FEATURES_FN;

{code}

When I tried to run as below.

SELECT * FROM TABLE (FETCH_FEATURES_FN ('HINT1', 2, 'ALL'));

but I get the error message

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

ORA-06512: at "KPGCPY. FETCH_FEATURES_FN', line 57

00932 00000 - ' incompatible data types: wait %s %s got. "

* Cause:

* Action:

Please guide to solve this problem.

Thank you

So after running actual query:

-DBMS_OUTPUT. PUT_LINE (V_SQL);

You said the line that will do.

Firstly - I suggest replace this long, complex query with a VERY SIMPLE one until your code actually works.

When you do this, you will see that the TYPE that you defined (FEATURES_ROW_TYPE) is NOT mentioned anywhere in your code.

You need create instances of this TYPE, then a collection of these instances.

Some EXAMPLES of code that shows what I mean by VERY SIMPLE and shows how interrogate instances of a TYPE in a collection

-type to match record emp

create or replace type emp_scalar_type as an object

(EMPNO NUMBER 4,

ENAME VARCHAR2 (10),

USE VARCHAR2 (9).

MGR NUMBER 4,

HIREDATE DATE,

NUMBER OF SAL (7, 2)

NUMBER OF COMM (7, 2)

DEPTNO NUMBER (2)

)

/

-records of the emp table

create or replace type emp_table_type to table of emp_scalar_type

/

declare

TB emp_table_type;

sys deptnoList. OdciNumberList;

BEGIN

Select emp_scalar_type (empno, ename, job, mgr, hiredate, sal, comm, deptno)

bulk collect into tb emp;

Collect SELECT deptno in bulk

IN deptnoList

DEPARTMENT where deptno not in (select deptno table (tb));

I'm looping 1.deptnoList.count

dbms_output.put_Line (deptnoList (i));

end loop;

END;

40

Try this code and work with it until you understand what makes each piece.

Select emp_scalar_type (empno, ename, job, mgr, hiredate, sal, comm, deptno)

bulk collect into tb emp;

See how this SIMPLE query creates instances of the EMP_SCALAR_TYPE and then use COLLECT in BULK to put them in the collection?

Modify your code to use a SIMPLE QUERY like in my example, until you get the code to work.

Tags: Database

Similar Questions

  • incompatible data types: expected NUMBER got LONG

    Version 3.2.20.09

    Hello

    I use SQL Developer and want to see trigger body using as a function but unfortunately its data type is long so that I get the error message, is there a way by which I can see the bodies of trigger...

    Example query

    TRIGGER_BODY

    SELECT TRIGGER_BODY FROM user_triggers

    WHERE TRIGGER_BODY LIKE '% HEAR. "

    Error

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

    00932 00000 - ' incompatible data types: wait %s %s got. "

    * Cause:

    * Action:

    Error on line: column 2: 7

    This isn't a matter of SQL Developer.  Access quick, but partial, the answer is that the display of a LONG column in SQL * more / developer SQL can be done by issuing just one

    1000 long - value (or some other, more)

    You are referencing a LONG in a WHERE clause, however, is absolutely forbidden as I know.  Maybe something new (System invisible columns generated in LONG columns in the data mirrored dictionary?) are available in 12 c, but disapproval of LONG was announced in Oracle 8 in favour of the LOBs.

    Anyway, if you do not want to ask this question in the forum of PL/SQL, see solution code of Laurent Schneider in this old debate...

    Search long data type in the column

  • Incompatible data type problem in the ADF

    Hello

    I'm new to ADF. I'm writing a logic in the implementation of the entity class.
    The logic contains below two lines.

    Integer itemQty = row.getQuantity ();
    Number Qty = (Number) (itemQty);

    However when compiling, error comes which says 'incompatible data types' that is the integer and the number are not compatible.
    Please let me how can know I convert an integer in Number type.

    Thank you
    Anuj
    Integer  itemQty = row.getQuantity();
    oracle.jbo.domain.Number n= null;
        try
        {
          n = new oracle.jbo.domain.Number(itemQty);
        }
        catch (SQLException e)
        {
          //handle the exception here.
        }  
    

    But why do you need to cast to oracle.jbo.domain.Number?

  • incompatible data types: expected - got CHAR, variable connection see detail

    Hello.
    Here's my problem:
    I have connected with a link master detail views. Variable binding that contain both have some session information views:
    It is a menu on the database and I'm trying to hide certain values based on the permissions of the user.
    When you run the application module, everything works fine. The problem occurs when I try to display the menu as a picture of the tree, or any other table, on a page.
    The root view runs correctly, but then I get a
    "java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent data types: expected - got TANK.
    error in the method executeQueryForCollection of the detail view. (this method is overridden)

    Bind Variables are:
    -: menuRoot-> that contains the value of the root node. (In the Details view, it is just a dummy variable. It is explained later why I used it.)
    -: listOfUserPermmission-> permissions of the user table.

    My query looks like this:

    1 Master View:
    SELECT MetVMenu.CHILD_ID, 
           MetVMenu.CHILD_IME_MODULA, 
           MetVMenu.PARENT_ID, 
           MetVMenu.PARENT_IME_MODULA, 
           MetVMenu.ZST, 
           MetVMenu.NIVO, 
           MetVMenu.CHILD_NAZIV_V_MENIJU, 
           MetVMenu.CHILD_TIP_MODULA, 
           MetVMenu.CHILD_OPIS_MODULA
    FROM MET_V_MENU MetVMenu
    WHERE MetVMenu.PARENT_IME_MODULA like :menuRoot
    and MetVMenu.CHILD_IME_MODULA in (SELECT * FROM TABLE(CAST(:listOfUserPermission AS STRARRAY)))
    CHILD_IME_MODULA and PARENT_IME_MODULA are also names of permissions.

    2. see link that connects the master. CHILD_ID and detail PARENT_ID

    3 detail view, then linking to itself... to get the tree menu.
    SELECT MetVMenu.CHILD_ID, 
           MetVMenu.CHILD_IME_MODULA, 
           MetVMenu.PARENT_ID, 
           MetVMenu.PARENT_IME_MODULA, 
           MetVMenu.ZST, 
           MetVMenu.NIVO, 
           MetVMenu.CHILD_NAZIV_V_MENIJU, 
           MetVMenu.CHILD_TIP_MODULA, 
           MetVMenu.CHILD_OPIS_MODULA
    FROM MET_V_MENU MetVMenu
    WHERE :menuRoot like 'a'
    and
    MetVMenu.CHILD_IME_MODULA in (SELECT * FROM TABLE(CAST(:listOfUserPermission AS STRARRAY)))
    4 ViewLink, which connects CHILD_ID and PARENT_ID from this point of view 'detail '.

    Two views executeQuery methods are overridden to define Bind variables before execution.
    I get an arrayList of strings (permissions) of session and then convert it to a table.

    ArrayList permmissionsArray = (ArrayList)MyUserSession.getSessionValue("permissions");
         Array permissions = new Array(permissionsArray.toArray());
            HashMap context = new HashMap();
            context.put(DomainContext.ELEMENT_SQL_NAME, "STRARRAY");
            context.put(DomainContext.ELEMENT_TYPE, String.class);
            
            if(permissions != null){
                permissions.setContext(null, null, context);
                setlistOfUserPermission(permissions);
            }
         //Here I set menuRoot variable.
         
    I also noticed that there are problems with how define bind variables (issues).
    So when I did use the variable menuRoot in Details view I had the
    ' incompatible data types: expected - got TANK.
    error in the module of the application.

    prepareRowSetForQuery() has solved the problem for me. The binding variable is null and that was the reason for the error incompatible data type.
    Regarding the error of the tree-> it was a mistake in the definition of the cardinality.

  • -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!  :))

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

  • From a function table: invalid data type error

    Hello

    I'm a ORA-00902: invalid data type error when I try to call the function from a select statement below. Here, I am leaving an array from a function.
    create or replace package pkg10
    as
    
    type tabletype1 is table of table1%rowtype
    index by binary_integer;
    
    function func1 return tabletype1;
    
    end pkg10;
    create or replace package body pkg10
    as
    
    function func1 return tabletype1 
    is
        v_tab1 tabletype1;
        idx integer;
    begin 
    
        idx := 1;
        
        for i in (select * from table1)
        loop
            v_tab1(idx).name1 := i.name1;
            v_tab1(idx).key := i.key;
            idx := idx+1;
            
        end loop;
    
    return v_tab1; 
    
    end func1; 
    
    end pkg10;
    select * from table(pkg10.func1);
    Please point out to me where I'm wrong.

    Thank you

    Sathya Vamsi says:
    Hello

    I'm a ORA-00902: invalid data type error when I try to call the function from a select statement below. Here, I am leaving an array from a function.

    create or replace package pkg10
    as
    
    type tabletype1 is table of table1%rowtype
    index by binary_integer;
    
    function func1 return tabletype1;
    
    end pkg10;
    
    create or replace package body pkg10
    as
    
    function func1 return tabletype1
    is
    v_tab1 tabletype1;
    idx integer;
    begin 
    
    idx := 1;
    
    for i in (select * from table1)
    loop
    v_tab1(idx).name1 := i.name1;
    v_tab1(idx).key := i.key;
    idx := idx+1;
    
    end loop;
    
    return v_tab1; 
    
    end func1; 
    
    end pkg10;
    
    select * from table(pkg10.func1);
    

    Please point out to me where I'm wrong.

    Thank you

    you try to use a data type of PL/SQL as part of an SQL statement. is NOT authorized.

  • cfgrid / cfgridupdate error with an invalid data type

    I have a problem using cfgrid controls.

    I get the following error message:
    "Error casting an object of type by an incompatible type. This usually indicates an error in programming in Java, although it could also mean that you tried to use a foreign object in a different way, that it was designed. »

    The error occurs when I run this code:

    < IsDefined ("form.gridEntered") cfif >
    < cfgridupdate grid = "FirstGrid" dataSource = "" #dsn # "Keyonly ="true"tableName ="tblManager">"
    < / cfif >

    It connects to a mySQL 4.1 database.

    I think that the problem is to do with a field, I added called 'Active' of the INT data type (1). I use that as a Boolean value as far as I know, is the nearest equivalent in mySQL.

    In my < cfgrid > I've added the next column.

    < cfgridcolumn name = 'Active' type = 'boolean' display = "Yes" width = "40" header = "On" "BOLD" = "true" / >

    That shows a box and that's the look I want to reach on the grid.
    I think that this causes Java error. What should I do to allow the submission to the grid of this type of data, please?

    Thank you for your time and your help.

    To answer my own question on that...
    cfgridupdate wasn't working so I wrote a regular block of code to make the necessary changes when you submit a grid.

  • incompatible data type

    Hi iam new on oracle plsql,.

    I have small precision please help me in this.


    CREATE or REPLACE TYPE emp_type2 AS OBJECT

    (empno NUMBER (4));

    CREATE OR REPLACE TYPE T_EMP_TYPE AS TABLE EMP_TYPE2;

    CREATE OR REPLACE PROCEDURE test12 (pout on t_emp_type)

    AS

    BEGIN

    -Emp_type2 (e.empno) SELECT COLLECT LOOSE pout OF emp e; - updated successfully

    Emp_type2 (e.EMPNO) SELECT INTO emp e pout; - getting error below

    END;

    =====================================================================================

    • Error (6.1): PL/SQL: statement ignored
    • Error (6,8): PL/SQL: ORA-00932: inconsistent data types: waiting for the TEST. EMP_TYPE2's TEST. T_EMP_TYPE

    =====================================================================================

    Please explain to me why this statement error SELECT emp_type2 (e.EMPNO) INTO pout of emp e;

    Thank you

    RAMU.

    -Emp_type2 (e.empno) SELECT COLLECT LOOSE pout OF emp e; - updated successfully

    Emp_type2 (e.EMPNO) SELECT INTO emp e pout; - getting error below


    The TYPE is the data type that can contain multiple lines.

    So by the way of multiple lines between two TYPES of needs COLLECT LOOSE (here IN won't work, INTO used to Exchange simple rows)

    That's why your 1st statement is t is successful. and the statement with INTO is a failure.

  • Problem with the incompatible data type

    Hi all

    I wrote this query and trying to run it and got the following error.

    I got this error when I add column.if description I do not add the description column query works fine. _

    Attempted to solve by other means but did not work.

    Please help on this.

    SELECT the description, product, /*Defect.Product*/
    TO_CHAR (BG_DETECTION_DATE, 'yyyy') year,
    TO_CHAR (BG_DETECTION_DATE, 'Q'). ' Q'Quarter
    BUG
    where service_type as "Incident".
    and produced in ("Siebel", "Intg_Mgmt", "SOA", "NICE", "Genesys", "DW Analytics")
    AND DETECTION_DATE
    BETWEEN TO_DATE('01-01-2009','MM-DD-YYYY')
    AND TO_DATE (OCTOBER 30, 2010 ","DD-MM-YYYY")

    Group of to_char(bg_detection_date,'yyyy'), to_char(bg_detection_date,'Q'),
    product, description

    order by product, year desc, asc quarter


    error: ORA-00932: given inconsistent type.expected get clob_

    Try to replace every occurrence of "description" by 'dbms_lob.substr (description, 100, 1)' in your query, for example.

    It of OK if you want to show how only and group using the first 100 characters of the column "description".

  • Error with the default data type

    Hello

    My source and target both oracle tables, but on the other physical schema. The target tables are created based on the source and therefore the accuracy are defined according to the source columns. The precision of the number type of is not defined in my source and when I turn the tide in ODI his supports length 22 of the default precision. So, I created my target precisely 22 and run my mapping. I use LKM SQL for Oracle, then IKM SQL control.

    The mapping will fail with the following error:

    1438: 22003: java.sql.BatchUpdateException: ORA-01438: value larger than the precision specified for the column
    1438: 22003: java.sql.SQLDataException: ORA-01438: value larger than the precision specified for the column

    java.sql.BatchUpdateException: ORA-01438: value larger than the precision specified for the column

    at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:629)
    at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:9409)
    at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:211)
    at com.sunopsis.sql.SnpsQuery.executeBatch (SnpsQuery.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execCollOrders (SnpSessTaskSql.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt (SnpSessTaskSql.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt (SnpSessTaskSqlC.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask (SnpSessTaskSql.java)
    at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep (SnpSessStep.java)
    at com.sunopsis.dwg.dbobj.SnpSession.treatSession (SnpSession.java)
    at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand (DwgCommandSession.java)
    at com.sunopsis.dwg.cmd.DwgCommandBase.execute (DwgCommandBase.java)
    at com.sunopsis.dwg.cmd.e.j (e.java)
    at com.sunopsis.dwg.cmd.g.z (g.java)
    at com.sunopsis.dwg.cmd.e.run (e.java)
    at java.lang.Thread.run(Thread.java:619)

    I have 2 questions about it:
    (1) how do I know which column data greater than the specified precision available? (I tried to get the column name in the table SNP_SESS_TXT_LOG in the repository of work but don't know if it contains the information I was looking for)
    (2) how can I change the default precision for the type of data number from 22 to 38 (max value)?

    Receive your answer.

    Thank you!

    According to the 423858.1, it of the problem with the JDBC driver that reverse engineers and takes the default as 22. To work around the problem, you will need to use Oracle RKM to customize boning them

  • looping on a function with a data type of registration statement

    I have:
    create or replace package abc_type
        as
          type noncurtyp is record
          (
          
            cod       varchar2 (40)
          );
     
         type noncurtyp_cur is ref cursor;
       end abc_type;
      
     
    Package created.
     
    
     create or replace function demo return abc_type.noncurtyp
        is
          result1    abc_type.noncurtyp_cur;
          sql_stmt   varchar2 (4000);
          typ        abc_type.noncurtyp;
        begin
          sql_stmt := 'select ''x'' from dual';
         open result1 for sql_stmt;
         fetch result1 into typ;
         return typ;
       end demo;
    Now how can I loop in order to get that 'x '?
    declare
     t1 abc_type.noncurtyp ;
    begin
      select demo into t1 from dual;
      for i in t1.first .. t1.last Loop
        dbms_output.put_line(t1(i).cod);
      end loop;
    end;
     
    ORA-06550: line 5, column 10:
    PLS-00382: expression is of wrong type
    ORA-06550: line 6, column 15:
    PLS-00302: component 'FIRST' must be declared
    ORA-06550: line 6, column 3:
    PL/SQL: Statement ignored

    Do you really need the extra layer where GET_EMP_CUR name is getCapatTransa2? If it isn't

    SQL> ed
    Wrote file afiedt.buf
    
      1  declare
      2      l_coll abc_type.varchar2_tbl;
      3    begin
      4      l_coll := get_emp_collection(getcapattransa2);
      5      for i in l_coll.first .. l_coll.last
      6      loop
      7        dbms_output.put_line( l_coll(i) );
      8     end loop;
      9* end;
    SQL> /
    aaaa
    asdasd
    x
    
    PL/SQL procedure successfully completed.
    

    If you do not need the extra layer

    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace function get_emp_cur return sys_refcursor
      2  is
      3    l_cur sys_refcursor;
      4  begin
      5    l_cur := getcapattransa2;
      6    return l_cur;
      7* end;
    SQL> /
    
    Function created.
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  declare
      2      l_coll abc_type.varchar2_tbl;
      3    begin
      4      l_coll := get_emp_collection(get_emp_cur);
      5      for i in l_coll.first .. l_coll.last
      6      loop
      7        dbms_output.put_line( l_coll(i) );
      8     end loop;
      9* end;
    SQL> /
    aaaa
    asdasd
    x
    
    PL/SQL procedure successfully completed.
    

    Justin

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

  • Error: PL/SQL ORA - 00932 data type incompatible when using the value of LONG type

    Hello:

    I use a PL/SQL job script where I use a value of type LONG in a cursor. When I run it, I get:

    Incompatible data type of PL/SQL ORA-00932: expected NUMBER got LONG
    set serveroutput ON SIZE 1000000
    set heading off                
    set feedback off                
    set trimspool off               
    set echo off 
    set term off                   
    set pagesize 0         
    
    SPOOL &so_outfile;
    
    
    
    
    DECLARE
      v_data_file          varchar2(30);
     --   v_sch_code            varchar2(10);
     --   v_instance_name       varchar2(10);
        ws_path            payroll.pybutfl.pybutfl_utl_file_path%TYPE; 
        v_data_line           VARCHAR2 (2000)                              := NULL;
        fhandle_o             UTL_FILE.file_type;
        v_line_count          NUMBER                                       := 0;
        v_selected_count      NUMBER                                       := 0;
        v_error_count         NUMBER                                       := 0;
        v_written_count       NUMBER                                       := 0;
        v_error_text          VARCHAR2 (50)       := ' AMACONF_ERR: Unable to write the line. ';
        v_errm                VARCHAR2 (255);
        v_sqlerrm             VARCHAR2 (255);
        v_payment_type        VARCHAR2(10);
    
    
    CURSOR C1 IS
    select RTRIM
          ( 
            AMRCONF_PIDM_ERR            ||'|'||
            AMRCONF_IDEN_CODE_ERR       ||'|'||
            AMRCONF_ENTRY_DATE_ERR      ||'|'||
            AMRCONF_CONFID_IND_ERR      ||'|'||
           *AMRCONF_COMMENT_ERR        ||'|'||*
            AMRSUBJ_SUBJ_CODE_ERR       ||'|'||
            ERROR_CODE                  ||'|'||
            ERROR_CODE_TEXT                 ) data_line
            from WSUALUMNI.AMRCONF_ERR;
    
    
    
    BEGIN
    
    
    DBMS_OUTPUT.put_line ('Program Generating AMACOMT Mass Update Error File ');
    IF UTL_FILE.is_open (fhandle_o)
        THEN   
       UTL_FILE.fclose (fhandle_o);
    END IF;
    
    /* Name The File Here */
    v_data_file := ('Amaconf_error.txt');
    
    
    
    SELECT RTRIM (pybutfl_utl_file_path)
          INTO ws_path
          FROM payroll.pybutfl;
          
          fhandle_o := UTL_FILE.fopen (ws_path, v_data_file, 'w');
          DBMS_OUTPUT.put_line ('UTLFILE file for this run is: ' || ws_path||'/'||v_data_file);
          v_written_count := 0;   
    
    FOR c1_rec IN C1 LOOP
          BEGIN
            v_selected_count := v_selected_count + 1;
            v_data_line := rtrim(c1_rec.data_line);
            UTL_FILE.put_line (fhandle_o, v_data_line);
            v_written_count := v_written_count + 1;
        EXCEPTION
         WHEN OTHERS
          THEN
           DBMS_OUTPUT.put_line (v_error_text);
           v_error_count := v_error_count + 1;
        END;
    END LOOP;
    
         DBMS_OUTPUT.put_line ('Number of Records Selected: ' || v_selected_count);
         DBMS_OUTPUT.put_line ('Number of Records Written: ' || v_written_count);
    
          IF UTL_FILE.is_open (fhandle_o)
          THEN
             UTL_FILE.fclose (fhandle_o);
          END IF;
    
    END;
    /
    
    SPOOL OFF;
    If I comment on the ' AMRCONF_COMMENT_ERR |'| ' | ' line, then the script works fine. The table has been created as:
    Create Table WSUALUMNI.AMRCONF_ERR
    (
        AMRCONF_PIDM_ERR             NUMBER (8)    NOT NULL,
        AMRCONF_IDEN_CODE_ERR        VARCHAR2(5)   NOT NULL,
        AMRCONF_ENTRY_DATE_ERR       DATE          NOT NULL,
        AMRCONF_CONFID_IND_ERR       VARCHAR2(1),
        AMRCONF_COMMENT_ERR          LONG,          
        AMRSUBJ_SUBJ_CODE_ERR        VARCHAR2(5)   NOT NULL,
        ERROR_CODE                   VARCHAR2(12)  NOT NULL,
        ERROR_CODE_TEXT              VARCHAR2(50)  NOT NULL
    ); 
    I don't understand what the problem here is in the script.

    Hello
    Feew suggestions
    (1) LONG is an obsolete type so if possible start working on this column change
    (2) CLOB will be your favorite type of data on long.
    (3) you cannot use RTRIM on long.

    Here's a very quick example

    drop table h
    create table h (x long,y varchar2(100))
    select rtrim(x) from h
    select rtrim(y) from h
    

    Solution:
    [http://www.oracle.com/technology/oramag/code/tips2003/052503.html]

    need to better implement the clob data type and

    drop table h
    create table h (x clob,y varchar2(100))
    select  dbms_lob.substr( x, 4000, 1 ) from h
    select rtrim(y) from h
    

    See you soon!
    Bobin

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

Maybe you are looking for

  • How to record simultaneously several separate tracks midi controllers?

    I have a big keyboard, a travel size keyboard and a battery of midi. How can I make these intstruments of different control software that record in different tracks? Is how easy it to do?

  • How to get to miniplayer in iTunes?

    How do you get iTunes to only display the song and jump / pla

  • How to make a Macbook 1.1 factory reset w/Mac OS x 10.6

    I want to sell my computer and restore it to the factory specifications.  I have nothing on the drive - I only has a few days.  How can I erase my info and restore to the factory specifications.  It's a Macbook with OSX 10.6 Operating system 1.1.  Th

  • Can't find ANY info on Skype to go PIN

    Albums out incredibly confusing and not user-friendly account management features of Skype, I can't find any coherent find and change my Skype to go PIN. To make things worse, the fix proposed by a person listed as Skype beta tester has been non-func

  • VBAI Custom LabVIEW Interface minimum size limit

    I have a LabVIEW VI selected as my custom VBAI interface.  I intend to run VBAI on a PC that is also running an executable (developed in LabVIEW).  Both the executable and VBAI have graphical interfaces that need to remain visible during operation.