(wlst) TypeError: create(): expected 3 args; got 2

Hello,
I am attemptping to run the 'PO' (Purchase Order) wli demo. It uses wlst. I am getting the following error, when running its 'create_app_queues' task. This uses a wlst script called genqueues.py.
The offending line is=
wlst.create( queue, "JMSQueue")
the error message is:
TypeError: create(): expected 3 args; got 2
I have wlst v3. The doc wlst_doc.pdf shows 2 args for the 'create' method.
I am guessing, maybe I need different version of wlst or jython?
any thoughts appreciated!
John

Hello John,
Can you please download the latest version of wlst from dev2dev and try again, although this should not happen. Also can you try passing in a null as a third argument?
wlst.create(queue,"JMSQueue",None)
thanks,
-satya

Similar Messages

  • PL/SQL: ORA-00932: inconsistent datatypes: expected UDT got NUMBER

    Hi all,
    Wondering if you could assist? I'm exploring User Types and having a small problem. I'm getting the above error for a user type I have created which I'm calling in a function. Here's what my code looks like which I'm running the 'scott' schema for testing purposes
    SQL> CREATE OR REPLACE TYPE NBR_COLL AS TABLE OF NUMBER;
    2 /
    Type created.
    SQL> create or replace FUNCTION first_rec_only
    2 (
    3 NUM_ID IN NUMBER
    4 ) RETURN NUMBER IS
    5 v_num NBR_COLL;
    6 BEGIN
    7 select deptno into v_num from dept;
    8 RETURN v_num(v_num.FIRST);
    9 END first_rec_only;
    10 /
    Warning: Function created with compilation errors.
    SQL> show errors
    Errors for FUNCTION FIRST_REC_ONLY:
    LINE/COL ERROR
    7/4 PL/SQL: SQL Statement ignored
    7/11 PL/SQL: ORA-00932: inconsistent datatypes: expected UDT got
    NUMBER
    SQL>
    Any clues to what I'm doing wrong? Cheers.

    The deptno column is a number, you cannot directly select a number into your type, you need to use your type's constructor.
    Something like:
    CREATE OR REPLACE FUNCTION first_rec_only (NUM_ID IN NUMBER) RETURN NUMBER IS
       v_num NBR_COLL;
    BEGIN
       SELECT nbr_coll(deptno) INTO v_num from dept;
       RETURN v_num(v_num.FIRST);
    END first_rec_only;Note that although this will compile, it will throw ORA-01422: exact fetch returns more than requested number of rows when you run it. you need to either use the input parameter as a predicate on your query against dept, use rownum = 1 in the query or use bulk BULK COLLECT INTO, depending on what exactly you want to accomplish.
    John

  • PL/SQL: ORA-00932: inconsistent datatypes: expected REF got CHAR

    SQL> desc o.rel_module;
    Name Null? Type
    ID NOT NULL NUMBER(6)
    TYPE NOT NULL CHAR(7)
    BUILDDATE NOT NULL NUMBER(4)
    DESIGNROOT NOT NULL NUMBER(6)
    SQL> desc rel_module
    Name Null? Type
    ID NOT NULL NUMBER(6)
    DESIGNROOT NOT NULL NUMBER(6)
    REL_COMPOSITEPARTS REL_COMPOSITEPART_TAB
    SQL> desc REL_COMPOSITEPART_TAB
    REL_COMPOSITEPART_TAB TABLE OF REL_COMPOSITEPART
    SQL> desc REL_COMPOSITEPART
    Name Null? Type
    TYPE CHAR(7)
    BUILDDATE NUMBER(4)
    SQL> create or replace procedure rel_module_p
    2 as
    3 cursor c is select ID, TYPE, BUILDDATE, DESIGNROOT from o.rel_module;
    4 begin
    5 FOR i in c
    6 LOOP
    7 INSERT into rel_module(id,REL_CompositeParts,DESIGNROOT)
    Values (i.ID,REL_CompositePart_TAB(i.type,i.builddate), i.designroot);
    8 END LOOP;
    9 END;
    10 /
    Warning: Procedure created with compilation errors.
    SQL> show err
    Errors for PROCEDURE REL_MODULE_P:
    LINE/COL ERROR
    7/1 PL/SQL: SQL Statement ignored
    7/93 PL/SQL: ORA-00932: inconsistent datatypes: expected REF got CHAR
    Can you please tell me where needs correction.

    801556 wrote:
    Can you please tell me where needs correction.Just a fix would be:
    create or replace procedure rel_module_p
    as
    cursor c is select ID, TYPE, BUILDDATE, DESIGNROOT from o.rel_module;
    begin
    FOR i in c
    LOOP
    INSERT into rel_module(id,REL_CompositeParts,DESIGNROOT)
    values (i.ID,REL_CompositePart_TAB(REL_COMPOSITEPART(i.type,i.builddate)), i.designroot);
    END LOOP;
    END;
    /However, I'd assume what you want is:
    create or replace procedure rel_module_p
    as
    cursor c is select ID,CAST(COLLECT(REL_COMPOSITEPART(TYPE,BUILDDATE)) AS REL_CompositePart_TAB) REL_COMPOSITEPARTS, DESIGNROOT
    from rel_module
    group by id,DESIGNROOT;
    begin
    FOR i in c
    LOOP
    INSERT into rel_moduleX(id,REL_CompositeParts,DESIGNROOT)
    values (i.ID,i.REL_COMPOSITEPARTS, i.designroot);
    END LOOP;
    END;
    /SY.

  • Error #1063: Argument count mismatch on CBClasses::cbIntro(). Expected 5, got 0

    Hi,
    This is my first attempt with AS3...now I am well aware of OOPs concepts and am comfortable with programming, but I am not able to wrap my head around the whole connecting the classes to the display objects on screen thing [linkages and class names n all]..now I managed to fix most errors in my file, which has cbIntro as the base class [set up successfully]...now cbIntro extends MovieClip as it links to an external fla [cbFlash]...but  within cbFLash I am calling the following...
    import CBClasses.cbIntro;
    var flipped:Boolean = false;
    var jobs:jobsBtn_mc = new jobsBtn_mc();  //not a button a movieclip within the library
    var flip:cbIntro;
    function callFlip(e:MouseEvent):void 
    trace("in call flip");
    if (!flipped)
    //some button code
    flip  = new cbIntro(evnts, jobs, 2, "left", true);  //evnts is a mc on stage
    addChild(flip);
    flipped = true;  
    else if (flipped)
    flip = new cbIntro(jobs, evnts, 2, "right", true); 
    addChild(flip); 
    flipped = false; 
    evnts.nxt.visible = true; 
    evnts.nxt.addEventListener(MouseEvent.MOUSE_DOWN, callFlip); //Adds the listeners to the buttons 
    jobs.bck.addEventListener(MouseEvent.MOUSE_DOWN, callFlip); 
    cbIntro has one constructor which takes 5 parameters, defined within a separate .as file.....now I am getting an error
    Error #1063: Argument count mismatch on CBClasses::cbIntro(). Expected 5, got 0 
    How can this happen, the only time an object is created, I am sending the right number of parameters...?? declaring a cbIntro variable should not call the constructor....?? Is that what is happening?? Or am I missing something important????

    Hi Ned,
    Sorry about posting two different topics thing...I was just trying to figure out the first problem by creating a stripped down version of the sending an on stage movieclip to an external class thing. I don't know how I can break up this post now...but since you have mentioned a few points...the problem is not with the private function declaration..you are correct of course..and that error was fixed..but I am still getting the error....
    inside intromain constructor
    Error: Error #2136: The SWF file file:///E|/Adobe/Flash%20CS5/Projects/trial/introduction.swf contains invalid data.
    at introMain/frame1()
    the introMain class only contains a constructor and a vanish function, which only shows a trace. I removed the problem with the on stage instance name, and tried to access it directly...but I don't think the code is even getting to that point...or may be it is...I am at a loss here...
    Code within introduction.swf
    var iMain:introMain = new introMain();
    var isVanished:Boolean = false;
    trace("events alpha" + eventsmc.alpha);
    I am not even calling the vanish function anymore...is something wrong with the constructor call???
    Code within introMain
    package  {
    import flash.display.*;
    import fl.transitions.easing.*;
    import fl.transitions.Tween;
    import fl.transitions.TweenEvent;
    import flash.events.MouseEvent;
    public class introMain extends MovieClip{
              public function introMain(){
                   trace("inside intromain constructor");
               public function vanish(mcName:MovieClip):void{
                 trace("inside vanish");

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

  • Inconsistent datatypes: expected TIMESTAMP got TIMESTAMP

    Yes, that's the error message when I do:
    select from_tz(systimestamp,'US/Pacific') from dual;
    I get a rather funny error message:
    ORA-00932: inconsistent datatypes: expected TIMESTAMP got TIMESTAMP
    What gives?

    Check this
    hr@XE> create table sun_tz_test(col1 TIMESTAMP, col2 TIMESTAMP WITH TIME ZONE);
    Table created.
      1* insert into sun_tz_test values(TIMESTAMP '2006-12-13 18:30:39', current_timestamp)
    hr@XE> /
    1 row created.
    hr@XE> select * from sun_tz_test;
    COL1                                                                        COL2
    13-DEC-06 06.30.39.000000 PM                                                13-DEC-06
    06.16.32.081000 PM -05:00

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

    Hello Friends...
    i got this error while inserting record ..
    ORA-00932: inconsistent datatypes: expected UDT got NUMBER
    wht is that UDT ??
    Thanks..

    You cannot insert into your table STUDENT using the COURSE_TAB collection, since the column SUB is defined as a single object type.
    So either you have to modify your insert into two inserts as follows;
    INSERT INTO STUDENT VALUES(1,COURSE('1','ORACLE') )
    INSERT INTO STUDENT VALUES(1,COURSE('2','JAVA') )
    /or you have to modify your table structure so you can store a nested table, which will allow you to have a single insert
    something like this:
    drop table s
    drop type course_tab
    create or replace type course_type as  object (
    CNO CHAR(1),
    C_CNAME VARCHAR2(10)
    CREATE or replace  TYPE course_tab AS TABLE OF course_type;
    create table s ( c course_tab )
    nested table c store as course_list
    -- You can now have a single insert as follows:
      1* insert into s (c) values ( course_tab ( course_type('1','Java'), course_type('2','Oracle'))  )
    SQL> /
    1 row created.Be careful of using nested tables though. asktom reckons one should not use them.
    P;

  • ORA-00932: inconsistent datatypes: expected DATE got NUMBER at OCI call OCIStmtExecute in OBIEE 11g

    Hi Friends,
    I am getting this error : ORA-00932: inconsistent datatypes: expected DATE got NUMBER at OCI call OCIStmtExecute when I am trying to put the filter condition on the date column.
    "Dim-Time"."Day" <= cast(MAX("Dim-Time"."Day") as date)  and "Dim-Time"."Day" >= TIMESTAMPADD(SQL_TSI_MONTH, -1,cast(MAX("Dim-Time"."Day") as date).
    I have casted the max date but though I am getting the above error. I am thinking max(date) is creating the problem.
    Please suggest your on opinion this.
    Thanks.

    Not sure why you need cast in your statement if at all it is required then you need to do as below
    cast("Dim-Time"."Day"  as date)<= cast(MAX("Dim-Time"."Day") as date)  and cast("Dim-Time"."Day"  as date) >= TIMESTAMPADD(SQL_TSI_MONTH, -1,cast(MAX("Dim-Time"."Day") as date).
    ~ http://cool-bi.com

  • ArgumentError: Error #1063: Argument count mismatch on Greeter$iinit(). Expected 0, got 1.

    I keep getting this error message after i press run.
    ArgumentError: Error #1063: Argument count mismatch on
    Greeter$iinit(). Expected 0, got 1.
    at PMA$iinit()
    at mx.managers::SystemManager/create()
    at mx.managers::SystemManager/::initializeTopLevelWindow()
    at mx.managers::SystemManager/::frameEndHandler()
    I have tried commenting out each function one by one to
    identify the error, but it persists even after every function has
    been commented out in the Greeter class. Has anyone experience this
    error before?

    Run "Clean" from the Project menu, see if that helps.
    I assume you corrected the argument mismatch issue. Note: 1.5
    allowed argument count mismatches. In 2.0, if you have an optional
    argument, you can specify a default value in the argument
    declaration.
    Tracy

  • Error message - ORA-00932: inconsistent datatypes: expected CHAR got 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 RFA_FLAG data type is NUMBER(*,0)... i am displaying LSF and Non-LSF in the select list box , but i get the error ORA-00932: inconsistent datatypes: expected CHAR got NUMBER >
    I have created static LOV with LSF display 0 return
    NON-LSF display 1 return..
    Could any body please help me in truble shooting the error ? how do i convert datatype into number i dont have any privileges to make changes to the table...

    Are there multiple columns in the table you are using from your LOV?
    Your LOV select is:
    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)Maybe try this:
    select
    from   DW_RFA_JOBDATA
    where  FINISH_TIME >= :P1_START_DATE
    and FINISH_TIME < :P1_END_DATE
         AND TO_CHAR(RFA_FLAG) = DECODE(:P1_JOB_CLASSIFICATION,'0','LSF','1','NON-LSF',RFA_FLAG)

  • 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

  • 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

Maybe you are looking for