-- BASIC SYNTAX OF ARRAY IN ORACLE PL/SQL
CREATE OR REPLACE PROCEDURE proc1(p_strarr DBMS_SQL.VARCHAR2S ) AS
BEGIN
dbms_output.put_line('Length of array = ' || p_strarr.COUNT ) ;
FOR i IN 1..p_strarr.COUNT LOOP
dbms_output.put_line('Array element '|| i ||' = '|| p_strarr(i));
END LOOP;
END;
/
-- Test it...
SET SERVEROUTPUT ON
DECLARE
v_strarr DBMS_SQL.VARCHAR2S;
BEGIN
v_strarr(1) := 'mamun';
v_strarr(2) := 'ashik';
v_strarr(3) := 'kamal';
v_strarr(4) := '';
v_strarr(5) := 'tukh';
proc1(v_strarr);
END;
/
No comments:
Post a Comment