Oracle procedure-[wrong number or type

can someone help me identify what Miss me here. I get the error when I run following the procedure below. I work with oracle 11g. Thank you
[Error] PLS-00306 (43:15): PLS-00306: wrong number or types of arguments I
CREATE TYPE string_state_table AS TABLE OF varchar2(100); 

CREATE OR REPLACE PROCEDURE dbevendors1e (
   p_state                 IN     string_state_table,
   P_BUSINESSDESCRIPTION   IN     VARCHAR2,
   p_results                  OUT SYS_REFCURSOR)
IS
   v_sql_text   VARCHAR2 (4000) := NULL;
BEGIN
   v_sql_text :=
      'SELECT DISTINCT v.refvendor_id vendorId,
                v.vendorname legalname,
                v.CERTIFICATIONTYPE,
                v.vendorshortname doingbusinessname,
                s.naics_id naicscode,
                (r.addressline1 ||'' ''|| r.addressline2) address,
                r.city city,
                o.gender gender,
                o.officername officer,
                v.ethnicgroup ethinic,
                r.state state,
                TRIM (INITCAP (g.vnlst1)) businessdesc,
                r.zipcode zipcode,
                r.telephonenum phone,
                r.faxnum fax,
                LOWER (r.email) email,
                LOWER (v.website) website,
                v.dbecertstatus status,
                func_get_naics_desc (s.naics_id) naicscodedesc,
                func_get_state_desc (r.state) statename
                                                              
  FROM refvendor v,
       refvendor_gf g,
       refvendoraddress r,
       refvendornaics s,
       refvendorofficer o
       
 WHERE     (v.refvendor_id = r.refvendor_id)
       AND v.refvendor_id = s.refvendor_id
       AND v.refvendor_id = r.refvendor_id
       AND v.refvendor_id = o.refvendor_id(+)
       AND v.refvendor_id = g.refvendor_id(+)';

   IF p_state = '0' ---------------------this is where the error is
   THEN
      v_sql_text :=
            v_sql_text
         || 'AND R.STATE  IN  (SELECT COLUMN_VALUE FROM TABLE ('
         || p_state
         || ')) ';
   END IF;

   IF P_BUSINESSDESCRIPTION != 'ALL'
   THEN
      --v_sql_text := v_sql_text || 'AND TRIM (g.vnlst1) LIKE  % (' || P_BUSINESSDESCRIPTION  || ')';
      v_sql_text :=
            v_sql_text
         || 'AND TRIM (g.vnlst1) LIKE  '
         || ''''
         || '%'
         || P_BUSINESSDESCRIPTION
         || '''';
   END IF;

   v_sql_text :=
      v_sql_text
      || '  AND UPPER(v.CERTIFICATIONTYPE)=''DBE''  order by vendorId ';

   -- dbms_output.put_line(v_sql_text);
   OPEN p_results FOR v_sql_text;
END;
/

Do not code like this a lot - difficult to read and understand. What makes it difficult to find bugs and difficult to maintain.

The comparison is-string-in-set can be made by using a submultiset condition. Bed easier IMO. (remember to consult the execution plan so that these methods can do for execution of cursor and performance)

The key however, is bind variable. It is a little one non-negotiable. Bind variables are essential for performance - reduce CPU overhead. It is also essential for effective use of the SQL Shared Pool (and not causing the fragmentation of memory and leading to the error of memory allocation for new SQLs).

I wrote the following example of procedure - showing the basic approach that I would use for a problem like this.

SQL> create or replace type TStrings as table of varchar2(4000);
  2  /

Type created.

SQL>
SQL> create or replace procedure GetObjectsByType(
  2          c IN OUT sys_refcursor,                 -- cursor returned to caller for fetching rows
  3          objectTypes TStrings,                   -- list of object types to fetch (mandatory)
  4          objectOwner varchar2 default null       -- owner of the object (optional)
  5  ) is
  6          curSql  varchar2(32767);
  7  begin
  8          curSql :=
  9                  'select
 10                          object_name, object_type
 11                  from    all_objects
 12                  where   TStrings(object_type) submultiset of :0';
 13
 14          if objectOwner is not null then
 15                  curSql := curSql || ' and owner = :1';
 16          else
 17                  curSql := curSql || ' and owner = USER';
 18          end if;
 19
 20          -- how many bind parameters?
 21          case
 22                  when (instr(curSql,':0') > 0) and  (instr(curSql,':1') > 1) then
 23                          open c for curSql
 24                          using objectTypes, objectOwner;
 25
 26                  when (instr(curSql,':0') > 0) then
 27                          open c for curSql
 28                          using objectTypes;
 29          end case;
 30  end;
 31  /

Procedure created.

SQL>
SQL> var c refcursor
SQL> exec GetObjectsByType( :c, TStrings('TABLE','PROCEDURE') )

PL/SQL procedure successfully completed.

SQL> print c

OBJECT_NAME                    OBJECT_TYPE
------------------------------ ------------------------------
FOOTAB                         TABLE
TESTTAB                        TABLE
PROCB                          PROCEDURE
PROCA                          PROCEDURE
GETOBJECTSBYTYPE               PROCEDURE

SQL>
SQL> exec GetObjectsByType( :c, TStrings('EDITION','JOB CLASS'), 'SYS' )

PL/SQL procedure successfully completed.

SQL> print c

OBJECT_NAME                    OBJECT_TYPE
------------------------------ ------------------------------
ORA$BASE                       EDITION
DEFAULT_JOB_CLASS              JOB CLASS
DBMS_JOB$                      JOB CLASS

If the dynamic part of the SQL is more dynamic in this example, I would use DBMS_SQL creates the cursor and bind the list dynamic of the bind variable. It's quite simple to do.

With 11g one can change a reference cursor DBMS_SQL (number) in a handful of refcursor PL/SQL. Which means that after you create the cursor DBMS_SQL , the code can cast/convert that to a refcursor and move this refcursor to the appellant.

The stakes are the use of bind variables and make the code (in spite of dynamic linking) easy to read and understand. Code that fall into this category has fewer bugs, easier to debug and much easier to maintain and modify. It must be so always try and keep things simple - while respecting the fundamental principles (such as bind variables).

Tags: Database

Similar Questions

  • call procedure: wrong number or types of arguments in the call getHour

    Hello, everybody, when I call a procedure like this: call getHour ('2009-1-1 ',' 2009-12-31'), and it not show that: the following error has occurred:

    ORA-06553: PLS-306: wrong number or types of arguments in the call to "GETHOUR '...
    And the procedure as follows: Please help me to find the mistakes, thanks a lot! Please, I beg you!

    create or replace procedure (getHour)
    sDate in date,
    eDate to date,
    oHour number
    )
    as
    number of pNum;
    number of wNum;
    mDate date;
    number of mNum;
    wStr tank (3);
    l_num NUMBER;
    l_date DATE;
    l_str VARCHAR2 (20);

    Start
    Select count (*) in the l_num of vacation where cdate > = cdate and to_date(sDate,'yyyy-mm-dd') < = to_date(eDate,'yyyy-mm-dd');
    oHour: = pNum;
    loop
    Select to_date (sDate, 'yyyy-mm-dd') + 1 in double l_date;
    If to_date(mDate,'yyyy-mm-dd') > to_date(eDate,'yyyy-mm-dd') then
    "exit";
    on the other
    Select to_char (to_date (mDate, 'yyyy-mm-dd'), 'dy') in the double l_str; / * get week string * /.
    If wStr = 'sat' or wStr = "Sun" then
    Select count (*) in the l_num of workingday where cdate = to_date(mDate,'yyyy-mm-dd'); / * * /
    If mNum = 0 then
    oHour: = oHour + 1;
    end if;
    end if;
    end if;
    end loop;
    oHour: = oHour * 8.5;
    end;

    Hello

    Sorry, I missed the:(il faut le déclarer.) output parameter

    Example:

    DECLARE
       v_sDate VARCHAR2(10) := '2009-01-01';
       v_eDate VARCHAR2(10) := '2009-12-31';
       v_oHour NUMBER;
    BEGIN
       getHour(sDate => v_sDate,
               eDate => v_eDate,
               oHour => v_oHour);
    END;
    

    Kind regards

    Published by: Walter Fernández on March 5, 2009 12:24 AM

  • A wrong number or types of arguments in the call to stored procedure

    Hi all...
    I'm missing something simple here, but I don't see what it is.
    I have looked around and cannot know what the problem is.
    Calling a stored procedure in Oracle 11g of Java 6.

    Here is my code:
       CallableStatement proc = null;                
       proc = conn.prepareCall("{ call storedProc(?, ?, ?, ?, ?) }");
       proc.setString("p_header", "8YR6TG");
       proc.setString("p_optype", "A");
       proc.registerOutParameter("p_headerCursor", OracleTypes.CURSOR);
       proc.registerOutParameter("p_detailCursor", OracleTypes.CURSOR);
       proc.registerOutParameter("p_status", OracleTypes.VARCHAR);
       proc.execute();
    Here are my stored procedure:
    PROCEDURE storedProc (
    p_header IN VARCHAR2,
    p_optype IN VARCHAR2,
    p_headerCursor OUT R_CURSOR,
    p_detailCursor OUT R_CURSOR,
    p_status OUT VARCHAR)
    Here's the exception I get:
    java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'storedProc'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:626)
         at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:181)
         at oracle.jdbc.driver.T4CCallableStatement.execute_for_rows(T4CCallableStatement.java:870)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1081)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2905)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:2996)
         at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4120)
    Can you see what I'm doing wrong here?
    Thanks in advance for your comments!

    Published by: Brady on February 16, 2012 13:02

    try to use digital indexes instead of parameter names.

  • Can't get the procedure to update - PLS - 00306:Wrong number or types of arguments

    I'm in a situation where I think that despite the correct number of parameters by the way my local procedure (which has been "forward declarations" in addition to logical writing for her; I use all this in a package) fails to compile in SQL * faster due to the error PLS - 00306:Wrong number or types of arguments in the call to P_SENDMAIL.


    I'm passing 5 parameters in the area of forward declarations and also in the logic/header inside in addition to calling the procedure in the package. Can one of you help mewith this and tell me where exactly the error might be. Here is the code:


    [code]

    -Local variable

    CRLF VARCHAR2 (2) CONSTANT: = CHR (13) | CHR (10);

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

    -FORWARD DECLARATIONS

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

    PROCEDURE p_sendmail (p_sender_email IN VARCHAR2,

    P_FROM IN VARCHAR2,

    p_to IN VARCHAR2,

    msg_subject IN VARCHAR2 DEFAULT NULL,

    p_msg_body IN LONG DEFAULT NULL);

    [/ code]


    The procedure itself:


    [code]


    PROCEDURE p_sendmail (p_sender_email IN VARCHAR2,

    P_FROM IN VARCHAR2,

    p_to IN VARCHAR2,

    msg_subject IN VARCHAR2 DEFAULT NULL,

    p_msg_body IN LONG DEFAULT NULL) is

    LONG v_to_list;

    LONG v_cc_list;

    LONG v_bcc_list;

    T_DATE VARCHAR2 (255) DEFAULT TO_CHAR(SYSDATE, 'DD MON YYYY HH24:MI:SS PM');

    g_mail_conn UTL_SMTP. CONNECTION;

    SMTP_HOST CONSTANT VARCHAR2 (256): ='smtp - abc.defg.ca';

    SMTP_PORT CONSTANT PLS_INTEGER: = 25;

    BEGIN

    g_mail_conn: = UTL_SMTP. OPEN_CONNECTION (SMTP_HOST, SMTP_PORT);

    UTL_SMTP. HELO (g_mail_conn, SMTP_HOST);

    UTL_SMTP.mail (g_mail_conn, p_sender_email);

    UTL_SMTP. RCPT (g_mail_conn, p_to);

    UTL_SMTP.open_data (g_mail_conn);

    UTL_SMTP.write_data (g_mail_conn, "|) CRLF);

    UTL_SMTP.write_data (g_mail_conn, p_msg_body);

    UTL_SMTP.close_data (g_mail_conn);

    UTL_SMTP. Quit (g_mail_conn);

    EXCEPTION

    WHEN utl_smtp.transient_error THEN

    Dbms_output.put_line ('TransientError: invalid operation in the service may not be available.) ") ;

    WHEN utl_smtp.permanent_error THEN

    Dbms_output.put_line (' permanent error: the entered email is invalid or recepients mailbox is full.) ») ;

    WHILE others THEN

    Dbms_output.put_line ('Unable to send an email' |') '|| SQLERRM);

    END p_sendmail;

    [/ code]

    Now by calling the procedure to send an email:

    [code]

    p_sendmail (p_sender_email = > ' [email protected]'-, send an E-mail to the donor )

    p_from = > ' ADS < [email protected] > ',

    p_to = > v_store_email_address,

    p_msg_subject = > 'anonymous user ',.

    p_msg_body = > 'thank you ' |

    CRLF.

    "Email confirms that we have received your promise |

    CRLF.

    CRLF.

    ' Name: '. v_full_name |

    CRLF.

    ' Temporary ID: ' | v_azbwccp_id |

    CRLF.

    "Reference number: ' |" MTID |

    CRLF.

    "Amount: ' | '. TO_NUMBER (campaign_desg_amt1) |

    CRLF.

    "Campaign: ' | '. campaign |

    CRLF.

    ' Description: ' | '. adbdesg_rec.adbdesg_name |

    CRLF.

    ' Type: ' | atvpldg_rec.atvpldg_desc |

    CRLF.

    ' Duration: ' | '. atvpdur_rec.atvpdur_desc |

    CRLF.

    "Frequency: ' | '. atvfreq_rec.atvfreq_desc |

    CRLF.

    "Start date: ' | '. bill_date2 |

    CRLF.

    CRLF.

    'Your commitment is processed.' |

    CRLF.

    "At the same time, if you want to change this transaction, please contact us.

    CRLF.

    CRLF.

    "Thank you for your support." |

    CRLF.

    CRLF.

    CRLF.

    CRLF.

    ' * This is an automated message system. Please, do not respond to this email. *** ') ;

    [/ code]


    I've also attached a screenshot of the error message below:

    ScreenHunter_15 Nov. 27 09.35.jpg

    Please help me if you can. I just can't understand the question.


    Thanks in advance

    Sandeep

    In the header of the procedure, I spent my parameter as msg_subject and during the call, he was p_msg_subject. The minute that I corrected the error, I was able to correctly compile the whole package body.

    The question can be now closed.

  • PLS-00306. wrong number or types of arguments in the call to the 'procedure '.

    now I'm on oracle10g xe, I get the following error

    create or replace procedure proc_name (slno_in in number,
    name_out out varchar2, fee_out certain number)
    is
    v_Name student.name%type;
    v_fee student.fee%type;
    Start
    Select name, cool in v_name, v_fee of
    student where slno = slno_in;
    name_out: = v_name;
    fee_out: = v_fee;
    end proc_ref;

    Created procedure.

    SQL > exec proc_name (1);
    BEGIN proc_ref (1); END;

    *
    ERROR on line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in the call to 'PROC_REF '.
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored





    Please help me
    DECLARE
     p_name VARCHAR2(50);
     p_fee NUMBER;
    BEGIN
     proc_name(1,p_name,p_fee);
     DBMS_OUTPUT.PUT_LINE(p_name||'--'||p_fee);
    END;
    
  • Nested Tables: PLS-00306: wrong number or types of arguments

    Hello

    I created a package for updating of wages for a list of the empnos passed as parameter inside below is the package code:

    CREATE or REPLACE PACKAGE method

    AS

    type emp_list IS TABLE OF emp.empno%type;

    PROCEDURE add_sal (empnos emp_list);

    END method;

    /

    CREATE or REPLACE PACKAGE body method

    AS

    PROCEDURE add_sal (empnos emp_list)

    AS

    BEGIN

    ForAll I IN 1... empnos. Count

    UPDATE emp SET sal = sal plus 100 WHERE empno is empnos (i);

    END add_sal;

    END method;

    /

    When I try to call the procedure to aid under block it works fine:

    DECLARE

    empnos emp_info.emp_list: = emp_info.emp_list (1111,1112);

    BEGIN

    emp_info.add_sal (empnos);

    END;

    /

    But when I try to create the same as type I created in the package and try to pass to the procedure, the block fails with the error:

    DECLARE

    type emp_list IS TABLE OF emp.empno%type;

    empnos emp_list;

    BEGIN

    empnos: = emp_list (1111,1112);

    emp_info.add_sal (empnos);

    END;

    /

    Error report-

    ORA-06550: line 8, column 3:

    PLS-00306: wrong number or types of arguments in the call to 'ADD_SAL '.

    Can someone please help me understand why we see this error?

    With the help of: Windows 8.1

    Database Oracle 12 c Enterprise Edition Release 12.1.0.1.0 - 64 bit Production

    PL/SQL Release 12.1.0.1.0 - Production

    "CORE 12.1.0.1.0 Production."

    AMT for 64-bit Windows: Version 12.1.0.1.0 - Production

    NLSRTL Version 12.1.0.1.0 - Production

    But when I try to create the same as type I created in the package and try to pass to the procedure, the block fails with the error:

    No - it is NOT of the same type. One is the type of package and this news isn't the type of packet.

    The fact that they have the same projection or a set of attributes is obsolete.

    See the Oracle documentation

    http://docs.Oracle.com/CD/B28359_01/AppDev.111/b28370/Collections.htm#BEIEADAA

    You can assign values to all fields at the same time that if you assign a record to another record with the same data type. With fields that match exactly isn't enough, as shown in example 5-48.

    Example 5-48 assigning all the fields of a record in a statement

    DECLARE
    -Two declarations of the same types.
    TYPE DeptRec1 IS MADE
    (dept_num NUMBER (2), dept_name VARCHAR2 (14));
    TYPE DeptRec2 IS MADE
    (dept_num NUMBER (2), dept_name VARCHAR2 (14));
    dept1_info DeptRec1;
    dept2_info DeptRec2;
    dept3_info DeptRec2;
    BEGIN
    -Is not allowed; different types of data,
    -even if the fields are the same.
    -dept1_info: = dept2_info;
    -This assignment is OK because the files have the same type.
    dept2_info: = dept3_info;
    END;
    /

  • PLS-00306: wrong number or types of arguments in the call to ' |'

    Hello

    SQL> select * from v$version
      2  /
    
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    

    Code

    DECLARE
    TYPE SARR IS TABLE OF VARCHAR2(8);
    l_tempdate SARR;
    l_temptable VARCHAR2(30) := 'TBL_EDATE';
    BEGIN
    EXECUTE IMMEDIATE ' SELECT FORMATDATE  BULK COLLECT INTO ' || l_tempdate || ' FROM  ' || l_temptable;
    END;
    /
    

    Error

    ERROR at line 6:
    ORA-06550: line 6, column 19:
    PLS-00306: wrong number or types of arguments in call to '||'
    ORA-06550: line 6, column 1:
    PL/SQL: Statement ignored
    

    TABLE (it will create dynamically)

    CREATE TABLE TBL_EDATE
    (
      FORMATDATE       VARCHAR2(8 BYTE),
      ORDERFORMATDATE  NUMBER
    )
    

    Insert Scripts

    Insert into TBL_EDATE   (FORMATDATE, ORDERFORMATDATE) Values   ('H2-2012', 2);
    Insert into TBL_EDATE   (FORMATDATE, ORDERFORMATDATE) Values   ('H1-2012', 1);
    
    

    Thank you

    Well, you asked?

    SQL > declare

    2 type sarr is table of the varchar2 (8);

    3 l_tempdate sarr;

    4 l_temptable varchar2 (30);

    5 str varchar2 (100);

    6 start

    7 - l_temptable: = get_temp_table_name (some arg); -logical, you must be knowing

    8 l_temptable: = "TBL_EDATE"; -Suspected function returned this value

    9 str: = ' Select format of ' | l_temptable | » ';

    10 run immediately str bulk collect into l_tempdate;

    11 dbms_output.put_line ('count' | l_tempdate.) (Count);

    12 end;

    13.

    County 2

    PL/SQL procedure successfully completed.

  • a wrong number or types of arguments in the call to 'Procedure_Name '.

    I call a procedure with the type of table but its me gives error
    "ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in the call to 'VSKU_DETAIL_GRID '.
    How can I fix?



    String stmt = "start xxData_supplwrkbch_functions. VSKU_DETAIL_GRID(?,?,?,?,?,?,?,?); end; « ;
    DBTransaction dbtxn = (DBTransaction) getTransaction ();
    CallableStatement cs = dbtxn.createCallableStatement (stmt.toString (), 1);
    int row_ptr = 0;
    int col_ptr = 0;
    error_code int;
    String msg_erreur;
    String [] [] outb_vsku_array = new String [300] [50];

    Connection Conn = null;
    ArrayDescriptor descriptor_width = null;
    ArrayDescriptor descriptor_qty = null;

    oracle.sql.ARRAY p_width_Arr = null;
    oracle.sql.ARRAY p_qty_Arr = null;
    ARRAY newWidthArray = null;
    ARRAY newQtyArray = null;
    try {}
    Conn = getDBTransaction () .createCallableStatement ("select 1 from dual", 1) .getConnection ();
    }
    catch (SQLException e)
    {
    System.out.println ("error getting connection object");
    }

    Try
    {
    System.out.println ("creating descriptor");
    descriptor_width = ArrayDescriptor.createDescriptor ("XXMSN_VSKU_WIDTH_TYPE", conn);
    }
    catch (System.Exception e)
    {
    System.out.println ("Descriptor ERROR-" + e.getMessage ());
    }

    Try
    {
    System.out.println ("creating descriptor");
    descriptor_qty = ArrayDescriptor.createDescriptor ("XXMSN_VSKU_QTY_TYPE", conn);
    }
    catch (System.Exception e)
    {
    System.out.println ("Descriptor ERROR-" + e.getMessage ());
    }

    Try
    {
    p_width_Arr = new oracle.sql.ARRAY (descriptor_width, conn, p_width_ArrData);
    newWidthArray = new ARRAY (descriptor_width, conn, p_width_Arr);
    }
    catch (System.Exception e)
    {
    System.out.println ("Array training ERROR-" + e.getMessage ());
    }

    Try
    {
    p_qty_Arr = new oracle.sql.ARRAY (descriptor_qty, conn, p_qty_ArrData);
    newQtyArray = new ARRAY (descriptor_qty, conn, p_qty_Arr);
    }
    catch (System.Exception e)
    {
    System.out.println ("Array training ERROR-" + e.getMessage ());
    }

    cs.setString(1,p_ssku_id);
    cs.setString(2,p_dim_2);
    cs.setArray(3,p_width_Arr);
    cs.setArray(4,p_qty_Arr);
    cs.setInt(5,is_blanket);
    cs.registerOutParameter(6,OracleTypes.CURSOR);
    cs.registerOutParameter(7,OracleTypes.NUMERIC);
    cs.registerOutParameter(8,OracleTypes.VARCHAR);
    CS. Execute(); Error is here

    Published by: Rahul Sharma 902 February 12, 2013 05:52

    I don't think and the error you get points in that direction too.
    From my understanding, the OracleTypes.CURSOR is only used for ref Cursor.

    Timo

  • Please help solve the problem error: PLS-00306: wrong number or types of a

    Hello

    Please see my statement of types and the procedure. Object and the nested table that is declared at the schema level

    I'm using the oracle version 11.2
    CREATE OR REPLACE TYPE T_COPY_EVNT_DTL IS OBJECT
    
    ( 
    
    eventId varchar2(100),
    
    eventDescription varchar2(100),
    
    promoMonthDescription varchar2(100),
    
    promoStartDate varchar2(100),
    
    promoEndDate varchar2(100),
    
    PROMOCOSTSTARTDATE varchar2(100)
    
    );
    
    
    CREATE OR REPLACE TYPE T_EVENT_TABLE IS TABLE OF T_COPY_EVNT_DTL;
    
    create or replace PROCEDURE Pr_Event_Details_new(ip_xml          CLOB,
                                                                                                                                                     op_sections_xml OUT XMLTYPE) AS
         
         event_list     t_copy_evnt_dtl;
         event_data_sec t_event_table := t_event_table();
         
         
         CURSOR get_event_cur IS
              SELECT cast(collect(t_copy_evnt_dtl(evnt.event,                                                                                                                    evnt.event_desc,
                        mth.promo_month_desc,
                        TO_CHAR(evnt.start_date,
                        'DD/MM/YYYY'),
                        TO_CHAR(evnt.end_date,
                        'DD/MM/YYYY'),
                        TO_CHAR((evnt.start_date - 21),
                        'DD/MM/YYYY'))) as
                        t_event_table)
                   FROM RETEK_PROMO_EVENT_MST evnt
               INNER JOIN  .....
               WHERE ... 
               ORDER BY evnt.event_desc,
                                       mth.promo_month_desc,
                                       dtl.promo_start_date,
                                       dtl.promo_end_date,
                                       dtl.promo_cost_start_date;
    
         type get_event_tab is table of get_event_cur%rowtype index by Binary_Integer;
         l_get_event_tab get_event_tab;
    BEGIN
    
         ....
         
         
              OPEN get_event_cur;
              fetch get_event_cur
                   into event_data_sec;
         
              event_data_sec := set(event_data_sec);
              ...
              
              
              
    EXCEPTION
              --log_errors...                                                                 
              Raise;
    END Pr_Event_Details_new;
    Error: PLS-00306: wrong number or types of arguments in the call to 'SET '.
    Online: 117
    Text: event_data_sec: = set (event_data_sec);

    Error: PL/SQL: statement ignored
    Online: 117
    Text: event_data_sec: = set (event_data_sec);

    You will raise a wrong number or types of argument error, or an exception of PLS-00306, if you use the fixed operator with the collection of user-defined object types.

    The collection must contain SQL scalar data types - single values without internal components...

    Numeric values, on which you can perform arithmetic operations.
    Alphanumeric values that represent individual or strings of characters, characters that you can manipulate.
    Logical values, on which you can perform logical operations.
    Dates and times, you can manipulate.
    Time intervals, you can handle.

    Published by: stefan nebesnak on January 24, 2013 13:22

  • ORA-06553: PLS-306: wrong number or types of arguments errors

    Hi friends,

    When executing the below function I get error like

    I use the program version 2.1 sql Oracle.
    ============================
    ORA-06553: PLS-306: wrong number or types of arguments in the call to 'FUNC_TEST '.
    06553 00000 - "PLS - %s: %s.
    ============================

    CREATE OR REPLACE FUNCTION FUNC_TEST
    RETURN SYS_REFCURSOR
    AS
    PRAGMA AUTONOMOUS_TRANSACTION;
    total_val number (5): = 65;
    REF_TEST SYS_REFCURSOR;
    cursor c1 is
    Select substr(data,1,3). substr(Data,5) new_col text_1 update of data;
    BEGIN
    FOR employee_rec in c1
    LOOP
    text_1 update
    data value = substr (employee_rec.new_col, 1, 4). Chr (total_val) | substr(employee_rec.new_col,5) location being the c1;
    total_val: = total_val + 1;
    If total_val > 90 then
    total_val: = 65;
    end if;
    end loop;
    commit;
    REF_TEST OPEN for SELECT data FROM text_1;
    RETURN REF_TEST;
    END;
    -----------------------
    Table script:

    create table text_1
    (
    given varchar2 (20)
    )

    insert into text_1 values ("IAL030003IND")

    Please suggest.

    Thank you
    Lony

    >
    Yes, I also used a procedure and its fine in the working procedure.

    But according to her does not work... Or how can spend us in parameter to this function so that it can work?
    . . .
    If I am performing the function of the query below and I don't want to pass any parameter

    Select double FUNC_TEST;

    I get the error message like
    {,}
    >
    Your problem is that the function returns a ref cursor - that is a pointer to a result set. You can't put a ref cursor in a cell in the grid.

    The only reason why the procedure is 'work' is probably because you do not use a ref cursor in the version of the procedure.

    Why would you use a function that combines the data of attachment with the return of the data as a Ref Cursor? Once the data are set, there are fixed if you call the function a second time, that your data will be be stripped.

    If you want to return a Ref Cursor then you must use the function in the FROM clause: SELECT * FROM TABLE (myFunc ())

  • PLS-00306: wrong number or types of arguments in call to... my cursor

    Hi all

    I try to use the same cursor for an explicit cursor and a cursor for loop. Can I do this? I get the error:
    PLS-00306: wrong number or types of arguments in call to
             'CUR_DEPT'
    This is my code:
         PROCEDURE LIST_DEPT_PRODUCTS (dept_name VARCHAR2)
         IS
          i_1 CHAR(1):=' ';
          i_2 CHAR(2):='  ';
          i_3 CHAR(3):='   ';
          i_4 CHAR(4):='    ';
          lv_deptid bb_department.idDepartment%TYPE;
          lv_deptname bb_department.DeptName%TYPE;
          lv_deptdesc bb_department.DeptDesc%TYPE;
          CURSOR cur_dept (dept VARCHAR2) IS
          SELECT d.DeptName, d.DeptDesc, d.idDepartment
          INTO lv_deptname, lv_deptdesc, lv_deptid
          FROM bb_department d 
          WHERE DeptName = dept
          ORDER BY DeptName;
           CURSOR cur_prod IS
           SELECT p.ProductName, p.Description, p.Price, p.SaleStart, p.SaleEnd
           FROM bb_product p 
           WHERE idDepartment = lv_deptid
           ORDER BY ProductName;
         BEGIN
         IF (dept_name = 'Coffee') THEN
           OPEN cur_dept(dept_name);
            LOOP
              FETCH cur_dept INTO lv_deptname, lv_deptdesc, lv_deptid;
              EXIT WHEN cur_dept%notfound;
                   DBMS_OUTPUT.PUT_LINE(lv_deptname);
                   DBMS_OUTPUT.PUT_LINE(i_1||lv_deptdesc);
                   DBMS_OUTPUT.PUT_LINE(chr(1));
              FOR l_prod in cur_prod LOOP
                   DBMS_OUTPUT.PUT_LINE(i_2||l_prod.ProductName);
                   DBMS_OUTPUT.PUT_LINE(i_3||SUBSTR(l_prod.Description,1,70));
                   DBMS_OUTPUT.PUT_LINE(i_4||'Price -  '||FORMAT_DOLLARS(l_prod.Price));
                   IF l_prod.SaleStart IS NOT NULL THEN
                   DBMS_OUTPUT.PUT_LINE(i_4||'Sale runs from '||FORMAT_DATE(l_prod.SaleStart)||' until '||FORMAT_DATE(l_prod.SaleEnd));
                   END IF;
                   DBMS_OUTPUT.PUT_LINE(chr(1));
            END LOOP;
           END LOOP;
           CLOSE cur_dept;
         ELSIF (dept_name = 'All') THEN
             FOR l_dept in cur_dept LOOP
                   DBMS_OUTPUT.PUT_LINE(l_dept.DeptName);
                   DBMS_OUTPUT.PUT_LINE(i_1||l_dept.DeptDesc);
                   DBMS_OUTPUT.PUT_LINE(chr(1));
              FOR l_prod in cur_prod LOOP
                   DBMS_OUTPUT.PUT_LINE(i_2||l_prod.ProductName);
                   DBMS_OUTPUT.PUT_LINE(i_3||SUBSTR(l_prod.Description,1,70));
                   DBMS_OUTPUT.PUT_LINE(i_4||'Price -  '||FORMAT_DOLLARS(l_prod.Price));
                   IF l_prod.SaleStart IS NOT NULL THEN
                   DBMS_OUTPUT.PUT_LINE(i_4||'Sale runs from '||FORMAT_DATE(l_prod.SaleStart)||' until '||FORMAT_DATE(l_prod.SaleEnd));
                   END IF;
                   DBMS_OUTPUT.PUT_LINE(chr(1));
            END LOOP;
           END LOOP;
           CLOSE cur_dept;
         ELSE
          DBMS_OUTPUT.PUT_LINE('No department found with name '||dept_name);
         END IF;
         END LIST_DEPT_PRODUCTS;
    Oh also if someone could tell me how to format DBMS_OUTPUT. Put_line so that I could dash in some lines that would be great. Did not work as I did.

    Thank you!

    Published by: user10915730 on April 18, 2009 07:48

    Published by: user10915730 on April 18, 2009 07:48

    Hello

    In the ELSIF clause, you must open the cursor. For dash maybe you can use:

    Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
    Connected as hr
    
    SQL>
    SQL> SET SERVEROUTPUT ON
    SQL> DECLARE
      2
      3     FUNCTION fnc_indent(nTimes IN NUMBER) RETURN VARCHAR2 IS
      4        v_result VARCHAR2(4000);
      5        c_tab CONSTANT VARCHAR2(1) := chr(9);
      6     BEGIN
      7        FOR i IN 1 .. nTimes LOOP
      8           v_result := v_result || c_tab;
      9        END LOOP;
     10        RETURN v_result;
     11     END fnc_indent;
     12
     13  BEGIN
     14     DBMS_OUTPUT.put_line(fnc_indent(1) || 'hello');
     15     DBMS_OUTPUT.put_line(fnc_indent(2) || 'hello');
     16     DBMS_OUTPUT.put_line(fnc_indent(3) || 'hello');
     17  END;
     18  /
    
         hello
              hello
                   hello
    
    PL/SQL procedure successfully completed
    
    SQL> 
    

    Kind regards

  • Error: PLS-00306: wrong number or types of arguments

    Hello

    I created a function:

    create or replace procedure AS Test11
    x Test.Emp_No%Type;
    Begin
    Select emp_no in x from Test whose name = 'South '.
    x: = x + 1;
    Update Test set emp_no = x where emp_no < 100;
    commit;
    end Test11;

    It has compiled with success in PL/SQL Developer. Now, I created an executable of this procedure in front-end - 11i. And then I created a program of this executable. Then I added this program to a group of application.

    Now that I run this query and I get this error in the log:

    Error ORACLE 6550 in FDPSTP

    Cause: FDPSTP failed due to the ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in the call to 'TEST11 '.
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    .

    Hello
    Whenever you save a function, or a PL/SQL procedure as a simultaneous program to apps, you must
    to add two parameters of type varchar2 (errbuf and retcode) Moreover to your settings.
    If you change procedure as follows:

    create or replace procedure Test11(errbuf   out varchar2,
                                       retcode out varchar2) AS
    x Test.Emp_No%Type;
    Begin
    select emp_no into x from Test where name = 'Sud';
    x := x + 1;
    update Test set emp_no = x where emp_no < 100;
    commit;
    end Test11;
    

    Published by: Anthony Alix on December 3, 2008 05:20

    Published by: Anthony Alix on December 3, 2008 05:25

    Published by: Anthony Alix on December 3, 2008 05:35

  • ApexExport 06550 PLS-00306: wrong number or types of arguments

    My work of ApexExort was running great until about a month and I can't pinpoint the problem.  If I run it in production, I get the following error.  However if I run it on my localhost even exact script works very well.

    Exception in thread "main" java.sql.SQLException: ORA-06550: line 2, column 12:

    PLS-00306: wrong number or types of arguments in the call to 'EXPORT_APPLICATION_TO_CLOB '.

    ORA-06550: line 2, column 5:

    Set ORACLE_HOME=C:\Oracle\product\11.2.0\dbhome_1

    set CLASSPATH = % CLASSPATH statement; \;%O RACLE_HOME%\jdbc\lib\ojdbc5.jar;%apexExportJavaDir%

    set PATH = % PATH %; \;%O RACLE_HOME%\Bin

    JAVAHOME value = C:\Program Files\Java\jdk1.8.0_45

    Set startRunLocation = \\mgasan2\hdrive\ATS_Working\Scott_Working\PROD_SCRIPTS\APEX_APP_BKUP

    CD C:\apex_4.2\utilities

    All applications to export REM

    Java oracle.apex.APEXExport - db %oracleHost%:%oraclePort%/%OracleServiceName%-utilisateur % oracleUser %-% oracleSystemPass %-forum password




    < gphmh >

    Thanks for your suggestion of Kiran, but I understood what my problem was.  The APEX version in our database is older: 4.1.1.00.23 and I have been using a version 4.2 utilities apex when I should have used the C:\apex_4.1.1_en\apex\utilities

    CD C:\apex_4.2\utilities

    C:\apex_4.1.1_en\apex\utilities


    For the record, here's what worked for me...


    Set apexExportJavaDir=C:\apex_4.1.1_en\apex\utilities

    Set apexHtmlFileName = apex_info.html

    BackupLocation = c:\PROD_SCRIPTS\APEX_APP_BKUP\OUTPUT\TEST set

    Set ORACLE_HOME=C:\Oracle\product\11.2.0\dbhome_1

    set CLASSPATH = % CLASSPATH statement; \;%O RACLE_HOME%\jdbc\lib\ojdbc5.jar;%apexExportJavaDir%

    set PATH = % PATH %; \; C:\Program Files (x 86) \Java\jre7\bin

    Set startRunLocation = c:\PROD_SCRIPTS\APEX_APP_BKUP

    FIXED % apexExportJavaDir %

    Java oracle.apex.APEXExport - db %oracleHost%:1521/%OracleServiceName%-utilisateur % oracleUser %-% oracleSystemPass %-forum password

  • a wrong number or types of arguments in the call to and

    Hello

    Description: problem connecting to a database of the relationship of the processor of the NDA.

    I want to enrich the incoming events with available data in the relational database. As stipulated in the Oracle® CEP Administrator's Guide, I created the

    Data source JDBC in queue server configuration (config.xml). As he didn't throw me any error while staring at the server, I guess, the data source is fine.

    I followed the steps below:

    1 creation of the types of events in my context.xml in my application (fields in my paintings are shown as the property).

    < wlevs:event - type the type name = "walletMonitoringEvent" >

    < wlevs:properties >

    <! - walletkey in db is of type varchar - >

    < name wlevs:property = "walletkey" type = 'char []' length = "20" / >

    < / wlevs:properties >

    < / wlevs:event - type >

    2 create a "table" in context.xml

    < wlevs:table - event type = "walletMonitoringEvent" id = "walletMonitoring" data source = "walletDataSource" / >

    3. added the table source in my processor.

    < wlevs: channel id = "inputChannel" - type of event = "WalletEvent" >

    < wlevs:listener ref = "walletProcessor" / >

    < / wlevs: channel >

    4. has tried to link the database to the CQL processor.

    " < = xmlns:wlevs wlevs:config ' http://www.BEA.com/ns/wlevs/config/application "xmlns:jdbc =" " http://www.Oracle.com/ns/OCEP/config/JDBC "> "

    < processor >

    < name > walletProcessor < / name >

    < rules >

    < request id = "F1" >

    <! [CDATA]

    Select i.walletkey, i.createdDate in inputChannel as I, walletMonitoring w

    where i.walletkey = w.walletkey

    []] >

    < / query >

    < / rules >

    < / processor >

    < / wlevs:config >

    I get the error in the logs when I try to deploy the project below:

    < 17 November 2014 13:46:16 THIS > < emergency > < CQLServer > < BEA-000000 > < CREATE QUERY AS F1

    Select i.walletkey, i.createdDate in inputChannel as I, walletMonitoring w

    where > > i.walletkey = w.walletkey < <

    a wrong number or types of arguments in the call to and. Check the spelling of the registered service. Also confirm that his appeal is correct and its settings are correct data types. >

    < 17 November 2014 13:46:16 THIS > < emergency > < CQLServerTrace > < BEA-000000 > < oracle.cep.exceptions.CEPException: number or types of arguments in the call to and wrong >

    < 17 November 2014 13:46:16 THIS > < error > < CQLProcessor > < BEA-000000 > < unable to create the declaration [F1].

    Invalid statement: "select i.walletkey, i.createdDate from inputChannel as I, walletMonitoring w.

    "where > > i.walletkey = w.walletkey < < '.

    Description: a wrong number or types of arguments in the call to and

    Cause: This error occurs when the named function call cannot be matched to any declaration for this function name. The function name can be spelled, a parameter can have the wrong data type, or the function declaration may be faulty

    Action: Check the spelling of the registered service. Also confirm that his appeal is correct and its settings are correct data types. >

    < 17 November 2014 13:46:16 THIS > < error > < deployment > < BEA-2045013 > < the context of the "updateWallet" application could not be started. The cause is:

    Invalid statement: "select i.walletkey, i.createdDate from inputChannel as I, walletMonitoring w.

    "where > > i.walletkey = w.walletkey < < '.

    Description: a wrong number or types of arguments in the call to and

    Cause: This error occurs when the named function call cannot be matched to any declaration for this function name. The function name can be spelled, a parameter can have the wrong data type, or the function declaration may be faulty

    Action: Check the spelling of the registered service. Also confirm that his appeal is correct and its settings are correct data types. >

    Hi Siva,

    It seems the event type walletkey property is set incorrectly. Please try to set the event as follows:

    Use "char" instead of "char []."

    Best regards

    Sandeep

  • PLS-00306: wrong number or types of arguments in the call to 'XXC_AMOUNT' ORA-06550

    Hi all

    CREATE OR replace PROCEDURE Xxc_amount (v_item_id IN NUMBER,

                                             v_amount  OUT NUMBER,

                                             v_size    OUT NUMBER)

    IS

      v_size   NUMBER := NULL;

    v_amount NOMBRE;

    START

        BEGIN

    CHOOSE conversion_rate

            INTO   v_size

    FROM mtl_uom_class_conversions

            WHERE  inventory_item_id = v_item_id -- 2289;

            v_amount := Nvl (Trunc (v_size), 0);

    -RETURN (cp_cartons);

        EXCEPTION

            WHEN OTHERS THEN

              v_size := 0;

              dbms_output . Put_line ()' Error getting Item Id:'| V_ITEM_ID );

        END ;

    dbms_output. Put_line ('Qty-->' || v_amount );

    dbms_output. Put_line ('Qty1-->'|| v_size );

    END ;

    DECLARE

        amount NUMBER;

        v_size NUMBER;

    START

        Xxc_amount (2289, amount, v_size);

    dbms_output. Put_line (amount || '--' || v_size );

    END ;

    ORA-06550: line 5, column 5:

    PLS-00306: wrong number or types of arguments in the call to 'XXC_AMOUNT '.

    ORA-06550: line 5, column 5:

    PL/SQL: Statement ignored

    Thank you

    Post edited by: 994122 changed the name of the procedure to Xxc_amount Xxc_amount1

    Simply remove the declarations of the v_size and v_amount and it should work.

    The following text compiles and works for me when I call:

    CREATE OR replace PROCEDURE Xxc_amount (v_item_id IN NUMBER,
                                            v_amount  OUT NUMBER,
                                            v_size    OUT NUMBER)
    IS
    BEGIN
        BEGIN
            SELECT conversion_rate
            INTO  v_size
            FROM  mtl_uom_class_conversions
            WHERE  inventory_item_id = v_item_id; -- 2289;
            v_amount := Nvl (Trunc (v_size), 0);
        --RETURN (cp_cartons);
        EXCEPTION
            WHEN OTHERS THEN
              v_size := 0;
              dbms_output.Put_line ('Error in Getting for Item Id :'|| v_item_id);
        END;
        dbms_output.Put_line ('Qty-->' || v_amount);
        dbms_output.Put_line ('Qty1-->'|| v_size);
    END;
    
    DECLARE
        amount NUMBER;
        v_size NUMBER;
    BEGIN
        Xxc_amount (2289, amount, v_size);
        dbms_output.Put_line (amount || '--' || v_size);
    END;
    

