Wrong number or types to call put_line.

I feel like I should know this but for some reason I am having a hard time putting something together to work. The initial SELECT statement:
SELECT dept, AVG(end_dt-start_dt) AS new_date FROM dept_dates GROUP BY dept;
ran outside the PL/SQL block returns the following:
DEPT NEW_DATE
Marketing 4.56
Adminis 5.43
Purch 2.33
When I run it inside a PL/SQL block and I try to use DBMS_OUTPUT.PUT_LINE, such as:
DECLARE
v_dept VARCHAR2(50);
v_new_date NUMBER;
BEGIN
SELECT dept, AVG(end_dt-start_dt) AS new_date
INTO v_dept, v_new_date
FROM dept_dates
GROUP BY dept;
DBMS_OUTPUT.ENABLE(100000);
DBMS_OUTPUT.PUT_LINE(v_dept,v_new_date);
END;
I get the error msg PLS-00306 wrong number or types of arguments in call to 'PUT_LINE'. Can someone please give me a quick rundown in how I can use the group by function and still us the put_line (or similar) function. It would be a great help. Thanks-Adam

Thanks for the help but I tried both methods and return the following:
Error report:
ORA-01422: exact fetch returns more then requested number of rows
ORA-06512: at line 5
01422. 00000 - "exact fetch returns more than requested number of rows"
*Cause:    The number specified in exact fetch is less than the rows returned
*Action:    Rewrite the query or change number of rows requested.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

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

    Hi Guys,
    I'm practising the plsql workouts,during a anonymous PL/SQL block i got the below error,what the mistake i did ?
    declare
    v1 employee_290512%rowtype;
    cursor c1 is select * from employee_290512;
    begin
    open c1;
    loop
    fetch c1 into v1;
    exit when c1% notfound;
    dbms_output.put_line(v1);
    end loop;
    end;
    {/code}
    And i got the below error
    Error:
    ORA-06550: line 10, column 1:
    PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
    ORA-06550: line 10, column 1:
    PL/SQL: Statement ignored
    /Error.
    Please help me on this.
    Regards
    Thelak                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi there,
    i got the same error. kindly check what's wrong with my below coding;
    SQL> SET SERVEROUTPUT ON
    SQL> DECLARE
    2 TYPE Type_Tab_Data IS RECORD
    3 (
    4 ARMZIG_Q2SFX char(3),
    5 somme number(20,2),
    6 ARMZIG_Q2AN8 number(8),
    7 ARMZIG_Q2DOC number(8),
    8 ARMZIG_Q2DCT char(2),
    9 ARMZIG_Q2CO varchar2(15 char)
    10 );
    11 TYPE Tab_Data IS TABLE OF Type_Tab_Data INDEX BY BINARY_INTEGER ;
    12 t_flexnum5 Tab_Data;
    13 v_test pls_integer;
    14 v_text_erreur varchar2(200 char);
    15 BEGIN
    16 SELECT b.ARMZIG_Q2SFX,a.somme,a.ARMZIG_Q2AN8,a.ARMZIG_Q2DOC,a.ARMZIG_Q2DCT,a.ARMZIG_Q2CO
    17 BULK COLLECT INTO t_flexnum5
    18 from
    19 (
    20 SELECT sum(ARMZIG_Q2AAP/100)as somme,ARMZIG_Q2AN8,ARMZIG_Q2DOC,ARMZIG_Q2DCT,ARMZIG_Q2CO
    21 from ARMAST_ZIG_EUR
    22 where ENVZIG_ID = 'E'
    23 group by ARMZIG_Q2AN8,ARMZIG_Q2DOC,ARMZIG_Q2DCT,ARMZIG_Q2CO
    24 ) a, ARMAST_ZIG_EUR b
    25 where a.ARMZIG_Q2AN8 = b.ARMZIG_Q2AN8
    26 and a.ARMZIG_Q2DOC = b.ARMZIG_Q2DOC
    27 and a.ARMZIG_Q2DCT = b.ARMZIG_Q2DCT
    28 and a.ARMZIG_Q2CO = b.ARMZIG_Q2CO
    29 and b.ENVZIG_ID = 'E';
    30
    31 DBMS_OUTPUT.put_line(t_flexnum5);
    32
    33 END;
    34 /
    DBMS_OUTPUT.put_line(t_flexnum5);
    ERROR at line 31:
    ORA-06550: line 31, column 7:
    PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
    ORA-06550: line 31, column 7:
    PL/SQL: Statement ignored

  • Iterating through a collection of type cursor giving PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'

    I have written the following anonymous block. It has a cursor "cur_total_tckt" which select 6 columns.  A nested table "total_tckt_colcn" is declared of type "cur_total_tckt".  In the dbms_output.put_line I want to print each element of my collection. It is giving me the following error :
    PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
    ORA-06550: line 29, column 2:
    PL/SQL: Statement ignored
    06550. 00000 -  "line %s, column %s:\n%s"
    I want to print all the 6 columns of an element for 366 such elements.
    DECLARE
    CURSOR cur_total_tckt    
      is
      select t.ticket_id ticket_id, t.created_date created_date, t.created_by created_by, t.ticket_status ticket_status,
      t.last_changed last_changed, h.created_date closed_date
      from n01.cc_ticket_info t
      inner join n01.cc_ticket_status_history h
      on (t.ticket_id = h.ticket_id)
      where t.last_changed >= '6/28/2012 17:28:59' and t.last_changed < (sysdate + interval '1' day);
    type total_tckt_colcn
    is
      TABLE OF cur_total_tckt%rowtype;
      total_tckt_col total_tckt_colcn;
      total_coach_col total_tckt_colcn;
    begin
    total_tckt_col := total_tckt_colcn ();
    total_coach_col := total_tckt_colcn ();
      OPEN cur_total_tckt;
      loop
      fetch cur_total_tckt bulk collect into total_tckt_col limit 100;
      dbms_output.put_line(total_tckt_col.last);
      FOR i IN total_tckt_col.first..total_tckt_col.last
      loop
      -- dbms_output.put_line(total_tckt_col(i).ticket_id);          -- this line works
      dbms_output.put_line(total_tckt_col(i));                       -- this line gives error
      END LOOP;
      exit
      WHEN (cur_total_tckt%NOTFOUND);
      END LOOP ;
      CLOSE cur_total_tckt; 
    end;

    No, it wont allow to display two values ,
    Other wise we can do ,to display two values by giving separately DBMS_output as shown below.it wont give u ia single row , it will give in row by row.
    DECLARE
       CURSOR cur_total_tckt
       IS
          SELECT   empno, ename FROM emp;
       TYPE total_tckt_colcn IS TABLE OF cur_total_tckt%ROWTYPE;
       total_tckt_col    total_tckt_colcn;
       total_coach_col   total_tckt_colcn;
    BEGIN
       total_tckt_col := total_tckt_colcn ();
       total_coach_col := total_tckt_colcn ();
       OPEN cur_total_tckt;
       LOOP
          FETCH cur_total_tckt BULK COLLECT INTO   total_tckt_col LIMIT 100;
          DBMS_OUTPUT.put_line (total_tckt_col.LAST);
          FOR i IN total_tckt_col.FIRST .. total_tckt_col.LAST
          LOOP
             DBMS_OUTPUT.put_line (total_tckt_col (i).empno);
             DBMS_OUTPUT.put_line (total_tckt_col (i).ename);
          END LOOP;
          EXIT WHEN (cur_total_tckt%NOTFOUND);
       END LOOP;
       CLOSE cur_total_tckt;
    END;
    Out put:
    12
    1236
    kenny
    2
    jhon
    1
    menies
    3
    sony
    4
    endy
    5
    dennies
    1
    wolks
    2
    flora
    3
    teady
    4
    furry
    5
    kune
    6
    zoel
    Cheers!

  • 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

  • Wrong number  or types of argumnet in a call to  error

    Hi all,
    Below is my stored proc and it has a input parameter 'c_count_or_perc' . I have passed value to this parameter as in the if block.
    But I got the error as "wrong number or types of argumnet in a call to ' .
    I really dont know how to pass input value to this parameter .
    Could anyone please help?
    {code}
    PROCEDURE edr_rpt_gen_error_by_hour
    in_report_parameter_id IN report_tasks.report_task_id%TYPE,
    c_count_or_perc IN VARCHAR2 ,
    report_data OUT SYS_REFCURSOR,
    chart_data OUT SYS_REFCURSOR,
    footer_data OUT SYS_REFCURSOR
    {code}
    In below 'IF THEN ELSE' block , ( based on the <condition> ) , I dont know how to pass value to input parameter c_count_or_perc .
    {code}
              IF (c_count_or_perc = 'ERROR BY HOUR') THEN
                   my_error_text := get_row_error_text;
                   my_total_text := get_row_total_text;
              ELSE
              my_error_text := get_row_error_text;
                   my_total_text := '';
                   DELETE edr_report_by_hour_output
                   WHERE row_type = 'Summary Row'
                   AND row_type = 'Final Row';
              END IF;     
    {code}
    Here I have pasted the full package. Could please tell me , what are ways tht I could pass value to the given input parameter.
    {code}
    CREATE OR REPLACE PACKAGE edr_rpt_error_by_hour_package AS
    PROCEDURE edr_rpt_gen_error_by_hour
    in_report_parameter_id IN report_tasks.report_task_id%TYPE,
    c_count_or_perc IN VARCHAR2 ,
    report_data OUT SYS_REFCURSOR,
    chart_data OUT SYS_REFCURSOR,
    footer_data OUT SYS_REFCURSOR
    FUNCTION error_data
    in_lane_id edr_report_by_hour_output.lane_id%TYPE,
    in_direction_id edr_report_by_hour_output.direction_id%TYPE,
    in_interval_start_date_time edr_report_by_hour_output.interval_start_date_time%TYPE,
    in_interval_end_date_time edr_report_by_hour_output.interval_end_date_time%TYPE,
    in_hour_start edr_report_by_hour_output.hour_start%TYPE,
    in_hour_end edr_report_by_hour_output.hour_end%TYPE,
    in_min_error NUMBER,
    in_max_error NUMBER
    RETURN NUMBER;
    END edr_rpt_error_by_hour_package;
    CREATE OR REPLACE PACKAGE BODY edr_rpt_error_by_hour_package AS
    FUNCTION error_data
    in_lane_id edr_report_by_hour_output.lane_id%TYPE,
    in_direction_id edr_report_by_hour_output.direction_id%TYPE,
    in_interval_start_date_time edr_report_by_hour_output.interval_start_date_time%TYPE,
    in_interval_end_date_time edr_report_by_hour_output.interval_end_date_time%TYPE,
    in_hour_start edr_report_by_hour_output.hour_start%TYPE,
    in_hour_end edr_report_by_hour_output.hour_end%TYPE,
    in_min_error NUMBER,
    in_max_error NUMBER
    RETURN NUMBER
    IS
    my_count_result NUMBER(18);
    BEGIN
    SELECT NVL(SUM(error_count), 0 )
    INTO my_count_result
    FROM
    SELECT site_lane_id
    FROM edr_rpt_tmp_report_lanes
    WHERE edr_rpt_tmp_report_lanes.output_lane_id = in_lane_id
    AND edr_rpt_tmp_report_lanes.output_direction_id = in_direction_id
    ) report_lanes
    JOIN edr_error_by_hour_report_data
    ON edr_error_by_hour_report_data.site_lane_id = report_lanes.site_lane_id
    AND edr_error_by_hour_report_data.bin_start_date_time >= in_interval_start_date_time
    AND edr_error_by_hour_report_data.bin_start_date_time < in_interval_end_date_time
    AND edr_error_by_hour_report_data.hour >= in_hour_start
    AND edr_error_by_hour_report_data.hour < in_hour_end
    AND edr_error_by_hour_report_data.error_code >= in_min_error
    AND edr_error_by_hour_report_data.error_code <= in_max_error
    return my_count_result;
    END error_data;
    FUNCTION get_row_error_text
    RETURN VARCHAR2
    IS
    my_row_error_text VARCHAR2(10000);
    my_row_error_entry VARCHAR2(10000);
    CURSOR row_error_text IS
    SELECT 'edr_rpt_error_by_hour_package.error_data('
    ||'lane_id, '
    ||'direction_id, '
    ||'interval_start_date_time, '
    ||'interval_end_date_time, '
    ||'hour_start, '
    ||'hour_end, '
    || error_code || ', '
    || error_code || ') "'|| error_message.error_short_message || '"'
    FROM error_message
    WHERE error_code >= 0 and error_code < 19
    ORDER BY error_code;
    BEGIN
    my_row_error_text := '';
    my_row_error_entry := '';
    -- generate the error code function calls
    OPEN row_error_text;
    LOOP
    FETCH row_error_text INTO my_row_error_entry;
    EXIT WHEN row_error_text%NOTFOUND;
    my_row_error_text := my_row_error_text || ', ' || my_row_error_entry;
    END LOOP;
    CLOSE row_error_text;
    RETURN my_row_error_text;
    END get_row_error_text;
    FUNCTION get_row_total_text
    RETURN VARCHAR2
    IS
    my_row_error_text VARCHAR2(10000);
    BEGIN
    my_row_error_text := '';
    -- generate the 'total' column function call
    SELECT 'edr_rpt_error_by_hour_package.error_data('
    ||'lane_id, '
    ||'direction_id, '
    ||'interval_start_date_time, '
    ||'interval_end_date_time, '
    ||'hour_start, '
    ||'hour_end, '
    || MIN(error_code) || ', '
    || MAX(error_code) || ') "Total"'
    INTO my_row_error_text
    FROM error_message
    WHERE error_code >= 0 and error_code < 19;
    RETURN (', ' || my_row_error_text);
    END get_row_total_text;
    FUNCTION get_error_data_pct
    in_lane_id edr_report_by_hour_output.lane_id%TYPE,
    in_direction_id edr_report_by_hour_output.direction_id%TYPE,
    in_interval_start_date_time edr_report_by_hour_output.interval_start_date_time%TYPE,
    in_interval_end_date_time edr_report_by_hour_output.interval_end_date_time%TYPE,
    in_hour_start edr_report_by_hour_output.hour_start%TYPE,
    in_hour_end edr_report_by_hour_output.hour_end%TYPE,
    in_min_error NUMBER,
    in_max_error NUMBER
    RETURN NUMBER
    IS
         my_count NUMBER(18);
         my_total NUMBER(18);
         my_count_pct NUMBER(18);
         my_count_result NUMBER(18);
    BEGIN
              my_count_pct := 0 ;
              my_count_result := error_data (
    in_lane_id,
    in_direction_id,
    in_interval_start_date_time,
    in_interval_end_date_time,
    in_hour_start,
    in_hour_end,
    in_min_error,
    in_max_error
              IF (my_count_result > 0 ) THEN
              my_total := error_data (
    in_lane_id,
    in_direction_id,
    in_interval_start_date_time,
    in_interval_end_date_time,
    in_hour_start,
    in_hour_end,
    1,
    19
              my_count_pct := ROUND((my_count_result / my_total) * 100 ,2);
         END IF;
              return my_count_pct;
    END get_error_data_pct;          
    PROCEDURE edr_error_by_hour_use_per_veh
    in_report_parameter_id IN report_tasks.report_task_id%TYPE
    IS
    BEGIN
    DELETE FROM edr_error_by_hour_report_data;
    INSERT INTO edr_error_by_hour_report_data
    site_id,
    site_lane_id,
    bin_start_date_time,
    hour,
    error_code,
    error_count
    SELECT
    site_id,
    site_lane_id,
    bin_start_date_time,
    hour,
    error_code,
    COUNT(1)
    FROM (SELECT site_id,
    site_lane_id,
    ( SELECT NVL(MAX(interval_start_date_time), date_time)
    FROM edr_rpt_tmp_grouping_table
    WHERE interval_start_date_time <= date_time) bin_start_date_time,
    TO_NUMBER(TO_CHAR(date_time, 'hh24')) hour,
    NVL(traffic_error.error_code, 0) error_code
    FROM edr_error_by_hour_veh_data
    LEFT OUTER JOIN traffic_error
    ON traffic_error.record_id = edr_error_by_hour_veh_data.record_id
    ) vehicles
    GROUP BY
    site_id,
    site_lane_id,
    bin_start_date_time,
    hour,
    error_code;
    END edr_error_by_hour_use_per_veh;
    PROCEDURE edr_error_by_hour_data_type
    in_report_parameter_id IN report_tasks.report_task_id%TYPE,
    in_data_type IN VARCHAR2,
    out_data_type_used OUT VARCHAR2
    IS
    my_bin_entry_count NUMBER(12,0);
    my_veh_entry_count NUMBER(12,0);
    BEGIN
    IF(UPPER(in_data_type) = 'BINNED') THEN
    -- Error information can only be read from Per Vehicle data records
    -- - using bins-only is not a supported option
    RAISE_APPLICATION_ERROR(-20101,'Binned data cannot be used for this report.');
    ELSIF (UPPER(in_data_type) = 'PERVEHICLE')
    OR (UPPER(in_data_type) = 'COMBINED')
    THEN
    out_data_type_used := 'Per Vehicle (All Vehicles)';
    edr_error_by_hour_use_per_veh( in_report_parameter_id );
    ELSE
    RAISE_APPLICATION_ERROR(-20101, 'The data type specified is not recognized.');
    END IF;
    END edr_error_by_hour_data_type;
    PROCEDURE edr_error_by_hour_get_veh_data
    in_report_parameter_id IN NUMBER,
    in_site_id IN NUMBER,
    in_start_date_time IN TIMESTAMP,
    in_end_date_time IN TIMESTAMP,
    in_report_level_min IN NUMBER,
    in_report_level_max IN NUMBER
    IS
    BEGIN
    --Clear the edr_error_by_hour_veh_data temporary table and populate it with the data for the requested
    --report.
    DELETE FROM edr_error_by_hour_veh_data;
    INSERT INTO edr_error_by_hour_veh_data
    site_id,
    site_lane_id,
    record_id,
    date_time,
    vehicle_error_count,
    vehicle_status
    SELECT site_to_data_source_lane_v.site_id,
    site_to_data_source_lane_v.site_lane_id,
    traffic_record.record_id,
    traffic_record.datetime,
    NVL((SELECT COUNT(1)
    FROM traffic_error
    WHERE traffic_error.record_id = traffic_record.record_id), 0) vehicle_error_count,
    NVL((SELECT SUM(status_code)
    FROM traffic_status
    WHERE traffic_status.record_id = traffic_record.record_id), 0) vehicle_status
    FROM traffic_record
    LEFT OUTER JOIN traffic_class
    ON traffic_record.record_id = traffic_class.record_id
    JOIN site_to_data_source_lane_v
    ON traffic_record.data_source_id = site_to_data_source_lane_v.data_source_id
    AND traffic_record.lane = site_to_data_source_lane_v.data_source_lane_id
    JOIN edr_rpt_tmp_report_lanes
    ON site_to_data_source_lane_v.site_lane_id = edr_rpt_tmp_report_lanes.site_lane_id
    JOIN edr_rpt_tmp_report_classes
    ON NVL(traffic_class.v_class, 0) = edr_rpt_tmp_report_classes.class_id
    JOIN edr_rpt_tmp_inclusion_table
    ON TRUNC(traffic_record.datetime) = TRUNC(edr_rpt_tmp_inclusion_table.date_time)
    WHERE site_to_data_source_lane_v.site_id = in_site_id
    AND traffic_record.datetime >= in_start_date_time
    AND traffic_record.datetime < in_end_date_time
    AND traffic_class.class_level >= in_report_level_min
    AND traffic_class.class_level <= in_report_level_max;
    END edr_error_by_hour_get_veh_data;
    PROCEDURE edr_rpt_gen_error_by_hour
    in_report_parameter_id IN report_tasks.report_task_id%TYPE,
    c_count_or_perc IN VARCHAR2 ,
    report_data OUT SYS_REFCURSOR,
    chart_data OUT SYS_REFCURSOR,
    footer_data OUT SYS_REFCURSOR
    AS
    my_date_format_mask VARCHAR2(50);
    my_start_date_time TIMESTAMP;
    my_end_date_time TIMESTAMP;
    my_lane_grouping VARCHAR2(10);
    my_interval_duration NUMBER(2);
    my_site_id sites.site_id%TYPE;
    my_selected_data_type VARCHAR2(50);
    my_used_data_type VARCHAR2(50);
    my_report_data_statement VARCHAR2(25000);
    my_chart_data_statement VARCHAR2(25000);
    my_good_weight_viol_total NUMBER(12,0);
    my_data_type_used VARCHAR2(50);
    my_per_vehicle_total NUMBER(12,0);
    my_binned_vehicle_total NUMBER(12,0);
    my_error_vehicle_total NUMBER(12,0);
    my_status_vehicle_total NUMBER(12,0);
    my_good_weight_total NUMBER(12,0);
    my_status_clear_total NUMBER(12,0);
    my_good_weight_statuses_mask NUMBER(12,0);
    my_error_text VARCHAR2(25000);
    my_total_text VARCHAR2(25000);
    my_error_row_pct_report VARCHAR2(25);
    BEGIN
    my_date_format_mask := edr_rpt_generic_package.edr_rpt_get_date_format_mask(in_report_parameter_id);
    my_start_date_time := edr_rpt_generic_package.edr_rpt_get_start_date_time(in_report_parameter_id, my_date_format_mask);
    my_end_date_time := edr_rpt_generic_package.edr_rpt_get_end_date_time(in_report_parameter_id, my_date_format_mask);
    my_lane_grouping := edr_rpt_generic_package.edr_rpt_get_lane_grouping(in_report_parameter_id);
    my_site_id := edr_rpt_generic_package.edr_rpt_get_site_id(in_report_parameter_id);
    my_selected_data_type := edr_rpt_generic_package.edr_rpt_get_data_type(in_report_parameter_id);
    -- ensure selected classes and lanes temp tables have been populated
    edr_rpt_generic_package.edr_rpt_gen_tmp_lanes(in_report_parameter_id);
    edr_rpt_generic_package.edr_rpt_gen_tmp_classes(in_report_parameter_id);
    my_good_weight_statuses_mask := edr_rpt_generic_package.get_good_weight_status_mask(in_report_parameter_id);
    edr_rpt_generic_package.edr_rpt_gen_inclusion_table(
    in_report_parameter_id,
    my_date_format_mask,
    my_start_date_time,
    my_end_date_time
    edr_rpt_generic_package.edr_rpt_gen_grouping_table(
    in_report_parameter_id,
    my_date_format_mask,
    my_start_date_time,
    my_end_date_time
    edr_rpt_generic_package.gen_rpt_by_hour_output_table
    in_report_parameter_id
    edr_rpt_error_by_hour_package.edr_error_by_hour_get_veh_data
    in_report_parameter_id,
    my_site_id,
    my_start_date_time,
    my_end_date_time,
    0, --Hardcoded until reclassification is supported.
    0 --Hardcoded until reclassification is supported.
    edr_rpt_error_by_hour_package.edr_error_by_hour_data_type
    in_report_parameter_id,
    my_selected_data_type,
    my_used_data_type
              IF (c_count_or_perc = 'ERROR BY HOUR') THEN
                   my_error_text := get_row_error_text;
                   my_total_text := get_row_total_text;
              ELSE
              my_error_text := get_row_error_text;
                   my_total_text := '';
                   DELETE edr_report_by_hour_output
                   WHERE row_type = 'Summary Row'
                   AND row_type = 'Final Row';
              END IF;     
    COMMIT;
    my_report_data_statement :=
    'SELECT rank "Rank", '
    || ' ROW_TYPE "Row Type", '
    || ' interval_start_date_time "Date", '
    || ' interval_start_date_time, '
    || ' hour_label "Chart X-Axis", '
    || ' lane_id "Group Id" , '
    || ' ''None'' "Group Name", '
    || ' hour_label "Hour" '
    || my_error_text
    || my_total_text
    || ' FROM edr_report_by_hour_output '
    || ' ORDER BY lane_id, '
    || ' direction_id, '
    || ' interval_start_date_time, '
    || ' hour_end, '
    || ' rank, '
    || ' hour_start'
    dbms_output.put_line('SQL start------------------------');
    dbms_output.put_line(my_report_data_statement);
    dbms_output.put_line('SQL end--------------------------');
    my_chart_data_statement :=
    ' SELECT hour_start "X Axis", '
    || ' lane_id "Group" '
    || edr_rpt_error_by_hour_package.get_row_error_text
    || ' FROM '
    || ' ( '
    || ' SELECT lane_id, '
    || ' direction_id, '
    || ' hour_start, '
    || ' hour_end, '
    || ' min(interval_start_date_time) interval_start_date_time, '
    || ' max(interval_end_date_time) interval_end_date_time '
    || ' FROM edr_report_by_hour_output '
    || ' WHERE hour_end = hour_start + 1 '
    || ' GROUP BY lane_id, direction_id, hour_start, hour_end '
    || ' ) '
    || ' order by "Group", hour_start '
    dbms_output.put_line('SQL start------------------------');
    dbms_output.put_line(my_chart_data_statement);
    dbms_output.put_line('SQL end--------------------------');
    SELECT my_used_data_type
    INTO my_data_type_used
    FROM SYS.DUAL;
    SELECT NVL(COUNT(record_id), 0)
    INTO my_per_vehicle_total
    FROM edr_error_by_hour_veh_data;
    SELECT NVL(COUNT(record_id), 0)
    INTO my_status_vehicle_total
    FROM edr_error_by_hour_veh_data
    WHERE vehicle_status > 0
    AND vehicle_error_count = 0;
    SELECT NVL(COUNT(record_id), 0)
    INTO my_error_vehicle_total
    FROM edr_error_by_hour_veh_data
    WHERE vehicle_error_count > 0;
    SELECT NVL(COUNT(record_id), 0)
    INTO my_status_clear_total
    FROM edr_error_by_hour_veh_data
    WHERE vehicle_status = 0
    AND vehicle_error_count = 0;
    SELECT NVL(SUM(error_count), 0)
    INTO my_binned_vehicle_total
    FROM edr_error_by_hour_report_data;
    SELECT NVL(COUNT(DISTINCT edr_error_by_hour_veh_data.record_id), 0)
    INTO my_good_weight_total
    FROM edr_error_by_hour_veh_data
    WHERE vehicle_error_count = 0
    AND BITAND(vehicle_status, my_good_weight_statuses_mask) = 0;
    -- insert vehicle totals into the temporary table
    DELETE FROM edr_rpt_tmp_veh_totals_table;
    INSERT INTO edr_rpt_tmp_veh_totals_table
    data_type_used,
    per_vehicle_total,
    binned_vehicle_total,
    error_vehicle_total,
    status_vehicle_total,
    good_weight_total,
    status_clear_total
    SELECT my_data_type_used,
    my_per_vehicle_total,
    my_binned_vehicle_total,
    my_error_vehicle_total,
    my_status_vehicle_total,
    my_good_weight_total,
    my_status_clear_total
    FROM SYS.DUAL;
    -- execute the query into the output refcursor
    OPEN report_data FOR
    my_report_data_statement;
    OPEN chart_data FOR
    my_chart_data_statement;
    OPEN footer_data FOR
    SELECT data_type_used,
    per_vehicle_total,
    binned_vehicle_total,
    error_vehicle_total,
    status_vehicle_total,
    good_weight_total,
    status_clear_total
    FROM edr_rpt_tmp_veh_totals_table;
    END edr_rpt_gen_error_by_hour;
    END edr_rpt_error_by_hour_package;
    {code}

    Hi,
    Thx for the reply.
    As the store proc is inside the package and its invoked in visual studio.
    I used to compile the pkg in SQL plus and it throws the error as ' wrong number or types of argument in a call to the stored proc 'edr_rpt_gen_error_by_hour'
    As I'm new to pl/sql programming , i really dont know how to pass value to the input parameter.
    Edited by: user10641405 on Nov 18, 2009 7:27 PM
    Edited by: user10641405 on Nov 18, 2009 7:29 PM

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

    Hi
    I wrote a procedure
    create or replace
    PACKAGE BODY PKG_PMS_DELUSERS AS
    PROCEDURE PRO_PMS_NAMETODEL(i_namestodel IN nametodel_arrType,o_check OUT int) AS
    BEGIN
    o_check:=1;
    for i in 1 .. i_namestodel.count loop
    dbms_output.put_line( 'Empid = ' || i_namestodel(i) );
    UPDATE pms_user SET status=0 WHERE emp_id=i_namestodel(i);
    o_check:=i;
    end loop;
    COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
    o_check:=0;
    NULL;
    END PRO_PMS_NAMETODEL;
    END PKG_PMS_DELUSERS;
    amd my java code is
    Connection l_con = DB.connect();
              int l_del=0;
              try{
                   System.out.println("IN DB INTERFACE");
                   String[] l_users= users;
                   ArrayDescriptor l_desc = (ArrayDescriptor)ArrayDescriptor.createDescriptor("NAMETODEL_ARRTYPE", l_con);
                   java.util.List<String> l_listofnames = new ArrayList<String>();
                   for(int i = 0; i< l_users.length; i++){
                        l_listofnames.add(l_users);     
                   ARRAY l_arrayNames = new ARRAY (l_desc, l_con, (Object[]) l_listofnames.toArray());
                   //System.out.println(l_arrayNames);
                   CallableStatement l_proc = l_con.prepareCall("{call PKG_PMS_DELUSERS.PRO_PMS_NAMETODEL(?,?)}");
                   l_proc.setArray(1, l_arrayNames);
                   l_proc.registerOutParameter(2,Types.INTEGER);
                   l_del = l_proc.executeUpdate();
    after running the code i get the exception
    wrong number or types of arguments in call to 'PRO_PMS_NAMETODEL

    Hi
    I wrote a procedure
    create or replace
    PACKAGE BODY PKG_PMS_DELUSERS AS
    PROCEDURE PRO_PMS_NAMETODEL(i_namestodel IN nametodel_arrType,o_check OUT int) AS
    BEGIN
    o_check:=1;
    for i in 1 .. i_namestodel.count loop
    dbms_output.put_line( 'Empid = ' || i_namestodel(i) );
    UPDATE pms_user SET status=0 WHERE emp_id=i_namestodel(i);
    o_check:=i;
    end loop;
    COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
    o_check:=0;
    NULL;
    END PRO_PMS_NAMETODEL;
    END PKG_PMS_DELUSERS;
    amd my java code is
    Connection l_con = DB.connect();
              int l_del=0;
              try{
                   System.out.println("IN DB INTERFACE");
                   String[] l_users= users;
                   ArrayDescriptor l_desc = (ArrayDescriptor)ArrayDescriptor.createDescriptor("NAMETODEL_ARRTYPE", l_con);
                   java.util.List<String> l_listofnames = new ArrayList<String>();
                   for(int i = 0; i< l_users.length; i++){
                        l_listofnames.add(l_users);     
                   ARRAY l_arrayNames = new ARRAY (l_desc, l_con, (Object[]) l_listofnames.toArray());
                   //System.out.println(l_arrayNames);
                   CallableStatement l_proc = l_con.prepareCall("{call PKG_PMS_DELUSERS.PRO_PMS_NAMETODEL(?,?)}");
                   l_proc.setArray(1, l_arrayNames);
                   l_proc.registerOutParameter(2,Types.INTEGER);
                   l_del = l_proc.executeUpdate();
    after running the code i get the exception
    wrong number or types of arguments in call to 'PRO_PMS_NAMETODEL

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

    Hello
    in a nutshell, the following script doesn't work as expected:
    DECLARE
    v_Flight CORE.T_Flight%RowType := NULL;
    BEGIN
    IF (v_Flight IS NULL) THEN
    DBMS_OUTPUT.PUT_LINE('v_Flight is null');
    END IF;
    END;
    whereby 'CORE.T_Flight' is an existing DB table.
    When running the script, the following error is printed:
    IF (v_Flight IS NULL) THEN
    FEHLER in Zeile 4:
    ORA-06550: line 4, column 6:
    PLS-00306: wrong number or types of arguments in call to 'IS NULL'
    ORA-06550: line 4, column 2:
    PL/SQL: Statement ignored
    In other words: it seams that a 'rowtype' cannot be compared against NULL. Replacing the direct comparision with the statement
    IF (NVL(v_Flight, 0) = 0) THEN ...
    produces the same error.
    Who can help me?
    (I hope I'm not boring the experts - I'm a beginner)
    thanks
    Daniel

    Hi,
    It's just a limitation of PL/SQL that we have to deal with... from the documentation: "Records cannot be tested for nullity, or compared for equality, or inequality".
    If you really need to do this check you may want to create a function for it:
    function t_flight_rec_is_null (
       p_rec in t_flight%rowtype
    ) return boolean
    is
    begin
       return p_rec.field1 is null and p_rec.field2 is null ... and p_rec.fieldN is null;
    end;cheers,
    Anthony

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

    Hello,
    Just a small problem regarding procedure execution.
    I create a procedure in the following manner. The procedure is created without any errors however when I try to execute I receive the following error;
    SQL> EXECUTE validVaccination;
    BEGIN validVaccination; END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'VALIDVACCINATION'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Code to create procedure
    CREATE OR REPLACE procedure validVaccination (Year in NUMBER) AS
    vPid patient.pid%type;
    vName patient.pname%type;
    vDob patient.dobirth%type;
    vCurrentDate date;
    vAge number;
    vVaccinated vaccinations.vaccinated%type;
    vVacdate vaccinations.vdate%type;
    vYearLeft number;
    BEGIN
    SELECT patient.pid,
    trim(upper(pname)) "Name",
    to_char(dobirth) "DOB",
    to_char(sysdate) "Date",
    trunc((sysdate-dobirth)/365.25) "Age in Years",
    vaccinations.vaccinated,
    to_char(vaccinations.vdate) "Vacc Date",
    (lasting_years-((sysdate-vaccinations.vdate)/365.25)) as "# Years Left"
    INTO vPid,
    vName,
    vDob,
    vCurrentDate,
    vAge,
    vVaccinated,
    vVacdate,
    vYearLeft
    FROM patient, vaccinations, valid_for
    WHERE trunc((sysdate-dobirth)/365.25) < 30
    AND upper(vaccinations.vaccinated) = 'TYPHOID'
    AND extract(year from vdate) >= 2001
    AND patient.pid = vaccinations.pid
    AND upper(vaccinations.vaccinated) = upper(valid_for.vaccinated)
    AND ((sysdate-vaccinations.vdate)/365.25) < lasting_years;
    END;
    Any ideas how to fix this error?

    assuming that you want to display the rows in in sql*plus
    CREATE OR REPLACE procedure validVaccination (Year in NUMBER) AS
      Cursor c1 Is
       SELECT patient.pid,
              trim(upper(pname))              pName,
              to_char(dobirth,'dd-mon-yyyy')  dob,
              to_char(sysdate,'dd-mon-yyyy')  todaysdate,
              trunc((sysdate-dobirth)/365.25) Age,
              vaccinations.vaccinated,
              to_char(vaccinations.vdate,'dd-mon-yyyy') VaccDate,
              (lasting_years-((sysdate-vaccinations.vdate)/365.25)) as years_left
         FROM patient, vaccinations, valid_for
        WHERE trunc((sysdate-dobirth)/365.25)       < 30
          AND upper(vaccinations.vaccinated)        = 'TYPHOID'
          AND extract(year from vdate)             >= 2001
          AND patient.pid                           = vaccinations.pid
          AND upper(vaccinations.vaccinated)        = upper(valid_for.vaccinated)
          AND ((sysdate-vaccinations.vdate)/365.25) < lasting_years;
    BEGIN
      For c1_rec In c1 Loop
        dbms_output.put_line('********************');
        dbms_output.put_line('   patient id: '||to_char(c1_rec.patient_id));
        dbms_output.put_line(' patient name: '||c1_rec.pname);
        dbms_output.put_line('          DOB: '||c1_rec.dobirth);
        dbms_output.put_line(' Current Date: '||c1_rec.todaysdate);
        dbms_output.put_line('          Age: '||to_char(c1_rec.age));
        dbms_output.put_line('   Vacination: '||c1_rec.vaccinated);
        dbms_output.put_line('Vacination dt: '||c1_rec.VaccDate);
        dbms_output.put_line('   Years left: '||c1_rec.years_left);
      End Loop;
    END;
    /after you have compiled the procedure in sql*plus. at the command line enter this
    SQL> set serveroutput on;
    then execute the procedure validVaccination()

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

    i've created the below procedure, whenever i'm trying excuting its giving the following Error.
    Please guide me how to solve this issu...........
    SQL> create or replace procedure get_cust_id(in_source in varchar2,
    2 in_reference_7 in varchar2,
    3 cus_name out varchar2)
    4 is
    5 begin
    6 if in_source ='Receivables' then
    7 if in_reference_7 is null then
    8 cus_name := '';
    9 else
    10 select cu.customer_name
    11 into cus_name
    12 from ra_customers cu
    13 where cu.customer_id = to_number(in_reference_7);
    14 fnd_file.put_line(100, cus_name);
    15 end if;
    16 end if;
    17 end;
    18 /
    Procedure created.
    SQL> exec get_cust_id('Receivables',1000) ;
    BEGIN get_cust_id('Receivables',1000) ; END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'GET_CUST_ID'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Thanks in Advance.
    Srinivas.P

    Vivek L wrote:
    Vitor M.A. Rodrigues wrote:
    If it has 3 varchar2 parameters then you should give 3 ... It should be something like this:
    exec get_cust_id('Receivables','1000','1000') ;
    Slight modification Victor.
    If you see the signature of procedure, it has 2 IN params and 1 OUT param :
    SQL> create or replace procedure get_cust_id(in_source in varchar2,
    2 in_reference_7 in varchar2,
    3 cus_name out varchar2)
    4 isSo for parameter cus_name (which is an out parameter) value can not be assigned , but has to be captured in some local vaiable.
    Something like this :
    SQL> var t_out varchar2(4000);
    SQL> exec get_cust_id(in_source  => 'Receivables', in_reference_7 => 1000,cus_name => :t_out );
    Sorry didn't see the OUT : (
    edit: Vivek L Put the 1000 with '' ;) . Will edit my response : )

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

    what i am doing wrong..?
    create or replace FUNCTION Tokenizer (p_string VARCHAR2
    ,p_separators in VARCHAR2)
    RETURN dbms_sql.varchar2s IS
    l_token_tbl dbms_sql.varchar2s;
    pattern varchar2(250);
    BEGIN
    pattern := '[^(' || p_separators || ')]+' ;
    select regexp_substr(p_string, pattern,1,level) token
    bulk collect into l_token_tbl
    from dual
    where regexp_substr(p_string, pattern,1,level) is not null
    connect by regexp_instr(p_string, pattern,1, level ) > 0;
    RETURN l_token_tbl;
    END Tokenizer;
    declare
    v_strs  dbms_sql.varchar2s;
    v_strs1 dbms_sql.varchar2s;
    v_strs2 dbms_sql.varchar2s;
    v_strs3 dbms_sql.varchar2s;
    v_results dbms_sql.varchar2s;
    begin
    v_strs := tokenizer('this is very bad',' ');
    v_strs1 := tokenizer('this is more bad',' ');
    dbms_output.put_line('no.:'||v_strs.count);
      v_results := v_strs multiset except v_strs1;
    end;
    ORA-06550: line 13, column 16:
    PLS-00306: wrong number or types of arguments in call to 'MULTISET_EXCEPT_ALL'
    ORA-06550: line 13, column 3:
    PL/SQL: Statement ignored

    Well as far as I'm aware , dbms_sql.varchar2s is an associative array rather than a nested table.
    From the Manual
    MULTISET EXCEPT takes as arguments two nested tables and returns a nested table whose elements are in the first nested table but not in the second nested table. The two input nested tables must be of the same type, and the returned nested table is of the same type as well.
    So to fix it you have to :
    Create your nested table type in sql
    (This is because you need to return this type form your function)
    create type nested_table_type as table of varchar2(1000);change all your declarations to nested_table_type
    create or replace
    FUNCTION Tokenizer (p_string in VARCHAR2
    ,p_separators in VARCHAR2)
    RETURN nested_table_type IS
    l_token_tbl nested_table_type;
    pattern varchar2(250);
    BEGIN
    pattern := '[^(' || p_separators || ')]+' ;
    select regexp_substr(p_string, pattern,1,level) token
    bulk collect into l_token_tbl
    from dual
    where regexp_substr(p_string, pattern,1,level) is not null
    connect by regexp_instr(p_string, pattern,1, level ) > 0;
    RETURN l_token_tbl;
    END Tokenizer;change the declarations in your anonymous pl/sql block
    declare
    v_strs  nested_table_type;
    v_strs1 nested_table_type;
    v_strs2 nested_table_type;
    v_strs3 nested_table_type;
    v_results nested_table_type;
    begin
    v_strs := tokenizer('this is very bad',' ');
    v_strs1 := tokenizer('this is more bad',' ');
    dbms_output.put_line('no.:'||v_strs.count);
      v_results := v_strs multiset except v_strs1;
    end;

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

    This is the procedure i have created
    create or replace procedure proc2(n1 in number, n2 in number, tot out number) is
    begin
    tot:=n1+n2;
    end;
    the error when i try to run is
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'PROC2'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

    Try This
    on SQLPLUS
    SET SERVEROUT ON
    Declare
    l_n1 NUMBEr := 10 ;
    l_n2 NUMBER :=20 ;
    l_tot NUMBER;
    Begin
    Proc2( l_n1, l_n2, l_tot) ;
    DBMS_OUTPUT.PUT_LINE ( 'l_tot =>' || L_tot) ;
    End ;
    or
    Declare
    l_tot NUMBER;
    begin
    Proc2( 10, 10, l_tot) ;
    DBMS_OUTPUT.PUT_LINE ( 'l_tot =>' || L_tot) ;
    End;
    /

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

    hi,
    Please go through the below code and let me know what needs to be done .....
    PLS-00306: wrong number or types of arguments in call to 'MEMBER OF'
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE     11.1.0.7.0     Production
    TNS for 32-bit Windows: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    DECLARE
       TYPE rec_emps IS RECORD (
          ename   emp.ename%TYPE,
          empno   emp.empno%TYPE
       TYPE ty_rec_emps IS TABLE OF rec_emps;
       v_emps   ty_rec_emps := ty_rec_emps ();
    BEGIN
       SELECT ename,
              empno
       BULK COLLECT INTO v_emps
         FROM emp;
        IF  'MILLER' MEMBER OF V_EMPS
        THEN
         dbms_output.put_line('sssssssssssss!!!!!!!!');
        END IF ;
       FOR v_emps_indx IN v_emps.FIRST .. v_emps.LAST
       LOOP
          DBMS_OUTPUT.put_line (   v_emps (v_emps_indx).ename
                                || ' '
                                || v_emps (v_emps_indx).empno
       END LOOP;
    END;
    /Thanks,
    P Prakash

    Ok.. i tried like this ...i am getting the same error .
    Please take a look at this .
    DECLARE
       TYPE rec_emps IS RECORD (
          ename   emp.ename%TYPE,
          empno   emp.empno%TYPE
       TYPE ty_rec_emps IS TABLE OF rec_emps;
       v_emps         ty_rec_emps := ty_rec_emps ();
       v_emp_miller   ty_rec_emps := ty_rec_emps ();
    BEGIN
       SELECT ename,
              empno
       BULK COLLECT INTO v_emps
         FROM emp;
       v_emp_miller.EXTEND ();
       v_emp_miller (v_emp_miller.LAST).ename := 'MIILER';
       v_emp_miller (v_emp_miller.LAST).empno := 7934;
        IF  v_emp_miller  MEMBER OF V_EMPS
        THEN
            dbms_output.put_line('sssssssssssss!!!!!!!!');
        END IF ;
       FOR v_emps_indx IN v_emps.FIRST .. v_emps.LAST
       LOOP
          DBMS_OUTPUT.put_line (   v_emps (v_emps_indx).ename
                                || ' '
                                || v_emps (v_emps_indx).empno
       END LOOP;
    END;
    /Thanks for the quick response .
    Thanks,
    P Prakash

  • 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

  • UTL_COMPRESS.LZ_COMPRESS wrong number or types of arguments in call

    Hi All -
    I've been trying to use the UTL_COMPRESS.LZ_COMPRESS in a 10gR2 (10.2.0.3) database on some interMedia objects as well as plain olf LOB objects, but keep getting these errors:
    PLS-00306: wrong number or types of arguments in call to 'LZ_COMPRESS'
    ORA-00932: inconsistent datatypes: expected NUMBER got BLOB
    For the life of me, I can't figure out what I'm doing wrong. Any insight or help would be much appreciated.
    CREATE TABLE AUDIO_TBL
    ( "AUDIO_ID" RAW(32),
    "AUDIO" "ORDSYS"."ORDAUDIO" );
    CREATE OR REPLACE PROCEDURE compress_audio1 (p_audioID IN RAW) AS
    v_src_audio ORDSYS.ORDAudio;
    v_compressed_audio blob;
    ctx RAW(64) :=NULL;
    BEGIN
    SELECT audio INTO v_src_audio FROM audio_tbl WHERE audio_id = p_audioID FOR UPDATE;
    dbms_lob.createtemporary(v_compressed_audio,true); -- make temp LOB
    obj.getContentInLob(ctx,v_compressed_audio); -- write from ORDAudio into LOB
    utl_compress.lz_compress(v_src_audio, v_compressed_audio); -- compress LOB
    UPDATE audio_tbl SET audio = v_compressed_audio WHERE audio_id = p_audioID;
    dbms_lob.freetemporary(v_compressed_audio); -- free temp LOB
    COMMIT;
    EXCEPTION
    WHEN ORDSYS.ORDSourceExceptions.METHOD_NOT_SUPPORTED THEN
    DBMS_OUTPUT.PUT_LINE('ORDSourceExceptions.METHOD_NOT_SUPPORTED caught');
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('EXCEPTION caught');
    END;
    Warning: Procedure created with compilation errors.
    SQL> show error
    Errors for PROCEDURE COMPRESS_AUDIO1:
    LINE/COL ERROR
    8/5 PL/SQL: Statement ignored
    8/9 PLS-00302: component 'GETCONTENTINLOB' must be declared
    9/5 PL/SQL: Statement ignored
    9/5 PLS-00306: wrong number or types of arguments in call to 'LZ_COMPRESS'
    10/3 PL/SQL: SQL Statement ignored
    10/28 PL/SQL: ORA-00932: inconsistent datatypes: expected NUMBER got BLOB
    Tried to use the example in the docs here
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14297/ch_audref.htm#i1084527
    where it's explained how to write out an ORDAudio type to a BLOB, which seems to be necessary to use UTL_COMPRESS.
    I just can't see what I'm doing wrong here.
    RB

    I am not sure and as I am at a cutomer site I can not run a trial on their production servers ... but my suspicion is that you are trying to compress non-blob data.
    Do the following:
    desc AUDIO_TBL
    set describe depth all linenum on indent on
    desc AUDIO_TBL

  • Wrong number or types of arguments in call to procedure name

    assuming i have this pl/sql code:
    CREATE OR REPLACE PACKAGE MyPackage AS
    TYPE tab_array IS TABLE OF VARCHAR2(300);
    PROCEDURE my_procedure(in_values IN tab_array);
    END MyPackage;
    CREATE OR REPLACE PACKAGE BODY MyPackage AS
    PROCEDURE my_procedure(in_values IN tab_array) IS
    BEGIN
    DBMS_OUTPUT.PUTLINE('This is only a test');
    END my_procedure;
    END MyPackage;
    when i tried typing this on SQL*Plus
    execute mypackage.my_procedure('value1, value2, value3');
    it gives an error like:
    PLS-00306: wrong number or types of arguments in call to 'MY_PROCEDURE'
    PL/SQL: Statement ignored
    Is my parameters incorrect? What should the parameter be? Please give me a sample code.
    Thanks.

    Hi,
    1. typing error: there should be an underline.
    i.e. DBMS_OUTPUT.PUT_LINE('This is only a test');
    2. Since the tab_array type is user defined (although
    it is VARCHAR2), When the package is called, it cannot
    recognize what you pass in even if you declare it in
    the calling block.
    You should create it as global type, then this type
    can be visible to all other PL/SQL, stored procedure &
    stored package. you can type the following in the SQL/PLUS:
    SQL> CREATE TYPE tab_array AS TABLE OF VARCHAR2(300);
    2 /
    3. Remove the declaration line for the tab_array in the package
    and package body. If you declare it locally in the package,
    it will override the global one and cannot be recognized again.
    So just remove it. it should be compiled and run.
    Hope you succeed.
    Thanks.

Maybe you are looking for

  • My Ipod Classic will not register with itunes

    I have followed all the steps to help fix this problem. My ipod stopped syncing and charging when connected to my computer and itunes no longer recognises my ipod so i can not get into the ipod itself to do anything through Itunes. As recommended by

  • Automating (scripting) in Mountain Lion - advice ?

    Hi, A number of years ago I had some programming routine work on Mac, but it has been a while now (for the elderly amongst us ... I extensively programmed in Pascal and in HyperCard ...) Now I would like to do some scripting to automate some tasks in

  • Help Required With SQL Subquery Across DB Link - Takes Long Time

    Hi, Apologies if this is not the correct forum but I am implementing this through HTMLDB. I am trying to run a SQL query over a DB link with a sub query on tables in my HTMLDB workspace. The SQL query over the database link takes 1.23 seconds to run

  • Does "Automatically fill free space with songs" refill the iPhone regularly

    I have a bit of music I'd like to have it shuffle, and having it essentially use the autofill command every time I sync my iPhone would be a bonus. So when you choose "Automatically fill free space with songs" in Sync Music, does it refill the iPhone

  • How to disable Security Alert popup each time for trusted site in IE on Win XP

    A user is using slow computer running with Windows XP SP3 and Java 7 update 45 version. When user open this site www.rocars.gov.hk in Internet Explorer 8, it will wait around 2 minutes to disaply security alert popup windows.  Then user needs to clic