Passing array to pl/sql procedure - pls-00306 wrong number/types of args

its oracle 10.2 database;
I have a procedure with array parameters based on simple sql types.
eg
create or replace type vt_attrname is table of varchar2(50);
Now my call to the procedure works when the array is empty;
as soon as I bulk collect into my local array, I get a compilation error.
eg
declare
my_array  vt_attrname;
begin
select label
  bulk collect
  into my_array
  from table_name
where 1=1;
my_proc(p_array=>my_array);  -- syntax error
end;if I pass null the call works but obviously array is empty.
I have read something about varray's being incompatible between sqltypes and pl/sql.
How do I get around this problem?
The bulk collect is working okay.
A small example would be appreciated.

Yep, I spotted the syntax error earlier.
However even though that seems to compile ok, I still get the problem with my package call.
heres the actual call from the code
vt_attrname and vt_attrvalues are types declared on another schema.
I have redeclared them on the current schema now.
create or replace type vt_attrname is table of varchar2(50);
create or replace type vt_attrvalue is table of varchar2(500);
create procedure <name>
as
v_cardapplattrtag   vt_attrname;
v_cardapplattrvalue vt_attrvalue;
  for cardappl_cur in
    (select cardappl_id 
       from ci_cardappl
      where custcard_id = cur.document_logical_number)
    loop
    select label
      bulk collect
      into v_cardapplattrtag
      from ci_applver_attribute
      where applver_id = v_applver_id;
      v_array_size := v_cardapplattrtag.count;
    -- populate this array
    -- ppt_cardapplattrtag comes from ci_pplver_attribute
    --ppt_cardapplattrvalue -- various
cci_setcardappl.SetCardApplAttrValue(
          pn_cardappl_id                 =>     cardappl_cur.cardappl_id,
          ppt_cardapplattrtag     =>      v_cardapplattrtag, -- works when null
          ppt_cardapplattrvalue   =>     NULL,
          pn_cardapplattrsize     =>     v_array_size,
          pv_arn                  =>     cur.application_request_id,
          pv_commit               =>    'FALSE');and the procedure protototype is
PROCEDURE SetCardApplAttrValue(
          pn_cardappl_id           IN     NUMBER,
          ppt_cardapplattrtag     IN     VT_BPATTRNAME DEFAULT NULL,
          ppt_cardapplattrvalue   IN     VT_BPATTRVALUE DEFAULT NULL,
          pn_cardapplattrsize     IN     NUMBER,
          pv_arn                  IN     VARCHAR2,
          pv_commit               IN     VARCHAR2 DEFAULT 'FALSE');Edited by: Keith Jamieson on Sep 23, 2009 10:42 AM

