Skip to Main Content

SQL & PL/SQL

How to call function which has input parameter type??

965816Jan 10 2014 — edited Jan 10 2014

Hi all,

I am facing problem while

executing select ftest1(123) from dual;

and i am getting error

ORA-006553:PLS-306 : wrong number or types of arguments in call to ftest1

and this is the code for function;

create package body pkg1 is

type no_array is table of NUMBER index by binary_integer;

end pkg1;

CREATE OR REPLACE FUNCTION ftest1(lvdriver pkg1.No_arrray)

    RETURN VARCHAR2

IS

    lv VARCHAR2(100);

BEGIN

    FOR i IN lvdriver.first .. lvdriver.last LOOP

        SELECT last_nm

          INTO lv

          FROM person

         WHERE person_id = lvdriver(i);

        dbms_output.put_line(lv);

    END LOOP;

    RETURN lv;

END;

how to pass array values to function

i need to pass multiple values to array here it is lvdriver(1,2,3,123,4,5)??

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 7 2014
Added on Jan 10 2014
2 comments
624 views