Domanda

i need something like this in procedure PLSQL

 arrayCount:=parArray.Count;
 For i In 1 .. arrayCount Loop
    lsPar(i):=parArray(i);
 End Loop;

is it possible? Thx for advice! :)

È stato utile?

Soluzione

If you're working on oracle ,then this piece of anonymous block will work for you

 declare
    TYPE parArray IS TABLE OF VARCHAR2(64) index by binary_integer;
    v_parArray parArray;
    arrayCount number;
    lsPar parArray;

    begin
    v_parArray(1):='A';
    v_parArray(2):='B';
    v_parArray(3):='C';

    arrayCount:=v_parArray.Count;
       For i In 1 .. arrayCount 
       Loop
          lsPar(i):=v_parArray(i);
       End Loop;

     arrayCount:=lsPar.Count;
        For i In 1 .. arrayCount
         Loop
          dbms_output.put_line('The value of Ispar at index '||i||' is '||lsPar(i));
        End Loop;
     end;  

Output

 The value of Ispar at index 1 is A
 The value of Ispar at index 2 is B
 The value of Ispar at index 3 is C
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top