Maybe you are looking for

  • DreamColor LP2480zx does not recognize the USB for calibration

    Hello I have a DreamColor LP2480zx, which does not recognize the USB connection to the computer during calibration.  I have my eye HP connected through this monitor, so I know the connection and the cable is good and mouse, keyboard.  My setup is lik

  • Need to UI suggestions / ideas add to menus

    I'm an old hand at LabVIEW, but I've never used menus of LabVIEW. Here's what I (and my client) want to do: Imagine a control TAB, Page 1, Page 2, Page 3. On page 1 is a chart, with perhaps an empty space. On page 2 is a set of the channel selector s

  • blue screen BAD_HEADER_POOL 0 x 00000019 (0x00000020, 0xe3498230, 0xe3498268, 0x0c070420)

    We started to have this blue screen with these error codes, can anyone help us with that?  We had a power surge, a loss of power, and the next blue screen this day began to appear.  Anyone got any ideas?

  • Scrolling Background Image

    Hi all I added the background image on the screen, but the problem is, if I scroll the background image Monte and the white screen appears in the background .is there anyway to scroll to the bottom of the background image Concerning Yogi

  • Dynamic to static IPSec with certificate-based authentication

    I'm trying to implement a dynamic to static LAN2LAN vpn from an ASA 5505 (with a dynamic IP address) to an ASA5520 (with a static IP address)I wish I had a small (/ 30) network on the side dynamics which I can connect to a larger (/ 24) network on th