Similar Messages

  • SSRS Calling a Stored Procedure error : PLS-00306: wrong number or types of arg...

    Hi,
    My Problem is when im adding dataset with stored procedure, im getting this error.
    I Can access database, 
    Could not create a list of fields for the query. Verify that you can connect to the data source and that your query syntax is correct.
    ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'PROCEDURE_NAME' ORA-06550: line 1, column 7: PL/SQL:
    Statement ignored
    stored procedure is simple select :
    CREATE OR REPLACE PROCEDURE [PROCEDURE_NAME](L_CURSOR out SYS_REFCURSOR)
    is
    Begin
    open L_CURSOR for
    SELECT [columnname] FROM
    [tablename]
    End;
    Configuration Details:
    DB: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64biOracle Developer Tools for Visual Studio Copyright (c) 2005,2014 SQL Server Data Tools Type: Oracle , Data Provider : .Net Framework Data Provider For Oracle

    The answer is of inside question. It is about provider. Change my provider ODTwithODAC for 10g (my database version). And problem resolved.
    Thank you for your helps,
    Regards,
    Arda

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

    now i am using oracle10g xe , i get the following error
    create or replace procedure proc_name(slno_in in number,
    name_out out varchar2,fee_out out number)
    is
    v_name student.name%type;
    v_fee student.fee%type;
    begin
    select name,fee into v_name,v_fee from
    student where slno=slno_in;
    name_out := v_name;
    fee_out := v_fee;
    end proc_ref;
    Procedure created.
    SQL> exec proc_name(1);
    BEGIN proc_ref(1); END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'PROC_REF'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    please help me

    You have a procedure with three arguments
    >
    create or replace procedure proc_name(slno_in in number,
    name_out out varchar2,fee_out out number)You then call it by providing one argument
    >
    SQL> exec proc_name(1);
    BEGIN proc_ref(1); END;
    You get an error saying wrong number of arguments.
    PLS-00306: wrong number or types of arguments in call to 'PROC_REF'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    I don't see how it can be any clearer, call the procedure with three arguments.
    var string varchar2(100)
    var num number
    exec proc_ref(1, :string, :num)

  • PLS-00306: wrong number or types of arguments in call in a for loop

    Dear all
    I recently put up another post about the same error message but as the message now relates to another part of my programme and, in my mind at least, a different conceptual idea, I thought I should start a new top. If that is not right thing to have done then please let me know. I am working in 10.2.
    I am trying to pass through multiple variables. When I run the code at the end of this question I get an error message:
    PLS-00306: wrong number or types of arguments in call to 'CUR_MAP_LIST'This relates to the line:
    FOR var_map_list IN cur_map_list (par_map_list (n))I think the reason the error message comes up is because par_map_list is a associate array / PL/SQL table and cur_map_list is based on %rowtype. Although I could be wrong. However I am not sure what I should be doing so that I don't get such an error message.
    I was reading through page 623 on Web Development 9i (by Brown; pub. McGrew-Hill) and pages 357-358 of Oracle Web Application Programming for PL/SQL Developers (by Boardman, Caffrey, Morse, Rosenzweig; pub. Prentice Hall), in order to try and write my code. As well as Oracle's Application Developer’s Guide - Fundamentals (Release 2), page 11-6. In particular the Web Development book uses the following:
    create or replace procedure query_department
    (in_dept_no owa_util.ident_arr)
    is
    cursor dept_cursor (nbt_dept_no emp.deptno%TYPE) is
    select empno, ename, mgr, sal, comm
    from scott.emp
    where deptno = nbt_dept_no;
    begin
      for x in 1 .. in_dept_no.count loop
        for dept_rec in dept_cursor(in_dept_no (x)) loop
        end loop;
      end loop;
    end;In that example the cursor selects empno, ename, mgr, sal and comm from emp. So if it is doing that the cursor must be of a VARCHAR2 and NUMBER data type. What I don't understand is the for dept_rec in part. For a start I am not sure where dept_rec comes from? If it is a NUMBER data type, how can the in_dept_no, which is a owa_util.ident_arr associate array / PL/SQL data type work with it. Unfortunately because the example is incomplete and doesn't include procedures relating to the in variables, I am unable to run it and try and learn from what it is doing, so that I can try and relate the concept to my own work.
    My programme is as follows. There may be other errors in the code not relating to this error. If so I hope to find these and resolve them once I understand what I should be doing here:
    --Global variables--
    gvar_mapviewer_host VARCHAR2(56) := 'http://tiger.iso.port.ac.uk:7785/mapviewer/omserver';
    gvar_proc_host VARCHAR2(56) := 'http://tiger.iso.port.ac.uk:7785/www/geg50160';
    gvar_xml_request VARCHAR2(100) :='?xml_request=<?xml version="1.0" standalone="yes"?>';
    --Main calling programming--
    PROCEDURE MAPS AS
    empty owa_util.ident_arr;
    var_xml_theme VARCHAR2(32767);
    BEGIN
    PROCMAPLIST (empty, var_xml_theme);
    END maps;
    --create checkboxes--
    PROCEDURE PROCCHECKLIST
    (par_check_list IN OUT owa_util.ident_arr,
      par_xml_theme OUT VARCHAR2
      AS
       CURSOR cur_map_list IS
        SELECT MT.map_title
               MI.map_id
               OMSN.map_sheet_number_id
               WRMF.web_raster_map_id
         FROM MAP_TITLE MT
              MAP_INFO MI
              MAP_SHEET_NUMBER OMSN,
              WEB_RASTER_MAP_FILE WRMF,
          WHERE MI.map_title_id = MT.map_title_id
          AND   MI.map_id = OMSN.map_id
          AND   WRMF.map_id = MI.map_id
          AND   WRMF.map_sheet_number_id = OMSN.map_sheet_number_id;
        var_map_list cur_map_list%ROWTYPE;
        var_xml_theme VARCHAR2(32767);
    BEGIN
    htp.htmlOpen;
    htp.headOpen;
    htp.headClose;
    htp.bodyOpen;
    htp.print('<FORM METHOD = "post"
                     ACTION = "'||gvar_proc_host||'.mappackage.procdisplay">');
        htp.print('<FIELDSET>
                     <LEGEND> Select the maps you wish to display </LEGEND>');
      FOR n IN 1 .. par_map_list.COUNT
      LOOP
      FOR var_map_list IN cur_map_list (par_map_list (n))
      LOOP
    htp.print('       <UL>
                       <LI>
                        <LABEL FOR = "WRMF'||
                                      var_map_list.web_raster_map_id||'">
                         <INPUT type = "checkbox"
                                id = "WRMFB'||
                                      var_map_list.web_raster_map_id||'"
                                name = "WRMFB'||
                                        var_map_list.web_raster_map_id||'"
                                value = "'||var_map_list.web_raster_map_id||'"
                                />
                                 Map title: '|| var_map_list.map_title||'<BR>
                                 Sheet number: '||var_map_list.map_sheet_number||'');
                        htp.print('</LABEL>
                       </LI>
                      </UL>');
        END LOOP;
      END LOOP;
         htp.print('</FIELDSET>');
         htp.print('<p>
                     <INPUT TYPE = "submit"
                            NAME = "Display&nbspselected&nbspmaps"
                            VALUE = "Display selected maps" />
                      </FORM>');
    htp.bodyClose;
    END PROCCHECKLIST;Thank you for reading. Kind regards
    Tim

    Dear everyone
    I have now resolved the problems I was having with multiple values and checkboxes, thanks to comments in this thread, read large chucks of Oracle PL/SQL Programming by Steve Feuerstein and suddenly realising where I am going wrong in terms of thinking.
    For a start, I when I was dealing with the multiple values, I was trying to get PL/SQL to pass them out. Of course this is done by the action part of the input form. Although I have not done much web coding, I did know about this. However because I was so engrossed in trying to understand how multiple values work, I didn't relate the two ideas. I even mind mapping the problem and still didn't get it.
    I also did not think to change my the action from post command to get, so that I could see what was coming out. However that would not have made too much of a difference because the other problem I had was related to where sub programmes were declared. The function which received the values was privately declared, and not in the package spec. This meant the web browser could not find the function as that can only make use of the programmes declared publicly.
    Once I made these changes, as well as correcting other minor typing mistakes, the values passed through as expected. The only other mistake I made was to include the name option after the submit input type. In my case I did not need to submit the value of that button. The revised code is as follows. In this version I replaced the function with a procedure that simply prints the checkbox values to screen. I have also made the input form action get, instead of post, so that the values can be seen in the web browser address bar:
    create or replace
    PACKAGE MAPSITE AS
    PROCEDURE MAPS;
    PROCEDURE PROCCHECKLIST
    (par_check_list IN OUT OWA_UTIL.IDENT_ARR
    PROCEDURE PROCDISPLAY
    (maplist IN OUT OWA_UTIL.IDENT_ARR);
    END MAPSITE;
    create or replace
    PACKAGE BODY MAPSITE AS
    --Global variables--
    gvar_mapviewer_host VARCHAR2(56) := 'http://tiger.iso.port.ac.uk:7785/mapviewer/omserver';
    gvar_proc_host VARCHAR2(56) := 'http://tiger.iso.port.ac.uk:7785/www/geg50160';
    gvar_xml_request VARCHAR2(100) :='?xml_request=<?xml version="1.0" standalone="yes"?>';
    --Main calling programming--
    PROCEDURE MAPS AS
    empty owa_util.ident_arr;
    BEGIN
    PROCCHECKLIST (empty);
    END MAPS;
    --create checkboxes--
    PROCEDURE PROCCHECKLIST
    (par_check_list IN OUT owa_util.ident_arr
      AS
       CURSOR cur_map_list IS
        SELECT MT.map_title,
               MI.map_id,
               OMSN.map_sheet_number_id,
               WRMF.web_raster_map_id
         FROM MAP_TITLE MT,
              MAP_INFO MI,
              MAP_SHEET_NUMBER OMSN,
              WEB_RASTER_MAP_FILE WRMF
          WHERE MI.map_title_id = MT.map_title_id
          AND   MI.map_id = OMSN.map_id
          AND   WRMF.map_id = MI.map_id
          AND   WRMF.map_sheet_number_id = OMSN.map_sheet_number_id;
    BEGIN
    htp.htmlOpen;
    htp.headOpen;
    htp.headClose;
    htp.bodyOpen;
    htp.print('<FORM METHOD = "post"
                     ACTION = "'||gvar_proc_host||'.mappackage.procdisplay">');
        htp.print('<FIELDSET>
                     <LEGEND> Select the maps you wish to display </LEGEND>');
      FOR var_map_list IN cur_map_list
      LOOP
    htp.print('       <UL>
                       <LI>
                        <LABEL FOR = "WRMF'||
                                      var_map_list.web_raster_map_id||'">
                         <INPUT type = "checkbox"
                                id = "WRMFB'||
                                      var_map_list.web_raster_map_id||'"
                                name = "maplist"
                                CHECKED = "' ||
                                           par_map_list ||'"
                                value = "'||var_map_list.web_raster_map_id||'"
                                />
                                 Map title: '|| var_map_list.map_title||'<BR>
                                 Sheet number: '||var_map_list.map_sheet_number||'');
                        htp.print('</LABEL>
                       </LI>
                      </UL>');
        END LOOP;
         htp.print('</FIELDSET>');
         htp.print('<p>
                     <INPUT TYPE = "submit"
                            VALUE = "Display selected maps" />
                      </FORM>');
    htp.bodyClose;
    END PROCCHECKLIST;
    ---PROCDISPLAY PROCEDURE---
    PROCEDURE PROCDISPLAY (maplist IN OUT owa_util.ident_arr)
    IS
    BEGIN
    FOR n IN 1..maplist.COUNT
    LOOP
      htp.print('Checkbox value i.e. var_map_list.web_raster_map_id is: ' ||maplist(n)||'
    <P>');
    END LOOP;
    END PROCDISPLAY;
    END MAPSITE;Kind regards
    Tim

  • Java Applet in a HTML page: failing with PLS-00306: wrong number of args

    We are trying to use a Java Applet in a HTML page. as our system needs to be able to retrieve a predefined set of data from a third party system that uses Dynamic Data Exchange Protocol (DDE) and are encountering errors from APEX and in IE itself.
    We are using JavaDde from www.nevaobject.com that enables our Java applet to interact with Windows applications (Third Party System) using DDE.
    This functionality is currently used in our Web Form 6i application and we are trying to use the same in the new ApEx application.
    We are using ApEx version : 2.1 and actually aer encountering 2 problems:
    Problem 1: ApEx failing with PLS-00306: wrong number or types of arguments in call to 'ACCEPT'
    Problem 2: IE crashes if Applet used in a complex page with several regions (1 Context, 4 Report Regions, 2 level Tabs, Links)
    This problem does not occur in the page where there is only applet and one region. In the case of complex page the IE crashes if the page is reloaded
    Test scenario:
    1- Create a simple page with the HTML region.
    2- Define the Source of the above region as follows
    <OBJECT CLASSID="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    CODEBASE="http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab#version=1,4,0,0"
    WIDTH="1"
    HEIGHT="1"
    ID="simpleApplet"
    NAME="simpleApplet">
    <PARAM NAME="code" VALUE="simpleApplet.class" >
    <PARAM NAME="archive" VALUE="simpleApplet.jar" />
    <PARAM NAME="type" VALUE="application/x-java-applet;version=1.4">
    </OBJECT>
    3- Create a simple Java applet "simpleApplet" - for the test its enough if the applet will have just the init method printing out the mesage to the console
    4- Create a Submit Button (not redirect) in Region Header and create unconditional (do not set When Button Pressed property) Page Branch to navigate to another page (the page without the applet)
    6- Run the page and Submit -
    The error below is returned by the engine:
    In our case our applet is called ddeApplet - I do not know why is ApEx passing the Applet's ID down to the wwv_flow.accept method as a parameter
    Tue, 24 Jul 2007 08:15:39 GMT
    ORA-06550: line 7, column 2:
    PLS-00306: wrong number or types of arguments in call to 'ACCEPT'
    ORA-06550: line 7, column 2:
    PL/SQL: Statement ignored
    DAD name: rbdev2_ax
    PROCEDURE : wwv_flow.accept
    URL : http://castor:7778/pls/rbdev2_ax/wwv_flow.accept
    PARAMETERS :
    ============
    P_FLOW_ID:
    147
    P_FLOW_STEP_ID:
    500
    P_INSTANCE:
    6986070096861669560
    P_PAGE_SUBMISSION_ID:
    1005758
    P_REQUEST:
    CRASH
    P_ARG_NAMES:
    100380029717786501
    P_T01:
    147
    P_T02:
    101
    P_T03:
    5000044
    P_T04:
    1
    P_T05:
    S
    DDEAPPLET:
    Ddeapplet[panel0,0,0,1x1,layout=java.awt.BorderLayout,rootPane=javax.swing.JRootPane[,0,0,1x1,layout=javax.swing.JRootPane$RootLayout,alignmentX=null,alignmentY=null,border=,flags=385,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
    P_MD5_CHECKSUM:
    ENVIRONMENT:
    ============
    PLSQL_GATEWAY=WebDb
    GATEWAY_IVERSION=2
    SERVER_SOFTWARE=Oracle HTTP Server Powered by Apache/1.3.19 (Unix) mod_fastcgi/2.2.10 mod_perl/1.25 mod_oprocmgr/1.0
    GATEWAY_INTERFACE=CGI/1.1
    SERVER_PORT=7778
    SERVER_NAME=castor
    REQUEST_METHOD=POST
    QUERY_STRING=
    PATH_INFO=/pls/rbdev2_ax/wwv_flow.accept
    SCRIPT_NAME=/pls
    REMOTE_HOST=
    REMOTE_ADDR=192.168.66.169
    SERVER_PROTOCOL=HTTP/1.1
    REQUEST_PROTOCOL=HTTP
    REMOTE_USER=
    HTTP_CONTENT_LENGTH=661
    HTTP_CONTENT_TYPE=application/x-www-form-urlencoded
    HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
    HTTP_HOST=castor:7778
    HTTP_ACCEPT=image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*
    HTTP_ACCEPT_ENCODING=gzip, deflate
    HTTP_ACCEPT_LANGUAGE=en-us
    HTTP_ACCEPT_CHARSET=
    HTTP_COOKIE=ISCOOKIE=true; LOGIN_USERNAME_COOKIE=rdanko; ORACLE_PLATFORM_REMEMBER_UN=RDANKO:ngrb; WWV_FLOW_USER2=70FBB00945FE46B9; V6_AUTHENTICATION_COOKIE=70FBB00945FE46B9
    Authorization=
    HTTP_IF_MODIFIED_SINCE=
    HTTP_REFERER=http://castor:7778/pls/rbdev2_ax/f?p=147:500:6986070096861669560:::::
    HTTP_SOAPACTION=

    "theArrow",
    It looks like whatever HTML you're including on your page is creating HTML input form elements inside the HTML form "wwv_flow". This form is posted to wwv_flow.accept, and of course, the PL/SQL procedure wwv_flow.accept doesn't know anything these additional arguments/form elements you're attempting to POST.
    Joel

  • Pl. help debug - PLS-00306: wrong number or types of arguments in call

    Hi,
    I am trying to create a wrapper function to all a procedure in Oracle EBusiness Suite 11i.
    When I compile the following code
    ==========
    CREATE OR REPLACE PROCEDURE gme.KIL_ProcessAlloc IS
    vFileName VARCHAR2(30) := '1006251.csv';
    vLoc VARCHAR2(20) := '/u041/applmgr/opm/opmappl/utllog';
    v_InHandle utl_file.file_type;
    vNewLine VARCHAR2(1000);
    vLineNo PLS_INTEGER;
    c1 PLS_INTEGER;
    c2 PLS_INTEGER;
    c3 PLS_INTEGER;
    c4 PLS_INTEGER;
    c5 PLS_INTEGER;
    c6 PLS_INTEGER;
    c7 PLS_INTEGER;
    c8 PLS_INTEGER;
    c9 PLS_INTEGER;
    c10 PLS_INTEGER;
    c11 PLS_INTEGER;
    c12 PLS_INTEGER;
    c13 PLS_INTEGER;
    c14 PLS_INTEGER;
    c15 PLS_INTEGER;
    c16 PLS_INTEGER;
    c17 PLS_INTEGER;
    c18 PLS_INTEGER;
    c19 PLS_INTEGER;
    c20 PLS_INTEGER;
    c21 PLS_INTEGER;
    c22 PLS_INTEGER;
    c23 PLS_INTEGER;
    c24 PLS_INTEGER;
    c25 PLS_INTEGER;
    c26 PLS_INTEGER;
    c27 PLS_INTEGER;
    c28 PLS_INTEGER;
    c29 PLS_INTEGER;
    c30 PLS_INTEGER;
    c31 PLS_INTEGER;
    c32 PLS_INTEGER;
    c33 PLS_INTEGER;
    c34 PLS_INTEGER;
    TYPE AllocArray IS TABLE OF GME_INVENTORY_TXNS_GTMP%ROWTYPE
    INDEX BY BINARY_INTEGER;
    l_Allocdata AllocArray;
    TYPE MtlDetailArray IS TABLE OF gme_material_details%ROWTYPE
    INDEX BY BINARY_INTEGER;
    l_MtlDetaildata MtlDetailArray;
    TYPE xTranArray IS TABLE OF GME_INVENTORY_TXNS_GTMP%ROWTYPE
    INDEX BY BINARY_INTEGER;
    l_xtrandata xTranArray;
    TYPE defTranArray IS TABLE OF GME_INVENTORY_TXNS_GTMP%ROWTYPE
    INDEX BY BINARY_INTEGER;
    l_deftrandata defTranArray;
    t_messagecount number;
    t_messagelist varchar2(10000);
    t_returnstatus varchar2(1);
    BEGIN
    v_InHandle := utl_file.fopen(vLoc, vFileName, 'r');
    vLineNo := 1;
    LOOP
    BEGIN
    utl_file.get_line(v_InHandle, vNewLine);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    EXIT;
    END;
    vNewLine := TRANSLATE(vNewLine, 'A''', 'A');
    c1 := INSTR(vNewLine, ',', 1,1);
    c2 := INSTR(vNewLine, ',', 1,2);
    c3 := INSTR(vNewLine, ',', 1,3);
    c4 := INSTR(vNewLine, ',', 1,4);
    c5 := INSTR(vNewLine, ',', 1,5);
    c6 := INSTR(vNewLine, ',', 1,6);
    c7 := INSTR(vNewLine, ',', 1,7);
    c8 := INSTR(vNewLine, ',', 1,8);
    c9 := INSTR(vNewLine, ',', 1,9);
    c10 := INSTR(vNewLine, ',', 1,10);
    c11 := INSTR(vNewLine, ',', 1,11);
    c12 := INSTR(vNewLine, ',', 1,12);
    c13 := INSTR(vNewLine, ',', 1,13);
    c14 := INSTR(vNewLine, ',', 1,14);
    c15 := INSTR(vNewLine, ',', 1,15);
    c16 := INSTR(vNewLine, ',', 1,16);
    c17 := INSTR(vNewLine, ',', 1,17);
    c18 := INSTR(vNewLine, ',', 1,18);
    c19 := INSTR(vNewLine, ',', 1,19);
    c20 := INSTR(vNewLine, ',', 1,20);
    c21 := INSTR(vNewLine, ',', 1,21);
    c22 := INSTR(vNewLine, ',', 1,22);
    c23 := INSTR(vNewLine, ',', 1,23);
    c24 := INSTR(vNewLine, ',', 1,24);
    c25 := INSTR(vNewLine, ',', 1,25);
    c26 := INSTR(vNewLine, ',', 1,26);
    c27 := INSTR(vNewLine, ',', 1,27);
    c28 := INSTR(vNewLine, ',', 1,28);
    c29 := INSTR(vNewLine, ',', 1,29);
    c30 := INSTR(vNewLine, ',', 1,30);
    c31 := INSTR(vNewLine, ',', 1,31);
    c32 := INSTR(vNewLine, ',', 1,32);
    c33 := INSTR(vNewLine, ',', 1,33);
    c34 := INSTR(vNewLine, ',', 1,34);
    -- l_allocdata(vLineNo).sourceno := SUBSTR(vNewLine,1,c1-1);
    -- l_allocdata(vLineNo).sizeno := SUBSTR(vNewLine,c1+1,c2-c1-1);
    -- l_allocdata(vLineNo).status := SUBSTR(vNewLine,c2+1,c3-c2-1);
    -- l_allocdata(vLineNo).latitude := SUBSTR(vNewLine,c3+1,c4-c3-1);
    -- l_allocdata(vLineNo).longitude := SUBSTR(vNewLine,c4+1,c5-c4-1);
    -- l_allocdata(vLineNo).testfor := SUBSTR(vNewLine,c5+1);
    l_allocdata(vLineNo).trans_id := SUBSTR(vNewLine,1,c1-1);
    l_allocdata(vLineNo).item_id := SUBSTR(vNewLine,c1+1,c2-c1-1);
    l_allocdata(vLineNo).co_code := SUBSTR(vNewLine,c2+1,c3-c2-1);
    l_allocdata(vLineNo).orgn_code := SUBSTR(vNewLine,c3+1,c4-c3-1);
    l_allocdata(vLineNo).whse_code := SUBSTR(vNewLine,c4+1,c5-c4-1);
    l_allocdata(vLineNo).lot_id := SUBSTR(vNewLine,c5+1,c6-c5-1);
    l_allocdata(vLineNo).location := SUBSTR(vNewLine,c6+1,c7-c6-1);
    l_allocdata(vLineNo).doc_id := SUBSTR(vNewLine,c7+1,c8-c7-1);
    l_allocdata(vLineNo).doc_type := SUBSTR(vNewLine,c8+1,c9-c8-1);
    l_allocdata(vLineNo).doc_line := SUBSTR(vNewLine,c9+1,c10-c9-1);
    l_allocdata(vLineNo).line_type := SUBSTR(vNewLine,c10+1,c11-c10-1);
    l_allocdata(vLineNo).reason_code := SUBSTR(vNewLine,c11+1,c12-c11-1);
    l_allocdata(vLineNo).trans_date := SUBSTR(vNewLine,c12+1,c13-c12-1);
    l_allocdata(vLineNo).trans_qty := SUBSTR(vNewLine,c13+1,c14-c13-1);
    l_allocdata(vLineNo).trans_qty2 := SUBSTR(vNewLine,c14+1,c15-c14-1);
    l_allocdata(vLineNo).qc_grade := SUBSTR(vNewLine,c15+1,c16-c15-1);
    l_allocdata(vLineNo).lot_status := SUBSTR(vNewLine,c16+1,c17-c16-1);
    l_allocdata(vLineNo).trans_stat := SUBSTR(vNewLine,c17+1,c18-c17-1);
    l_allocdata(vLineNo).trans_um := SUBSTR(vNewLine,c18+1,c19-c18-1);
    l_allocdata(vLineNo).trans_um2 := SUBSTR(vNewLine,c19+1,c20-c19-1);
    l_allocdata(vLineNo).completed_ind := SUBSTR(vNewLine,c20+1,c21-c20-1);
    l_allocdata(vLineNo).staged_ind := SUBSTR(vNewLine,c21+1,c22-c21-1);
    l_allocdata(vLineNo).gl_posted_ind := SUBSTR(vNewLine,c22+1,c23-c22-1);
    l_allocdata(vLineNo).event_id := SUBSTR(vNewLine,c23+1,c24-c23-1);
    l_allocdata(vLineNo).text_code := SUBSTR(vNewLine,c24+1,c25-c24-1);
    l_allocdata(vLineNo).transaction_no := SUBSTR(vNewLine,c25+1,c26-c25-1);
    l_allocdata(vLineNo).action_code := SUBSTR(vNewLine,c26+1,c27-c26-1);
    l_allocdata(vLineNo).material_detail_id := SUBSTR(vNewLine,c27+1,c28-c27-1);
    l_allocdata(vLineNo).organization_id := SUBSTR(vNewLine,c28+1,c29-c28-1);
    l_allocdata(vLineNo).locator_id := SUBSTR(vNewLine,c29+1,c30-c29-1);
    l_allocdata(vLineNo).subinventory := SUBSTR(vNewLine,c30+1,c31-c30-1);
    l_allocdata(vLineNo).alloc_um := SUBSTR(vNewLine,c31+1,c32-c31-1);
    l_allocdata(vLineNo).alloc_qty := SUBSTR(vNewLine,c32+1,c33-c32-1);
    l_allocdata(vLineNo).def_trans_ind := SUBSTR(vNewLine,c33+1,c34-c33-1);
    vLineNo := vLineNo+1;
    END LOOP;
    utl_file.fclose(v_InHandle);
    FOR i IN 1..vLineNo-1 loop
    GME_API_PUB.insert_line_allocation (
         1,
         100,
         FALSE,
         True,
         l_allocdata(i),
         null,
         null,
         false,
         false,
         false,
         l_MtlDetailData,
         l_xtrandata,
         l_deftrandata,
         t_messagecount,
         t_messagelist,
         t_returnstatus);
    end loop;
         IF (t_returnstatus <> 'S') THEN
    for i IN 1 .. t_messagecount LOOP
    dbms_output.put_line('The text is '||FND_MSG_PUB.get(i,t_messagelist));
    END LOOP;
    END IF;
    -- COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
    RAISE;
    END KIL_ProcessAlloc;
    ===============
    I get this
    Warning: Procedure created with compilation errors.
    SQL> sho err
    Errors for PROCEDURE GME.KIL_PROCESSALLOC:
    LINE/COL ERROR
    145/8 PLS-00306: wrong number or types of arguments in call to
    'INSERT_LINE_ALLOCATION'
    145/8 PL/SQL: Statement ignored
    =================
    The package specs of GME_API_PU is under:
    ===============
    PROCEDURE insert_line_allocation (
    p_api_version IN NUMBER := gme_api_pub.api_version
    ,p_validation_level IN NUMBER := gme_api_pub.max_errors
    ,p_init_msg_list IN BOOLEAN := FALSE
    ,p_commit IN BOOLEAN := FALSE
    ,p_tran_row IN gme_inventory_txns_gtmp%ROWTYPE
    ,p_lot_no      IN     VARCHAR2 DEFAULT NULL
    ,p_sublot_no      IN     VARCHAR2 DEFAULT NULL
    ,p_create_lot     IN BOOLEAN DEFAULT FALSE
    ,p_ignore_shortage     IN BOOLEAN DEFAULT FALSE
    ,p_scale_phantom     IN BOOLEAN DEFAULT FALSE
    ,x_material_detail     OUT gme_material_details%ROWTYPE
    ,x_tran_row     OUT gme_inventory_txns_gtmp%ROWTYPE
    ,x_def_tran_row     OUT gme_inventory_txns_gtmp%ROWTYPE
    ,x_message_count OUT NUMBER
    ,x_message_list OUT VARCHAR2
    ,x_return_status     OUT VARCHAR2);
    GME_API_PUB.insert_line_allocation
    ===========
    What am I doing wrong...why am I getting PLS-00306.
    Can someone help?
    Thank you
    Sundar
    [email protected]

    Hi John,
    Thanks a ton - a nice Christmas gift. Thank you for being a Santa :-).
    I used the same subscript as the one used for in parameter and the procedure compiled without errors.
    A corollary: If (any of the) Out parameter is null (all columns of the row/array), will the array row element still be stored ? May be I cross the bridge when I come to it.
    Merry Christmas.
    Sundar

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

    Hi,
    This code call a procedure which takes a VARRAY type as parameter. I face this error
    when i compile the code.
    java.sql.SQLException: ORA-06550: Line 1, column 7 :
    PLS-00306: wrong number or types of arguments in call to 'p_proc'
    ORA-06550: Line 1, column 7 :
    PL/SQL: Statement ignored
    someone can tell what's wrong. Below, you have the source code used in this test case
    a sample code is welcome.
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.oracore.Util;
    import oracle.jdbc.*;
    import java.math.BigDecimal;
    public class ArrayExample3 {
    public static void main(String args[]) throws Exception {
    // Register the Oracle JDBC driver
    DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    // Connect to the database
    Connection conn =
    DriverManager.getConnection("jdbc:oracle:thin:@Anais:1521:BLB",
    "candide", "candide");
    // It's faster when auto commit is off
    conn.setAutoCommit(false);
    // create a new ARRAY object
    int elements[] = {300, 400, 500, 600};
    ArrayDescriptor desc = ArrayDescriptor.createDescriptor
    ("NUM_VARRAY", conn);
    ARRAY newArray = new ARRAY(desc, conn, elements);
    CallableStatement cs = conn.prepareCall("{call pe_cl2.p_proc(?)}");
    ( (OracleCallableStatement) cs).setArray(1, newArray);
    cs.executeUpdate();
    // Close all the resources
    cs.close();
    conn.close();
    CREATE OR REPLACE TYPE num_varray_t AS VARRAY(10) OF NUMBER;
    CREATE TABLE varray_table2 (col1 number);
    create or replace package candide.PE_CL2 is
    PROCEDURE p_proc(Id_clt IN num_varray);
    end PE_CL2;
    create or replace package body candide.PE_CL2 is
    PROCEDURE p_proc(Id_clt IN num_varray) IS
    BEGIN
    FORALL i IN Id_clt.FIRST .. Id_clt.LAST
    INSERT INTO varray_table2 VALUES (Id_clt(i));
    COMMIT;
    END;
    end PE_CL2;
    thanks Peter

    You create type num_varray_t, but in procedure your input parameter is of type num_varray. How this type is specified?

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

    i'm trying to pass multiple value to stored procedure and getting below error
    CREATE OR REPLACE TYPE STRINGTABLE AS TABLE OF VARCHAR2(4000);
    CREATE OR REPLACE
    PACKAGE  PKG_CUSTOMER  AS
    TYPE L_CURSOR IS REF CURSOR;
    PROCEDURE PROC_GET_CUSTOMER( P_SEARCH in STRINGTABLE, SELECTALL OUT L_CURSOR);
    END PKG_CUSTOMER  ;
    CREATE OR REPLACE
    PACKAGE BODY PKG_CUSTOMER  AS
    PROCEDURE PROC_GET_CUSTOMER( P_SEARCH IN STRINGTABLE, SELECTALL OUT L_CURSOR) IS
    BEGIN
         OPEN SELECTALL FOR
          SELECT  PTNR_COUNTRY_CODE, COUNT(*) NOS FROM TAB_MHD_PARTNER
          WHERE PTNR_COUNTRY_CODE in (SELECT * FROM TABLE (P_SEARCH))
          GROUP BY PTNR_COUNTRY_CODE
    END;
    END PKG_CUSTOMER;
    EXEC PKG_CUSTOMER.PROC_GET_CUSTOMER('GB','DE');
    Error starting at line 30 in command:
    EXEC PKG_CUSTOMER.PROC_GET_CUSTOMER('GB','DE')
    Error report:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'PROC_GET_CUSTOMER'
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'PROC_GET_CUSTOMER'
    ORA-06550: line 1, column 43:
    PLS-00363: expression 'DE' cannot be used as an assignment target
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    06550. 00000 -  "line %s, column %s:\n%s"
    *CAUSE:    USUALLY A PL/SQL COMPILATION ERROR.
    *Action:Edited by: RamiahRAGU on Apr 15, 2012 11:08 AM

    The way you are calling the packaged procedure is entirely wrong.
    1. You have one IN parameter which is of table type, and you are trying to pass it as VARCHAR2.
    2. You have an out parameter, and not passing it.
    Moreover, what are you trying to achieve by this code? If you explain teh actual issue, we will be able to help.
    You should call the procedure as below:
    SQL> declare
      2   lc_csr PKG_CUSTOMER.L_CURSOR;
      3  begin
      4   PKG_CUSTOMER.PROC_GET_CUSTOMER(STRINGTABLE('GB','DE'),lc_csr);
      5  end;
      6  /
    PL/SQL procedure successfully completed.

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

    I'm developing the PO cancellation package in database version 10.2.0.4.when i'm trying to execute the package below error appears from "MO_GLOBAL.INIT('PO');"
    PLS-00306: wrong number or types of arguments in call to 'INIT'
    PROCEDURE PROC_CANCEL_PO (PO_NUM VARCHAR2)
    IS
    CURSOR C1 IS
    SELECT * FROM PO_HEADERS_ALL
    WHERE SEGMENT1 = PO_NUM
    AND ORG_ID = FND_PROFILE.VALUE('ORG_ID');
    V_USER_ID NUMBER ;
    V_RESPONSIBILITY_ID NUMBER ;
    V_RESPONSIBILITY_APPL_ID NUMBER ;
    V_ORG_ID VARCHAR2(20) ;
    L_RETURN_STATUS VARCHAR2(1) := NULL;
    L_MSG_DATA VARCHAR2(2000);
    V_SUCCESS_COUNT NUMBER;
    V_FAILURE_COUNT NUMBER;
    BEGIN
    V_SUCCESS_COUNT := 0;
    V_FAILURE_COUNT := 0;
    FOR i IN C1 LOOP
    FND_FILE.PUT_LINE(FND_FILE.LOG ,'START OF CANCEL PO PROCESS API'||SYSDATE );
    BEGIN
    V_USER_ID := FND_GLOBAL.USER_ID ;
    V_RESPONSIBILITY_ID := FND_GLOBAL.RESP_ID ;
    V_RESPONSIBILITY_APPL_ID := FND_GLOBAL.RESP_APPL_ID;
    FND_GLOBAL.APPS_INITIALIZE( V_USER_ID ,V_RESPONSIBILITY_ID,V_RESPONSIBILITY_APPL_ID);
    V_ORG_ID:=FND_PROFILE.VALUE('ORG_ID');
    MO_GLOBAL.INIT('PO');
    MO_GLOBAL.SET_POLICY_CONTEXT('S',V_ORG_ID);
    EXCEPTION
    WHEN OTHERS THEN
    FND_FILE.PUT_LINE(FND_FILE.LOG , 'ERROR CODE FOR INITIALIZATION IS :'||TO_NUMBER( SQLCODE )||' '|| 'ERROR MSG FOR INITIALIZATION IS :'||SUBSTR( SQLERRM , 1 , 50) ) ;
    END ;
    FND_MSG_PUB.INITIALIZE ;
    FND_FILE.PUT_LINE(FND_FILE.LOG , 'PO NUMBER TO CANCEL IS :'||i.SEGMENT1 ) ;
    IF i.AUTHORIZATION_STATUS <> 'APPROVED'
    THEN
    UPDATE PO_HEADERS_ALL
    SET AUTHORIZATION_STATUS = 'APPROVED'
    WHERE SEGMENT1 = i.SEGMENT1 ;
    END IF;
    PO_DOCUMENT_CONTROL_PUB.CONTROL_DOCUMENT
    (1.0, -- P_API_VERSION
    FND_API.G_TRUE, -- P_INIT_MSG_LIST
    FND_API.G_TRUE, -- P_COMMIT
    L_RETURN_STATUS,-- X_RETURN_STATUS
    'PO', -- P_DOC_TYPE
    'STANDARD', -- P_DOC_SUBTYPE
    NULL, -- P_DOC_ID
    i.SEGMENT1, -- PO_NUM
    NULL, -- P_RELEASE_ID
    NULL, -- P_RELEASE_NUM
    NULL, -- P_DOC_LINE_ID
    NULL, -- P_DOC_LINE_NUM
    NULL, -- P_DOC_LINE_LOC_ID
    NULL, -- P_DOC_SHIPMENT_NUM
    'CANCEL', -- P_ACTION
    SYSDATE, -- P_ACTION_DATE
    NULL, -- P_CANCEL_REASON
    'N', -- P_CANCEL_REQS_FLAG
    NULL, -- P_PRINT_FLAG
    NULL, -- P_NOTE_TO_VENDOR
    'N' ); --P_USE_GLDATE
    FND_FILE.PUT_LINE(FND_FILE.LOG,'API RETURN STATUS IS-' || L_RETURN_STATUS);
    IF L_RETURN_STATUS = 'U' THEN --( FND_API.G_RET_STS_UNEXP_ERROR)
    FND_FILE.PUT_LINE(FND_FILE.LOG, 'UNEXPECTED ERROR IN CANCEL PO PROCESS API');
    FND_MSG_PUB.ADD_EXC_MSG('QP_PRICE_LIST_PUB',' UNEXPECTED ERROR IN CANCEL PO PROCESS API');
    ELSIF
    L_RETURN_STATUS ='E' THEN --- ( FND_API.G_RET_STS_ERROR )
    FND_FILE.PUT_LINE(FND_FILE.LOG, 'ERROR IN CANCEL PO PROCESS API');
    FND_MSG_PUB.ADD_EXC_MSG('QP_PRICE_LIST_PUB','ERROR IN CANCEL PO PROCESS API');
    END IF;
    IF L_RETURN_STATUS != 'S' THEN
    V_FAILURE_COUNT := V_FAILURE_COUNT + 1;
    FND_FILE.PUT_LINE(FND_FILE.LOG, 'TOTAL FAIL RECORD COUNT'||V_FAILURE_COUNT);
    FOR ERR_CODE IN 1..FND_MSG_PUB.COUNT_MSG LOOP
    L_MSG_DATA := SUBSTR(FND_MSG_PUB.GET(P_MSG_INDEX => 1,P_ENCODED=>'F'),1,200);
    FND_FILE.PUT_LINE(FND_FILE.LOG,'CANCEL PO PROCESS API FAILED FOR REASON-'||L_MSG_DATA ) ;
    END LOOP;
    END IF;
    IF L_RETURN_STATUS = 'S' THEN --- ( FND_API.G_RET_STS_SUCESS)
    FND_FILE.PUT_LINE (FND_FILE.LOG, 'CANCEL PO PROCESS API PASSED' ) ;
    V_SUCCESS_COUNT := V_SUCCESS_COUNT + 1;
    FND_FILE.PUT_LINE(FND_FILE.LOG,'TOTAL SUCCESS RECORD COUNT-'||V_SUCCESS_COUNT);
    -- RENAME PO NUMBER AFTER CANCELLATION
    UPDATE PO_HEADERS_ALL
    SET SEGMENT1 = 'D-'||i.SEGMENT1
    WHERE SEGMENT1 = i.SEGMENT1 ;
    UPDATE PO_HEADERS_ARCHIVE_ALL
    SET SEGMENT1 = 'D-'||i.SEGMENT1
    WHERE SEGMENT1 = i.SEGMENT1 ;
    END IF ;
    END LOOP ;
    EXCEPTION
    WHEN OTHERS THEN
    FND_FILE.PUT_LINE(FND_FILE.LOG, 'ERROR CODE IN THE EXECUTION OF CANCEL API IS :'||TO_NUMBER( SQLCODE )||' '||SUBSTR( SQLERRM , 1 , 50) ) ;
    END PROC_CANCEL_PO;
    END PKG_EXPO_PO_INTERFACE;
    Someone please explain me the reason for this error and please suggest me a solution for it.
    Regards
    Pramuditha

    Hi Pramuditha,
    This is the forum for the SQL Developer Data Modeler product.
    I suggest you try asking your question on the SQL and PL/SQL forum: PL/SQL
    Regards,
    David

  • ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments

    I am getting an error:
    "ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'XYZ' ORA-06550: line 1, column 7: PL/SQL: Statement ignored".
    Stored Procedure:
    PROCEDURE XYZ
    (ip_number IN NUMBER,
    op_error_code OUT NUMBER,
    op_error_text OUT VARCHAR2,
    ret_cursor OUT OUT_CURSOR);
    In the procedure I am selecting a details from few tables with respect to the input parameter 'ip_number'.
    VB Code:
    strConnectionString = CONNECTION_STRING
    Set objConnection = Server.CreateObject("ADODB.Connection")
    objConnection.Open strConnectionString
    Set objCommand = Server.CreateObject("ADODB.Command")
    With objCommand
    .ActiveConnection = objConnection
    .CommandType = adCmdStoredProc
    End With
    With objCommand
    .CommandText = "Pkg_1.XYZ"
    .Parameters.Append objCommand.CreateParameter_
    ("ip_ipnumber",adNumeric,adParamInput,8,strIPNumber)
    .Parameters.Append objCommand.CreateParameter_
    ("op_error_code",adNumeric,adParamOutput,10)
    .Parameters.Append objCommand.CreateParameter_
    ("op_error_text",adVarChar,adParamOutput,512)
    Set RS = .Execute()
    End With
    Its working fine with ASP(VB)+ Oracle9i + Windows2000.
    But in ASP(VB) + Oracle 8.1.7 + Windows2000, its giving this error:
    "ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'XYZ' ORA-06550: line 1, column 7: PL/SQL: Statement ignored".
    Please help.

    Your procedure has 4 parameters 1 in and 3 out parameter
    whereas in your VB code
    Parameters.Append objCommand.CreateParameter_
    ("ip_ipnumber",adNumeric,adParamInput,8,strIPNumber)
    .Parameters.Append objCommand.CreateParameter_
    ("op_error_code",adNumeric,adParamOutput,10)
    .Parameters.Append objCommand.CreateParameter_
    ("op_error_text",adVarChar,adParamOutput,512)
    There are only 3 parameter added where is the 4 th one ?
    With Warm Regards
    SSR

  • Encounter PLS-00306: wrong number or types of arguments issue

    I came across a issue of PLS-00306: wrong number or types of arguments when I tried to call a stored procedure through Toplink ValueReadquery.
    The full error message is:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'FREEZE_REGISTERS'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Error Code: 6550
    Call:BEGIN FREEZE_REGISTERS(REGISTRATION_DETAIL_in=>1951, RESERVE_USER_in=>'aUser', RESERVE_BUSINESS_CHANNEL_in=>0, RESERVE_TOKEN_in=>1, RESERVE_DATE_in=>{ts '2007-08-03 10:49:25.39'}, BUSINESS_FUNC_ID_in=>1, UPDATE_COUNT_out=>?); END;
         bind => [=> UPDATE_COUNT_out]
    Query:ValueReadQuery() ..............
    The SP was compiled successfully:
    create or replace
    Procedure FREEZE_REGISTERS
    REGISTRATION_DETAIL_ID_in in NUMBER,
    RESERVE_USER_in in VARCHAR2,
    RESERVE_BUSINESS_CHANNEL_in in NUMBER,
    RESERVE_TOKEN_in in NUMBER,
    RESERVE_DATE_in in TIMESTAMP,
    BUSINESS_FUNC_ID_in in NUMBER,
    UPDATE_COUNT_out OUT NUMBER
    IS
    BEGIN
    UPDATE REGISTER
    SET BUSINESS_FUNC_ID = BUSINESS_FUNC_ID_in,
    RESERVE_BUSINESS_CHANNEL = RESERVE_BUSINESS_CHANNEL_in,
    RESERVE_USER = RESERVE_USER_in,
    VERSION_NO = (VERSION_NO + 1),
    RESERVE_DATE = RESERVE_DATE_in,
    RESERVE_TOKEN = RESERVE_TOKEN_in
    WHERE
    GEOGRAPHIC_ID in
    (SELECT GEOGRAPHIC_ID
    FROM LEGAL_INT_TRANS
    WHERE REGISTRATION_DETAIL_ID = REGISTRATION_DETAIL_ID_in);
    --Assign the number of rows returned to UPDATE_COUNT_out
    UPDATE_COUNT_out := SQL%ROWCOUNT;
    EXCEPTION
    WHEN OTHERS THEN
    raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
    END;
    However, when I tried to call it in the toplink, I always got that error message. I'd compared the dataType for input values and they are compatible with the arguments defined in the SP.
    I have no any clue for this problem. Please help.

    How are you set the parameters/adding arguments to the ValueReadQuery, can you post the code used to create and execute the query?
    Regards,
    Chris

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

    We have the code in production and in the test. the dbs, the servers are setup the same. And the codes on two are the same (verified).
    Now all a sudden the code on production failing sine yesterday afternoon:
    BEGIN REQUEST_API.DBSS_process_FUDS; END;
    ERROR at line 1:
    ORA-06550: line 1, column 93:
    PLS-00306: wrong number or types of arguments in call to 'PROCESS_FUDS'
    ORA-06550: line 1, column 93:
    PL/SQL: Statement ignored
    ORA-06512: at "SYS.DBMS_JOB", line 82
    ORA-06512: at "SYS.DBMS_JOB", line 140
    ORA-06512: at "ER.REQUEST_API", line 1190
    ORA-06512: at line 1
    Just with the test's , it still runs OK.
    Any idea? how can we look?
    Thanks a lot!

    BluShadow wrote:
    Check the call to PROCESS_FUDS and check the definition of PROCESS_FUDS and see what's different.
    It could be that something has been relying on implicit datatype conversions i.e. strings to dates and someone has entered some data that doesn't comply with the implicit conversion (i.e. you database stores dates as strings and allows people to enter cr@p data).It is 11.2.0.3
    PROCESS_FUDS is the job and defined the same on the two db.
    I did spool the code of ER.REQUEST_API from dba_source for the two dbs and dff them. Found no different.
    In the same sqlplus client on the remote server:
    on the test db:
    me@cpt1> exec ER.REQUEST_API.DBSS_process_FUDS
    PL/SQL procedure successfully completed.
    on the prod db:
    me@cpp1> exec ER.REQUEST_API.DBSS_process_FUDS
    BEGIN REQUEST_API.DBSS_process_FUDS; END;
    ERROR at line 1:
    ORA-06550: line 1, column 93:
    PLS-00306: wrong number or types of arguments in call to 'PROCESS_FUDS'
    ORA-06550: line 1, column 93:
    PL/SQL: Statement ignored
    ORA-06512: at "SYS.DBMS_JOB", line 82
    ORA-06512: at "SYS.DBMS_JOB", line 140
    ORA-06512: at "ER.REQUEST_API", line 1190
    ORA-06512: at line 1

  • PLS-00306: wrong number or types of arguments  help!!!

    Hi,
    I am new to pl/sql programming I am stuck into oracle error for my code. Plz help me with this issue my code is as follow:
    CREATE OR REPLACE PROCEDURE raise_salary
    (emp_id IN employee.employee_nb%TYPE,
    amount IN employee.salary%TYPE,
    emp_name OUT employee.employee_name%TYPE)
    IS
    BEGIN
    UPDATE employee SET salary= salary+amount WHERE employee_nb = emp_id;
    SELECT employee_name INTO emp_name FROM employee WHERE employee_nb=emp_id;
    DBMS_OUTPUT.PUT_LINE('SALARY HAS BEEN UPDATED FOR ' || emp_name);
    END;
    errror:
    Error report:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'RAISE_SALARY'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    There is a problem with emp_name OUT employee.employee_name%TYPE parameter. OUT means WRITE ONLY, IN means READ ONLY. So you can not read from an OUT parameter and you are trying to do that in the line
    DBMS_OUTPUT.PUT_LINE('SALARY HAS BEEN UPDATED FOR ' || emp_name);
    CREATE OR REPLACE PROCEDURE raise_salary(emp_id   IN employee.employee_nb%TYPE,
                                             amount   IN employee.salary%TYPE,
                                             emp_name OUT employee.employee_name%TYPE) IS
    BEGIN
      UPDATE employee SET salary = salary + amount WHERE employee_nb = emp_id;
      SELECT employee_name
        INTO emp_name
        FROM employee
       WHERE employee_nb = emp_id;
    /*** DBMS_OUTPUT.PUT_LINE('SALARY HAS BEEN UPDATED FOR ' || emp_name); ***/
      --Problem in in the above line. emp_name IS Declared AS OUT
      --So it is WRITE ONLY. You can not read from it within the procedure.
    END;What you can do is to declare that parameter as IN OUT like
    CREATE OR REPLACE PROCEDURE raise_salary(emp_id   IN employee.employee_nb%TYPE,
                                             amount   IN employee.salary%TYPE,
                                             emp_name IN OUT employee.employee_name%TYPE)but there is some other more elegant and better way to do this without hitting the table twice (one for update and one for selecting the name) using RETURNING clause.
    SQL> CREATE OR REPLACE PROCEDURE raise_salary(emp_id   IN emp.empno%TYPE,
      2                                           amount   IN emp.sal%TYPE,
      3                                           emp_name IN OUT emp.ename%TYPE) IS
      4  BEGIN
      5    UPDATE emp
      6       SET sal = sal + amount
      7     WHERE empno = emp_id RETURNING ename INTO emp_name;
      8    DBMS_OUTPUT.PUT_LINE('SALARY HAS BEEN UPDATED FOR ' || emp_name);
      9  END raise_salary;
    10  /
    Procedure created.
    SQL> set serverout on
    SQL> DECLARE
      2  v_name emp.ename%TYPE;
      3  BEGIN
      4  raise_salary(7369,100,v_name);
      5  END;
      6  /
    SALARY HAS BEEN UPDATED FOR SMITH
    PL/SQL procedure successfully completed.
    SQL> NOTE: There is no commit or rollback in this (as in your original example). So you have to issue implicit commit or rollback.
    Edited by: Saubhik on Oct 29, 2010 11:44 PM
    Edited by: Saubhik on Oct 29, 2010 11:50 PM

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

    Hello,
    I have a procedure that creates an xml file and I need to order by an admission date using XMLAGG. When I run the query on it's own, with it not being inside a procedure it runs fine. When I try to run it within a procedure it throws back the above error message, unless I comment out the 'order by'. Does anyone know how I can get this to run with the order by within a procedure?
    We are using Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production.
    Thanks.
    SELECT XMLELEMENT("Stakeholder", XMLELEMENT("ULI", a.ULI),
                                            XMLELEMENT("Gender",a.GENDER),
                                  XMLELEMENT("BirthDate", XMLATTRIBUTES(a.BIRTH_DATE_TYPE AS "type"), a.BIRTH_DATE),
                                            XMLELEMENT("HealthCareNumberInformation",XMLELEMENT("HealthCareNumber",a.HCN),
                                                                                              XMLFOREST((a.PROV_ISSUING_HCN) AS "ProvinceTerritoryIssuingHCN")),
                                            XMLELEMENT("SubmissionType",a.SUBMISSION_TYPE),
                                            (SELECT XMLAGG(XMLELEMENT("ServiceEpisode", XMLELEMENT("AdmissionDate", a2.ADMISSION_DATE )) ORDER BY a2.ADMISSION_DATE)
                                                      FROM admissions a2
                                                                , discharge d2
                                            WHERE a.uli = a2.uli
                                                      AND a.uli = d2.uli
                                                           AND a2.encounter_number = d2.encounter_number
                        )).getClobVal() AS "result"
    FROM Admissions a
         , Discharge d3
         , Diagnosis d
    WHERE a.ULI = d3.ULI
    AND a.ENCOUNTER_NUMBER = d3.ENCOUNTER_NUMBER
    AND a.ULI = d.ULI
    AND a.ENCOUNTER_NUMBER = d.ENCOUNTER_NUMBER
    GROUP BY a.ULI
         , a.GENDER
         , a.BIRTH_DATE_TYPE
         , a.BIRTH_DATE
         , a.HCN
         , a.PROV_ISSUING_HCN
         , a.SUBMISSION_TYPE

    create table mytab (a number,b number);           
    insert into mytab values (1,100);                 
    insert into mytab values (2,200);                 
    SVIL>SELECT xmlelement("A",XMLAGG(XMLELEMENT("B", b ) ORDER BY b)) FROM mytab;
    XMLELEMENT("A",XMLAGG(XMLELEMENT("B",B)ORDERBYB))
    <A><B>100</B><B>200</B></A>
    SVIL>create or replace function getx return xmltype is
      2  r xmltype;
      3  begin
      4  SELECT xmlelement("A",XMLAGG(XMLELEMENT("B", b ) ORDER BY b))
      5  into r
      6  FROM mytab;
      7  return r;
      8  end;
      9  /
    Avvertimento: funzione creata con errori di compilazione.
    SVIL>sho err
    Errori in FUNCTION GETX:
    LINE/COL ERROR
    4/1      PL/SQL: SQL Statement ignored
    4/23     PLS-00306: wrong number or types of arguments in call to 'XMLAGG'
    4/23     PL/SQL: ORA-00904: "XMLAGG": invalid identifier
    SVIL>
    SVIL>ed a
    SVIL>select * from v$version where rownum=1
      2  ;
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit ProductionThe same code works on 10.2.0.4 and 11.1.0.6, don't have other versions to test
    Testing your code
    SVIL>declare                                                                                              
      2   d integer;                                                                                          
      3   x xmltype;                                                                                          
      4  begin                                                                                                
      5     select deptno, xmlagg (xmlelement (e, ename || ',') order by ename)                               
      6     into d, x                                                                                         
      7     from emp                                                                                          
      8    where deptno = 10                                                                                  
      9   group by deptno;                                                                                    
    10  end;                                                                                                 
    11  /                                                                                                    
       select deptno, xmlagg (xmlelement (e, ename || ',') order by ename)                                    
    ERRORE alla riga 5:                                                                                       
    ORA-06550: line 5, column 19:                                                                             
    PLS-00306: wrong number or types of arguments in call to 'XMLAGG'                                         
    ORA-06550: line 5, column 19:                                                                             
    PL/SQL: ORA-00904: "XMLAGG": invalid identifier                                                           
    ORA-06550: line 5, column 4:                                                                              
    PL/SQL: SQL Statement ignored                                                                             
    SVIL>select deptno, xmlagg (xmlelement (e, ename || ',') order by ename) from emp group by deptno;        
        DEPTNO XMLAGG(XMLELEMENT(E,ENAME||',')ORDERBYENAME)                                                   
             1 <E>mike,</E><E>tom,</E>                                                                        
             2 <E>carl,</E>                                                                                    Max
    Edited by: Massimo Ruocchio on Dec 7, 2009 11:11 PM
    Corrected return type

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

    Hi,
    I'm a newbie with Oracle procedures and Oracle Spatial, and I have this problem:
    I have a table named POINT which is in a older version in Oracle Spatial, is a Relational Model with the following tables: POINT, POINT_SDO_INDEX, POINT_SDODIM, POINT_SDOGEOM, POINT_SDOLAYER. I think returned by Arcsde this way, and I can't modify this. Only POINT and POINT_SDOGEOM have data. I need this data in a newer version of Oracle, so I tried the SDO_MIGRATE.TO_CURRENT procedure, in order to do it, I created a table called NEWPOINT with the same columns as POINT, and I added a column LOC with type SDO_GEOMETRY. I'm using Oracle 10g and I tried this procedure (http://download.oracle.com/docs/cd/B13789_01/appdev.101/b10826/sdo_objmigr.htm) in SQL developer:
    begin
    execute immediate mdsys.sdo_migrate.to_current('POINT','NEWPOINT','SDO_GID','LOC','POINT','INSERT');
    end;
    SDO_GID is the same in both tables and the table NEWPOINT is empty.
    This is the error I got:
    PLS-00306: wrong number or types of arguments in call to 'TO_CURRENT'
    I think I'm doing nothing wrong, and I've been trying to solve it for 4 days without any progress. I would be gratefull if you can help me. Thanks.

    Thanks for answer so quickly Boneist, I tried what you said and I have the same error.
    This is the description of Mdsys.sdo_migrate, TO_CURRENT (1) is what I need and I don't see anything strange.
    desc mdsys.sdo_migrate
    PROCEDURE Argument Name Type IN/OUT Default
    FROM_815_TO_81X TABNAME VARCHAR2 IN unknown
    FROM_815_TO_81X COMMIT_INT NUMBER IN unknown
    OGIS_METADATA_FROM <none> IN unknown
    OGIS_METADATA_TO <none> IN unknown
    TO_CURRENT (1) LAYER VARCHAR2 IN unknown
    TO_CURRENT (1) NEWTABNAME VARCHAR2 IN unknown
    TO_CURRENT (1) GIDCOLUMN VARCHAR2 IN unknown
    TO_CURRENT (1) GEOCOLNAME VARCHAR2 IN unknown
    TO_CURRENT (1) LAYER_GTYPE VARCHAR2 IN unknown
    TO_CURRENT (1) UPDATE_FLAG VARCHAR2 IN unknown
    TO_CURRENT (2) TABNAME VARCHAR2 IN unknown
    TO_CURRENT (2) COLUMN_NAME VARCHAR2 IN unknown
    TO_CURRENT (2) COMMIT_INT NUMBER IN unknown
    TO_CURRENT (3) (FUNCTION) <return value> OBJECT OUT unknown
    TO_CURRENT (3) GEOM OBJECT IN unknown
    TO_CURRENT (3) DIM VARRAY IN unknown
    TO_81X LAYER VARCHAR2 IN unknown
    TO_81X NEWTABNAME VARCHAR2 IN unknown
    TO_81X GIDCOLUMN VARCHAR2 IN unknown
    TO_81X GEOCOLNAME VARCHAR2 IN unknown
    TO_81X LAYER_GTYPE VARCHAR2 IN unknown
    TO_81X UPDATE_FLAG VARCHAR2 IN unknown
    22 rows selected

Maybe you are looking for