VARRAY ORA-06533: Subscript beyond County

Hi all
I stated in my package body
create or replace package body mng_res_pack
is
------------------------------------------------------
TYPE rest_ans_type IS VARRAY(5) OF NUMBER(1);
rest_ans rest_ans_type:=rest_ans_type();
-----------------------------------------------------
PROCEDURE fetch_rest_data
 IS
 rest_rec restore_users%ROWTYPE;
 MONE NUMBER :=0;
 BEGIN 
 FOR I IN 1..5
 LOOP 
 DBMS_OUTPUT.PUT_LINE ('HERE'||' '||rest_ans(i));
 END LOOP;
.
.
.
end fetch_rest_data;
end mng_res_pack;
When I run the procedure, I get the error
ERROR on line 1:
ORA-06533: index beyond County
-----------------------------------------------------
ORA-06512: at "MNG_RES_PACK", line 46
Why?
the size of the varray is 5, and I've also initialized?
Help, please
Thanks in advance
Naama

>
even if I does not initialize the varray with numbers, I stil I declare it as a size of 5.
I still don't understand why he wrote that it out of bounds. NULL is only the value, not the size of the varray.
He must have made loops 5 times and display null, no?
>
No - the VARRAY itself is EMPTY - meaning there is no entry for access. You cannot browse entries because there isn't any.
The declared 5 size is simply the maximum number of entries that the VARRAY can ever - but it does not all entries; You must do.

See Varrays in the doc of the PL/SQL language
http://docs.Oracle.com/CD/E11882_01/AppDev.112/e17126/composites.htm#CHDEIJHD
>
An uninitialized variable varray is a collection of nowhere. You must initialize, either by making empty or by assigning a value not NULL. For more information, see 'Constructors of Collection' and "Assign values to the Variables Collection".

Tags: Database

Similar Questions

  • ORA-06533: index beyond County ORA-06512:

    Hello

    I tried to insert the collection of data (below) in two individual tables, when I tried to insert a unique collection of data in two individual tables, it has been introduced.

    But when I tired to insert several collections into two individual tables, I am getting below error.

    Einf is my PLSQL CODE with details of the error,

    could you please give me solution.

    Thanks in advance .

    Set serveroutput on

    DECLARE

    /*

    PL ORG_ADDRESSES_PHONES_TAB: = ORG_ADDRESSES_PHONES_TAB (ORG_ADDRESSES_PHONES_TYPE ('a1', 'c1', 's1', 'p1', 1, ORG_PHONES_TAB (ORG_PHONES_TYPE ('a2', 'p1', 's1', 'e1')));)

    If inserted unique collections

    */

    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    ------------------------------------------------------------------------          But Below data is not inserting because of multiple collections          ----------------------------------------------------------------------------------------------

    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    PL ORG_ADDRESSES_PHONES_TAB: = ORG_ADDRESSES_PHONES_TAB (ORG_ADDRESSES_PHONES_TYPE ("a1", "c1", "s1", "p1", 1, ORG_PHONES_TAB (ORG_PHONES_TYPE ("a2", "p1", "s1", "e1"))), ORG_ADDRESSES_PHONES_TYPE ('a2', 'c2', 's3', 'p4', 2, ORG_PHONES_TAB (ORG_PHONES_TYPE ('d3', 'f3', 'ws3', 're3')));)

    BEGIN

    I'm IN pl. FIRST... LAST pl.

    LOOP

    PL. EXTEND;

    dbms_output.put_line (i);

    dbms_output.put_line ('next': pl (i) .ORG_PHONES.) Next (1));

    PL of YEW. (I) exists, THEN - if the element exists then display

    dbms_output.put_line (' ADDRESS ': pl (i).) ADDRESS);

    dbms_output.put_line (' CITY ' | pl (i).) IN TOWN);

    dbms_output.put_line ('STATE_CODE' | pl (i).) STATE_CODE);

    dbms_output.put_line (' zip_code ' | pl (i).) ZIP_CODE);

    dbms_output.put_line ('PRIMARY_YESNO': (i) pl.) PRIMARY_YESNO);

    dbms_output.put_line ('POSTAL Code': pl (i) .ORG_PHONES (i).) AREA CODE);

    dbms_output.put_line ('PREFIX': pl (i) .ORG_PHONES (i).) PREFIX);

    dbms_output.put_line ('SUFFIX' | pl (i) .ORG_PHONES (i).) SUFFIX);

    dbms_output.put_line ('EXTENSION' | pl (i) .ORG_PHONES (i).) EXTENSION);

    -pl. EXTEND;

    -pl (i) .ORG_PHONES. EXTEND;

    END IF;

    PL (i) .ORG_PHONES. EXTEND;

    END LOOP;

    COMMIT;

    -dbms_output.put_line ('hii');

    end;

    ----------------------------------------

    Failed query see the settings

    Error from line: 3 in command.

    DECLARE

    -declare a variable of type projecttable

    PL ORG_ADDRESSES_PHONES_TAB: = ORG_ADDRESSES_PHONES_TAB (ORG_ADDRESSES_PHONES_TYPE ("a1", "c1", "s1", "p1", 1, ORG_PHONES_TAB (ORG_PHONES_TYPE ("a2", "p1", "s1", "e1"))), ORG_ADDRESSES_PHONES_TYPE ('ta2', 'uc2', 'vs3', 'wp4', 2, ORG_PHONES_TAB (ORG_PHONES_TYPE ('d3', 'f3', 'ws3', 're3')));)

    -How to display the values in the table

    BEGIN - beginning of the main block

    I'm in pl.first... pl. Last

    loop

    dbms_output.put_line (i);

    dbms_output.put_line (' ADDRESS ': pl (i).) ADDRESS);

    dbms_output.put_line (' CITY ' | pl (i).) IN TOWN);

    dbms_output.put_line ('STATE_CODE' | pl (i).) STATE_CODE);

    dbms_output.put_line (' zip_code ' | pl (i).) ZIP_CODE);

    dbms_output.put_line ('PRIMARY_YESNO': (i) pl.) PRIMARY_YESNO);

    dbms_output.put_line ('POSTAL Code': pl (i) .ORG_PHONES (i).) AREA CODE);

    dbms_output.put_line ('PREFIX': pl (i) .ORG_PHONES (i).) PREFIX);

    dbms_output.put_line ('SUFFIX' | pl (i) .ORG_PHONES (i).) SUFFIX);

    dbms_output.put_line ('EXTENSION' | pl (i) .ORG_PHONES (i).) EXTENSION);

    -pl. EXTEND;

    PL (i) .ORG_PHONES. EXTEND;

    end loop;

    COMMIT;

    -dbms_output.put_line ('hii');

    end;

    Error report-

    ORA-06533: index beyond County

    ORA-06512: at line 19

    06533 00000 - 'County beyond index'

    * Cause: A limit index was greater than the number of a varray

    or too big for a nested table.

    * Action: Verify program logic and extend explicitly if necessary.

    1

    ADDRESS a1

    CITY c1

    STATE_CODE s1

    Zip_code p1

    PRIMARY_YESNO 1

    CODEZONE a2

    PREFIX p1

    SUFFIX s1

    E1 EXTENSION

    2

    ADDRESS ta2

    Uc2 CITY

    STATE_CODE vs3

    Zip_code wp4

    PRIMARY_YESNO 2

    You have to LOOP in your table of pl (I) .ORG_PHONES (I)

    CREATE OR REPLACE PROCEDURE myproc AS
    
       pl ORG_ADDRESSES_PHONES_TAB := ORG_ADDRESSES_PHONES_TAB(ORG_ADDRESSES_PHONES_TYPE('a1'
                                                                                        ,'c1'
                                                                                        ,'s1'
                                                                                        ,'p1'
                                                                                        ,1
                                                                                        ,ORG_PHONES_TAB(ORG_PHONES_TYPE('a2'
                                                                                                                       ,'p1'
                                                                                                                       ,'s1'
                                                                                                                       ,'e1')
                                                                                                       )
                                                                                       )
                                                              ,ORG_ADDRESSES_PHONES_TYPE('a2'
                                                                                        ,'c2'
                                                                                        ,'s3'
                                                                                        ,'p4'
                                                                                        ,2
                                                                                        ,ORG_PHONES_TAB(ORG_PHONES_TYPE('d3'
                                                                                                                       ,'f3'
                                                                                                                       ,'ws3'
                                                                                                                       ,'re3')
                                                                                                       )
                                                                                        )
                                                              );
    
    BEGIN
    
       DBMS_OUTPUT.PUT_LINE('First: ' || TO_CHAR(pl.FIRST));
       DBMS_OUTPUT.PUT_LINE('Last: ' || TO_CHAR(pl.LAST));
    
       FOR I IN pl.FIRST..pl.LAST LOOP
    
          pl.EXTEND;
    
          DBMS_OUTPUT.PUT_LINE(I);
          DBMS_OUTPUT.PUT_LINE('next ' || pl(I).ORG_PHONES.NEXT(1));
    
          IF(pl.EXISTS(I)) THEN                       -- if item exists then display
    
             DBMS_OUTPUT.PUT_LINE('ADDRESS  ' || pl(I).ADDRESS);
             DBMS_OUTPUT.PUT_LINE('CITY  ' || pl(I).CITY);
             DBMS_OUTPUT.PUT_LINE('STATE_CODE  ' || pl(I).STATE_CODE);
             DBMS_OUTPUT.PUT_LINE('POSTAL_CODE  ' || pl(I).POSTAL_CODE);
             DBMS_OUTPUT.PUT_LINE('PRIMARY_YESNO  ' || pl(I).PRIMARY_YESNO);
    
             FOR j IN pl(I).org_phones.FIRST..pl(I).org_phones.LAST LOOP
    
                DBMS_OUTPUT.PUT_LINE('AREACODE  ' || pl(I).ORG_PHONES(j).AREACODE);
                DBMS_OUTPUT.PUT_LINE('PREFIX  ' || pl(I).ORG_PHONES(j).PREFIX);
                DBMS_OUTPUT.PUT_LINE('SUFFIX  ' || pl(I).ORG_PHONES(j).SUFFIX);
                DBMS_OUTPUT.PUT_LINE('EXTENSION  ' || pl(I).ORG_PHONES(j).EXTENSION);
    
             END LOOP;
    
          --pl.EXTEND;
          --pl(i).ORG_PHONES.EXTEND;
    
          END IF;
    
          pl(I).ORG_PHONES.EXTEND;
    
       END LOOP;
    
       COMMIT;
    
       --dbms_output.put_line('hii');
    
    EXCEPTION
    
       WHEN OTHERS THEN
          DBMS_OUTPUT.PUT_LINE(DBMS_UTILITY.FORMAT_ERROR_STACK);
    
    END myproc;
    
  • ORA-06533: index beyond County

    Hello

    I want to create and use the two-dimensional array in plsql.

    I created the below sample plsql

    CREATE OR REPLACE FUNCTION fun_array RETURN number
    IS
        type sarray is table of varchar2(100);
        type tarray is table of sarray;
         array2D    tarray;
    BEGIN
         array2D  := new tarray();
         array2D (1)(1)  :='A';
          DBMS_OUTPUT.put_line(array2D(1) (1));
         RETURN 1;
    END;
    
    

    When I run this, I got the below error

    SQL> select fun_array from dual;
    select fun_array from dual
           *
    ERROR at line 1:
    ORA-06533: Subscript beyond count
    ORA-06512: at "PERFEXDEMO.FUN_ARRAY", line 8
    
    

    where I'm wrong?

    SQL> select * from v$version
      2  /
    
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Release 10.2.0.1.0 - Production
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    

    SQL terminΘe this Message was edited by: Karthik_N

    Seems a piece totally meaningless to the code, but I suspect you're just learning/testing.

    Try

    create or replace function fun_array return number
    is
      type sarray is table of varchar2(100);
      type tarray is table of sarray;
      array2d tarray;
    begin
      array2d := new tarray();
      array2d.extend;
      array2d(1):=new sarray();
      array2d(1).extend;
      array2d(1)(1) := 'A';
      dbms_output.put_line(array2d(1) (1));
      return 1;
    end;
    /
    
  • Error: ORA-06533 beyond County index

    Hello
    I am trying to create a varray of strings using items returned from a nested table, but get the error ora-06533, can someone pls help me over come this
    I use a script like below:

    ' declare
    number of Time_start;
    number of Time_end;
    type text_nt is table of the cpw_account_info % rowtype;
    v_eName_nt text_nt;

    term_acc type is varray (5000) of varchar2 (5000);
    term_acc_stmnt term_acc;--:=term_acc();

    cursor c_emp is select * from cpw_account_info;

    Start
    Open c_emp;
    Time_start: = dbms_utility.get_time;
    loop
    C_emp fetch bulk collect within the limits of v_eName_nt 500;
    Dbms_output.put_line ('v_eName_nt.count: ' | v_eName_nt.) (Count);
    Dbms_output.put_line('===');
    because me in 1.v_eName_nt.count
    loop
    Dbms_output.put_line (v_ename_nt (i). ACCOUNT_NUM | «, » || v_ename_nt (i). END_DAT | «, » || v_ename_nt (i). TERMINATION_REASON_ID | «, » || v_ename_nt (i). ERLY_TERM_CHRG_BOO);
    term_acc_stmnt:=term_acc();
    term_acc_stmnt.extend (v_eName_nt. (Count);
    -create the string array using varray
    term_acc_stmnt: = term_acc('ACC.) TERMACC('||)
    v_ename_nt (i). ACCOUNT_NUM | «, » ||
    v_ename_nt (i). END_DAT | «, » ||
    v_ename_nt (i). TERMINATION_REASON_ID | «, » ||
    v_ename_nt (i). ERLY_TERM_CHRG_BOO |
    ');'
    );
    dbms_output.put_line (' put an end to the string of API: ' | term_acc_stmnt (i));
    end loop;
    When the exit c_emp % NOTFOUND;
    end loop;
    Time_end: = dbms_utility.get_time;
    dbms_output.put_line ('time_start: ' |) Time_start);
    dbms_output.put_line ('time_end: ' |) Time_end);
    dbms_output.put_line (' time in ms: ' |) (Time_end-Time_start)/100 * 1000);
    close c_emp;
    end;
    /'

    DBMS_OUTPUT:
    v_eName_nt. Count: 5
    *=====================================*
    * 123455, 09-JUL-11, 1, F *.
    Finish the string API: VAC. TERMACC(123455,09-JUL-11,1,F);
    * 123456, 09-JUL-11, 1, F *.
    * ora-06533 beyond County index *.
    * / * out with this error script errors when I'm waiting for the script to go ahead and produce strings as *.
    Finish the string API: VAC. TERMACC(99999,09-JUL-11,1,F);
    Finish the string API: VAC. TERMACC(11111,09-JUL-11,1,F);
    Complete the string API: VAC. TERMACC(22222,09-JUL-11,1,F); /*

    I guess I'm getting married a mistak of accessin varray in a nested table loop, your suggestions please

    Published by: Camilla July 9, 2011 21:28
    declare
        time_start number;
        time_end number;
        type text_nt is table of cpw_account_info%rowtype;
        v_eName_nt text_nt;
        type term_acc is varray(5000) of varchar2(5000);
        term_acc_stmnt term_acc :=term_acc();
        cursor c_emp is select * from cpw_account_info;
    begin
        open c_emp;
        time_start:=dbms_utility.get_time;
        loop
          fetch c_emp bulk collect into v_eName_nt limit 500;
          DBMS_OUTPUT.put_line('v_eName_nt.count: '||v_eName_nt.count);
          DBMS_OUTPUT.put_line('=====================================');
          for i in 1..v_eName_nt.count loop
            DBMS_OUTPUT.put_line(v_ename_nt(i).ACCOUNT_NUM||','||v_ename_nt(i).END_DAT||','||
                                 v_ename_nt(i).TERMINATION_REASON_ID||','||v_ename_nt(i).ERLY_TERM_CHRG_BOO);
            term_acc_stmnt.extend;
            term_acc_stmnt(term_acc_stmnt.count) := 'ACC.TERMACC('||
            v_ename_nt(i).ACCOUNT_NUM ||','||
            v_ename_nt(i).END_DAT ||','||
            v_ename_nt(i).TERMINATION_REASON_ID||','||
            v_ename_nt(i).ERLY_TERM_CHRG_BOO || ');';
            dbms_output.put_line('Terminate API String: '|| term_acc_stmnt(i));
          end loop;
          exit when c_emp%NOTFOUND;
        end loop;
        time_end:=dbms_utility.get_time;
        dbms_output.put_line('time_start: '||time_start);
        dbms_output.put_line('time_end: '||time_end);
        dbms_output.put_line('time elapsed in ms: '||(time_end-time_start)/100*1000);
        close c_emp;
    end;
    /
    v_eName_nt.count: 5
    =====================================
    123455,09-JUL-11,1,F
    Terminate API String: ACC.TERMACC(123455,09-JUL-11,1,F);
    123456,09-JUL-11,1,F
    Terminate API String: ACC.TERMACC(123456,09-JUL-11,1,F);
    123457,09-JUL-11,1,F
    Terminate API String: ACC.TERMACC(123457,09-JUL-11,1,F);
    123458,09-JUL-11,1,F
    Terminate API String: ACC.TERMACC(123458,09-JUL-11,1,F);
    123459,09-JUL-11,1,F
    Terminate API String: ACC.TERMACC(123459,09-JUL-11,1,F);
    time_start: 8172625
    time_end: 8172625
    time elapsed in ms: 0
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.

  • Index off counting problem

    java.sql.SQLException: ORA-20001: Napaka: - 6533 - ERROR - ORA-06533: Subscript beyond County
    ORA-06512: at "TESTOD. VRNI_PODATKE', line 66
    ORA-06512: at "TESTOD. VRNI_PODATKE', line 111
    ORA-06512: at "TESTOD. VRNI_PODATKE', line 111
    ORA-06512: at "TESTOD. VRNI_PODATKE', line 111
    ORA-06512: at "TESTOD. DOKUMENTACIJA", line 448
    ORA-06512: at line 1

    line: 66:
    ---------------------
    O1: = ob (stevec, ref_tabela, pk_tabele, tab_obj);

    Start

    IF o1 IS NOT NULL, THEN
    v_table (St): = o1; -HERE IS ERROR
    END IF;

    EXCEPTION
    WHILE OTHERS THEN
    raise_application_error (-20001, ' Napaka:-' |) SQLCODE |' - ERROR - ' | SQLERRM);
    end;

    v_table is the setting of IN OUT nocopy varray_data

    varray_data is of type pl/sql:

    create or replace TYPE varray_data AS VARRAY (1000) to ob1

    Ob1 is pl/sql type:

    create or replace TYPE AS OBJECT (indeks NUMBER ob1,
    name_table VARCHAR2 (200),
    name_column VARCHAR2 (200),
    ob image)

    create or replace TYPE IS VARRAY ob (100) of ob2

    create or replace TYPE ob2 AS OBJECT (column VARCHAR2 (200),)
    imp_column VARCHAR2 (200),
    ref_indeks NUMBER)

    line 111:

    st_m: = v_table (st) .table. COUNTY;
    FOR j IN 1... st_m LOOP
    IF v_table (st) .table (j) .imp_column IS NULL THEN
    uk_table: = v_table (st) .table (j) .column.
    pk_table: = poisci_pk_tabele (table_reference);

    inner_st: = v_table (st) .table (j) .ref_indeks; -HERE IS ERROR (line 111)
    inner_table: = vrni_podatke_r (v_table, table_reference, uk_table, inneri_st, st);
    END IF;
    END LOOP;


    Thanks for all the help.

    Hello!

    Sorry for my late reply!

    You see 'extend' in space for a single item varray, you must then makes a measurement for each item before inserting it.
    This error is now produced when st is higher then 1000 in your case

    T

  • Nested table does not

    [code]

    DECLARE

    IS of TYPE courseList as TABLE OF THE VARCHAR2 (500);

    my_courses courseList as;

    BEGIN

    my_courses: = courseList ('Econ 2010', 'Acct 3401', 'Mgmt 3100');

    I'm in 1.10

    LOOP

    my_courses (i): = i | "- Test';

    END LOOP;

    BECAUSE me in 1.my_courses.count

    loop

    dbms_output.put_line (my_courses (i));

    END LOOP;

    END;

    /

    Can someone tell me please

    (1) why it does not say ORA-06533: Subscript beyond County

    (2) I would like to add 10 records in the table using my_courses (i): = i | "- Test';

    so, my final table would have 13 records. Don't know why it's a failure

    Please notify

    Thank you

    [/ code]

    Hello

    After executing the line

    my_courses: = courseList ('Econ 2010', 'Acct 3401', 'Mgmt 3100');

    my_courses is a box with 3 compartments.  You get the error when you try to put something in the 4th compartment.

    You must extend my_courses, adding 10 compartments again, like this:

    DECLARE
    IS of TYPE courseList as TABLE OF THE VARCHAR2 (500);
    my_courses courseList as;
    BEGIN
    my_courses: = courseList ('Econ 2010', 'Acct 3401', 'Mgmt 3100');
     
    my_courses. EXPAND (10);

    I'm in 1.10
    LOOP
    my_courses (3 + i): i = | "- Test';
    END LOOP;
     
    BECAUSE me in 1.my_courses.count
    LOOP
    dbms_output.put_line (my_courses (i));
    END LOOP;
     
    END;
    /

  • County index beyond

    Hello

    I used a table in a loop block, in a function
    so, I stated the table like this

    Varray_numbers TYPE VARRAY (35) NUMBER IS (13.3);
    v_varray varray_numbers: = varray_numbers();

    and I used it in a loop

    I'm in 1.35
    loop
    .. .TRT...
    v_varray.extend;
    Select (case when (i not in (17,18,22,23,24)) then ((champ_2_i + champ_6_i) from double))
    (other)
    case
    When I = 17 then (select champ_2_i + champ_6_i + v_varray (11) + (v_varray (14) - v_varray (13)) double)
    When I = 18 then (select champ_2_i + champ_6_i + v_varray (12) + (v_varray (16) - v_varray (15)) double)
    When I = 22 then (select champ_2_i + champ_6_i + v_varray (5) + (v_varray (8) - v_varray (19)) double)
    When I = 23 then (select champ_2_i + champ_6_i + v_varray (6) + (v_varray (9) - v_varray (20)) double)
    When I = 24 then (select champ_2_i + champ_6_i + v_varray (7) + (v_varray (10) - v_varray (21)) double)
    a piece)) in v_varray (i) of the double;

    ... trt...


    end loop;
    I got this error:
    ORA-06533: index beyond County

    someone has an idea?

    Concerning
    ELYES
    PS version of oracle: oracle 9i

    Edited by: user10393090 Jan 13. 2009 03:04

    Edited by: user10393090 Jan 13. 2009 03:18

    Now that you mentioned that you have an inner and an outer loop, which explains things.

    In the inner loop, you are ranging from 35 times. So when you get to the second iteration of the outer loop, the varray already has 35 items (and they are all filled). You STRETCH for the 36th time and the declaration of VARRAY (35) causes an exception.

    So the easiest thing would be to make the MEASURE only once, before your external loop.

    Now, that's fine as long as there is no danger that one of the missions can be missed (that is to say that there is no danger of the use of the value of a previous iteration of the outer loop.

    You can also (and more "structured block" you can declare inside v_varray the outer loop (so it is not retained between iterations)):

    <>
    FOR l in 1..X LOOP
       DECLARE
          TYPE varray_numbers IS VARRAY(35) OF NUMBER(13,3);
          v_varray varray_numbers := varray_numbers();
       BEGIN
          v_varray.EXTEND(35);
    
         <>
          FOR i in 1..35 LOOP
                v_varray(i) := ...
          END LOOP; -- inner loop
    
       END; -- end scope for v_varray
    END LOOP; -- outer loop
    

    Or you can just use an uncontrolled associative array:

    TYPE array_numbers IS TABLE of NUMBER(13,3) INDEX BY pls_integer
    v_array array_numbers
    

    Then you can assign values without all this palaver EXTEND.

    Nigel cordially

  • PL/SQL tables

    Hello guys,.
    I have a few questions about the PL/SQL tables

    (1) if I don't specify the 'INDEX BY' clause, they are indexed by PLS_INTEGER default, right?

    (2) consider this package specification
    CREATE OR REPLACE PACKAGE Testxyz AS
    
    TYPE tab_Numbers IS TABLE OF PLS_INTEGER;
    
    PROCEDURE TestNumber(ptab_Numbers IN tab_Numbers := NULL);
    
    
    END Testxyz;
    So I created a table (I hope it's standard indexed by type of data pls_integer) and I am in him passing as parameter to a procedure. Because I want this parameter be optional I assign null inside.

    Now, I change the table definition for:
    CREATE OR REPLACE PACKAGE Testxyz AS
    
    TYPE tab_Numbers IS TABLE OF PLS_INTEGER INDEX BY PLS_INTEGER;
    
    PROCEDURE TestNumber(ptab_Numbers IN tab_Numbers := NULL);
    
    
    END Testxyz;
    Try to compile it and you get:
    Error (5.53): PLS-00382: expression is of the wrong type

    Why?

    (3) because I need this optional parameter, I use the first statement:
    CREATE OR REPLACE PACKAGE Testxyz AS
    
    TYPE tab_Numbers IS TABLE OF PLS_INTEGER;
    
    PROCEDURE TestNumber(ptab_Numbers IN tab_Numbers := NULL);
    
    
    END Testxyz;
    Now I create an anonymous block, and you want to set something in the table
    DECLARE
       vtab_Numbers TESTXYZ.tab_Numbers;
    BEGIN
    
       vtab_Numbers(1) := 5;
    
    
    END;
    /
    When you try to run it, I got:
    06531 00000 - 'refers to an uninitialized collection.

    Can someone help me understand this problem?
    Is it possible to have input of type PL/SQL table setting and have a standard null, are assigned?

    Thanks, Dan

    (1) if I don't specify the 'INDEX BY' clause, they are indexed by PLS_INTEGER default, right?

    N ° or somehow.

    More critical, and using official terms of [url http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/composites.htm#CHDBHJEI] documentation so that we don't get into unnecessary arguments about the correct terms for these features, it's the difference between types of ASSOCIATIVE TABLE and the IMBRIQUEE TABLE collection.

    If you omit the "INDEX BY" clause, it is a type of TABLE IMBRIQUEE collection. A type of TABLE IMBRIQUEE is always indexed by PLS_INTEGER.

    When you include the ' INDEX OF ', this is an ASSOCIATIVE ARRAY.

    (2) consider this package specification
    Try to compile it and you get:
    Error (5.53): PLS-00382: expression is of the wrong type

    Why?

    Because you cannot assign NULL to an ASSOCIATIVE ARRAY.

    In the same way, you cannot do this:

    SQL> DECLARE
      2   TYPE tab_Numbers IS TABLE OF PLS_INTEGER INDEX BY PLS_INTEGER;
      3   v1 tab_Numbers;
      4  BEGIN
      5   v1 := NULL;
      6  END;
      7  /
     v1 := NULL;
           *
    ERROR at line 5:
    ORA-06550: line 5, column 8:
    PLS-00382: expression is of wrong type
    ORA-06550: line 5, column 2:
    PL/SQL: Statement ignored
    
    SQL> 
    

    If you want two entry points to TestNumber with an ASSOCIATIVE ARRAY or NULL then overload the procedure.

    If you want to call a procedure with a TABLE IMBRIQUE collection type you can the default empty:

    SQL> CREATE OR REPLACE PACKAGE Testxyz
      2  AS
      3   TYPE tab_Numbers IS TABLE OF PLS_INTEGER;
      4   PROCEDURE TestNumber(ptab_Numbers IN tab_Numbers DEFAULT tab_Numbers());
      5   PROCEDURE TestNumber;
      6  END Testxyz;
      7  /
    
    Package created.
    
    SQL> 
    

    (3) because I need this optional parameter, I use the first statement
    When you try to run it, I got:
    06531 00000 - 'refers to an uninitialized collection.

    Because you have not initialized it.

    Different collection types require different semantics.

    SQL> DECLARE
      2   TYPE tab_Numbers IS TABLE OF PLS_INTEGER;
      3   v1 tab_Numbers;
      4  BEGIN
      5   v1(1) := 5;
      6  END;
      7  /
    DECLARE
    *
    ERROR at line 1:
    ORA-06531: Reference to uninitialized collection
    ORA-06512: at line 5
    
    SQL> DECLARE
      2   TYPE tab_Numbers IS TABLE OF PLS_INTEGER;
      3   v1 tab_Numbers := tab_Numbers();
      4  BEGIN
      5   v1(1) := 5;
      6  END;
      7  /
    DECLARE
    *
    ERROR at line 1:
    ORA-06533: Subscript beyond count
    ORA-06512: at line 5
    
    SQL> DECLARE
      2   TYPE tab_Numbers IS TABLE OF PLS_INTEGER;
      3   v1 tab_Numbers := tab_Numbers();
      4  BEGIN
      5   v1.extend();
      6   v1(1) := 5;
      7  END;
      8  /
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    
  • PARTITIONS AND SUBPARTITIONS

    Hi all
    Here's my problem with this table:
    CREATE TABLE CKEPM.CKCLASS_ALL
    (
      DATA_POPOLAMENTO  DATE,
      OBJ_CAT           CHAR(1 BYTE),
      NODE_ID           NUMBER,
      CA_V              VARCHAR2(256 BYTE),
      CB_V              VARCHAR2(256 BYTE),
      C1                NUMBER,
      C2                NUMBER
     )
    TABLESPACE TBS_CKEPM_ALL
    PARTITION BY RANGE (DATA_POPOLAMENTO)
    SUBPARTITION BY LIST (OBJ_CAT)
    (  
      PARTITION ALL_20100130204500RQ VALUES LESS THAN (TO_DATE(' 2010-01-30 21:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
        TABLESPACE TBS_CKEPM_ALL
      ( SUBPARTITION ALL_20100130204500RQL01 VALUES ('N')    TABLESPACE TBS_CKEPM_ALL,
        SUBPARTITION ALL_20100130204500RQL02 VALUES ('L')    TABLESPACE TBS_CKEPM_ALL ),  
      PARTITION ALL_20100130210000RQ VALUES LESS THAN (TO_DATE(' 2010-01-30 21:15:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
        TABLESPACE TBS_CKEPM_ALL
      ( SUBPARTITION ALL_20100130210000RQL01 VALUES ('N')    TABLESPACE TBS_CKEPM_ALL,
        SUBPARTITION ALL_20100130210000RQL02 VALUES ('L')    TABLESPACE TBS_CKEPM_ALL )
    );
    
    CREATE BITMAP INDEX CKEPM.IX_CKCLASSALL_NODE ON CKEPM.CKCLASS_ALL
    (NODE_ID)
      TABLESPACE TBS_CKEPM_ALLX
    LOCAL (  
      PARTITION ALL_20100130204500RQ
        TABLESPACE TBS_CKEPM_ALLX
      ( SUBPARTITION ALL_20100130204500RQL01    TABLESPACE TBS_CKEPM_ALLX,
        SUBPARTITION ALL_20100130204500RQL02    TABLESPACE TBS_CKEPM_ALLX ),  
      PARTITION ALL_20100130210000RQ
        TABLESPACE TBS_CKEPM_ALLX
      ( SUBPARTITION ALL_20100130210000RQL01    TABLESPACE TBS_CKEPM_ALLX,
        SUBPARTITION ALL_20100130210000RQL02    TABLESPACE TBS_CKEPM_ALLX )
    );
    I need to collect statistics for partitions partitions/subpartitions/index of < b > ALL_20100130204500RQ < /b >, and then copy all these ALL_20100130210000RQ < /b > < b > statistics

    (1) could someone post the script DBMS_STATS.gather_table_stats and DBMS_STATS.copy_table_stats?

    I tried
    exec DBMS_STATS.gather_table_stats (ownname               => 'CKEPM',
    tabname               => 'CKCLASS_ALL',
    partname              => 'ALL_20100130204500RQ', 
    estimate_percent      => DBMS_STATS.AUTO_SAMPLE_SIZE ,
    CASCADE               => FALSE);
    
    select partition_name , last_analyzed
    from user_TAB_PARTITIONS 
    where partition_name IN ('ALL_20100130204500RQ, 'ALL_20100130210000RQ);
    
    PARTITION_NAME     LAST_ANALYZED
    ALL_20100130204500RQ     09/02/2010 8.56.20
    ALL_20100130210000RQ      
    
    exec DBMS_STATS.copy_table_stats (ownname => 'CKEPM', 
    tabname => 'CKCLASS_ALL', 
    srcpartname => 'ALL_20100130204500RQ', 
    dstpartname => 'ALL_20100130210000RQ');
    
    ORA-06533: Subscript beyond count
    ORA-06512: at "SYS.DBMS_STATS", line 16496
    ORA-06512: at line 1
    
    select partition_name , last_analyzed
    from user_TAB_PARTITIONS 
    where partition_name IN ('ALL_20100130204500RQ, 'ALL_20100130210000RQ);
    
    PARTITION_NAME     LAST_ANALYZED
    ALL_20100130204500RQ     09/02/2010 8.56.20
    ALL_20100130210000RQ     09/02/2010 8.56.20 
    (2) when I make unusable the index and rebuilding, I need also to collect statistics (how?)?

    Thank you all,
    Riccardo

    Published by: user12581838 on February 8, 2010 23:58

    Published by: user12581838 on February 9, 2010 12:48 AM
    SQL> drop table CKCLASS_ALL;
    
    Tabella eliminata.
    
    SQL>
    SQL> CREATE TABLE CKCLASS_ALL
      2  (
      3    DATA_POPOLAMENTO  DATE,
      4    OBJ_CAT           CHAR(1 BYTE),
      5    NODE_ID           NUMBER,
      6    CA_V              VARCHAR2(256 BYTE),
      7    CB_V              VARCHAR2(256 BYTE),
      8    C1                NUMBER,
      9    C2                NUMBER
     10   )
     11  PARTITION BY RANGE (DATA_POPOLAMENTO)
     12  SUBPARTITION BY LIST (OBJ_CAT)
     13  (
     14    PARTITION ALL_20100130204500RQ VALUES LESS THAN (TO_DATE(' 2010-01-30 21:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
     15   ( SUBPARTITION ALL_20100130204500RQL01 VALUES ('N')   ,
     16      SUBPARTITION ALL_20100130204500RQL02 VALUES ('L')  ),
     17    PARTITION ALL_20100130210000RQ VALUES LESS THAN (TO_DATE(' 2010-01-30 21:15:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
     18    ( SUBPARTITION ALL_20100130210000RQL01 VALUES ('N')  ,
     19      SUBPARTITION ALL_20100130210000RQL02 VALUES ('L')  )
     20  );
    
    Tabella creata.
    
    SQL> insert into CKCLASS_ALL
      2  select TO_DATE(' 2010-01-30 20:50:00', 'SYYYY-MM-DD HH24:MI:SS'),'N',0,'X','Y',0,0
      3  from dual
      4  connect by level <= 150000;
    
    Create 150000 righe.
    
    SQL>
    SQL> insert into CKCLASS_ALL
      2  select TO_DATE(' 2010-01-30 20:50:00', 'SYYYY-MM-DD HH24:MI:SS'),'L',0,'X','Y',0,0
      3  from dual
      4  connect by level <= 150000;
    
    Create 150000 righe.
    
    SQL>
    SQL> insert into CKCLASS_ALL
      2  select TO_DATE(' 2010-01-30 21:10:00', 'SYYYY-MM-DD HH24:MI:SS'),'N',0,'X','Y',0,0
      3  from dual
      4  connect by level <= 150000;
    
    Create 150000 righe.
    
    SQL>
    SQL> insert into CKCLASS_ALL
      2  select TO_DATE(' 2010-01-30 21:10:00', 'SYYYY-MM-DD HH24:MI:SS'),'L',0,'X','Y',0,0
      3  from dual
      4  connect by level <= 150000;
    
    Create 150000 righe.
    
    SQL> CREATE BITMAP INDEX IX_CKCLASSALL_NODE ON CKCLASS_ALL
      2  (NODE_ID)
      3  LOCAL (
      4    PARTITION ALL_20100130204500RQ
      5    ( SUBPARTITION ALL_20100130204500RQL01  ,
      6      SUBPARTITION ALL_20100130204500RQL02  ),
      7    PARTITION ALL_20100130210000RQ
      8    ( SUBPARTITION ALL_20100130210000RQL01  ,
      9      SUBPARTITION ALL_20100130210000RQL02  )
     10  );
    
    Indice creato.
    
    SQL> set timing on
    
    SQL> begin
      2  DBMS_STATS.gather_table_stats (ownname  => 'MAXR',
      3  tabname               => 'CKCLASS_ALL',
      4  partname              => 'ALL_20100130204500RQL01',
      5  granularity => 'SUBPARTITION',
      6  estimate_percent      => DBMS_STATS.AUTO_SAMPLE_SIZE ,
      7  CASCADE               => FALSE);
      8  end;
      9  /
    
    Procedura PL/SQL completata correttamente.
    
    Passati: 00:00:04.57
    SQL> begin
      2  DBMS_STATS.gather_table_stats (ownname               => 'MAXR',
      3  tabname               => 'CKCLASS_ALL',
      4  partname              => 'ALL_20100130204500RQL02',
      5  granularity => 'SUBPARTITION',
      6  estimate_percent      => DBMS_STATS.AUTO_SAMPLE_SIZE ,
      7  CASCADE               => FALSE);
      8  end;
      9  /
    
    Procedura PL/SQL completata correttamente.
    
    Passati: 00:00:00.29
    SQL>
    SQL> begin
      2  DBMS_STATS.copy_table_stats (ownname => 'MAXR',
      3      tabname => 'CKCLASS_ALL',
      4      srcpartname => 'ALL_20100130204500RQ',
      5      dstpartname => 'ALL_20100130210000RQ');
      6  end;
      7  /
    
    Procedura PL/SQL completata correttamente.
    
    Passati: 00:00:00.65
    
    SQL> select PARTITION_NAME, NUM_ROWS, BLOCKS, EMPTY_BLOCKS, AVG_SPACE, CHAIN_CNT, AVG_ROW_LEN, SAMPLE_SIZE, LAST_ANALYZED
      2  from dba_tab_partitions
      3  where table_owner='MAXR';
    
    PARTITION_NAME                   NUM_ROWS     BLOCKS EMPTY_BLOCKS  AVG_SPACE  CHAIN_CNT AVG_ROW_LEN SAMPLE_SIZE LAST_ANAL
    ------------------------------ ---------- ---------- ------------ ---------- ---------- ----------- ----------- ---------
    ALL_20100130204500RQ               300000       1244            0          0          0          20     10-FEB-10
    ALL_20100130210000RQ
    
    SQL> select subPARTITION_NAME, NUM_ROWS, BLOCKS, EMPTY_BLOCKS, AVG_SPACE, CHAIN_CNT, AVG_ROW_LEN, SAMPLE_SIZE, LAST_ANALYZED
      2  from dba_tab_subpartitions
      3  where table_owner='MAXR';
    
    SUBPARTITION_NAME                NUM_ROWS     BLOCKS EMPTY_BLOCKS  AVG_SPACE  CHAIN_CNT AVG_ROW_LEN SAMPLE_SIZE LAST_ANAL
    ------------------------------ ---------- ---------- ------------ ---------- ---------- ----------- ----------- ---------
    ALL_20100130204500RQL01            150000        622            0          0          0          20   150000 10-FEB-10
    ALL_20100130204500RQL02            150000        622            0          0          0          20   150000 10-FEB-10
    ALL_20100130210000RQL01
    ALL_20100130210000RQL02
    
    -- DI NUOVO DROP/CREATE/INSERT
    
    SQL> begin
      2  DBMS_STATS.gather_table_stats (ownname               => 'MAXR',
      3  tabname               => 'CKCLASS_ALL',
      4  partname              => 'ALL_20100130204500RQL01',
      5  granularity => 'SUBPARTITION',
      6  estimate_percent      => DBMS_STATS.AUTO_SAMPLE_SIZE ,
      7  CASCADE               => FALSE);
      8  end;
      9  /
    
    Procedura PL/SQL completata correttamente.
    
    Passati: 00:00:00.34
    SQL>
    SQL>
    SQL> begin
      2  DBMS_STATS.gather_table_stats (ownname               => 'MAXR',
      3  tabname               => 'CKCLASS_ALL',
      4  partname              => 'ALL_20100130204500RQL02',
      5  granularity => 'SUBPARTITION',
      6  estimate_percent      => DBMS_STATS.AUTO_SAMPLE_SIZE ,
      7  CASCADE               => FALSE);
      8  end;
      9  /
    
    Procedura PL/SQL completata correttamente.
    
    Passati: 00:00:00.18
    SQL>
    SQL> begin
      2  DBMS_STATS.copy_table_stats (ownname => 'MAXR',
      3      tabname => 'CKCLASS_ALL',
      4      srcpartname => 'ALL_20100130204500RQL01',
      5      dstpartname => 'ALL_20100130210000RQL01');
      6  end;
      7  /
    
    Procedura PL/SQL completata correttamente.
    
    Passati: 00:00:00.06
    SQL>
    SQL> begin
      2  DBMS_STATS.copy_table_stats (ownname => 'MAXR',
      3      tabname => 'CKCLASS_ALL',
      4      srcpartname => 'ALL_20100130204500RQL02',
      5      dstpartname => 'ALL_20100130210000RQL02');
      6  end;
      7  /
    
    Procedura PL/SQL completata correttamente.
    
    Passati: 00:00:00.04
    SQL>
    
    SQL> select PARTITION_NAME, NUM_ROWS, BLOCKS, EMPTY_BLOCKS, AVG_SPACE, CHAIN_CNT, AVG_ROW_LEN, SAMPLE_SIZE, LAST_ANALYZED
      2  from dba_tab_partitions
      3  where table_owner='MAXR';
    
    PARTITION_NAME                   NUM_ROWS     BLOCKS EMPTY_BLOCKS  AVG_SPACE  CHAIN_CNT AVG_ROW_LEN SAMPLE_SIZE LAST_ANAL
    ------------------------------ ---------- ---------- ------------ ---------- ---------- ----------- ----------- ---------
    ALL_20100130210000RQ               300000       1244            0          0          0          20     10-FEB-10
    ALL_20100130204500RQ               300000       1244            0          0          0          20     10-FEB-10
    
    Passati: 00:00:00.03
    SQL> select subPARTITION_NAME, NUM_ROWS, BLOCKS, EMPTY_BLOCKS, AVG_SPACE, CHAIN_CNT, AVG_ROW_LEN, SAMPLE_SIZE, LAST_ANALYZED
      2  from dba_tab_subpartitions
      3  where table_owner='MAXR';
    
    SUBPARTITION_NAME                NUM_ROWS     BLOCKS EMPTY_BLOCKS  AVG_SPACE  CHAIN_CNT AVG_ROW_LEN SAMPLE_SIZE LAST_ANAL
    ------------------------------ ---------- ---------- ------------ ---------- ---------- ----------- ----------- ---------
    ALL_20100130204500RQL01            150000        622            0          0          0          20   150000 10-FEB-10
    ALL_20100130204500RQL02            150000        622            0          0          0          20   150000 10-FEB-10
    ALL_20100130210000RQL01            150000        622            0          0          0          20   150000 10-FEB-10
    ALL_20100130210000RQL02            150000        622            0          0          0          20   150000 10-FEB-10
    

    HTH

    Max

  • extend the user collection dynamically

    Hello

    I have the folloving code:
    CREATE TYPE T_my_row OID '4711'
    IS OBJECT(field1 varchar2(10), field2 number(10));
    /
    
    CREATE TYPE TT_my_table OID '0815'
    IS TABLE OF T_my_row;
    /
    
    declare 
    my_table TT_my_table := TT_my_table()
    begin
      for my_value in (select rownum, 'a' as filed1, 2 as field2 from dual) loop
        my_table(my_value.rownum) := T_my_row(my_value.filed1,my_value.filed2);
      end loop;
    end;
    /
    but it gives me an error:
    ORA-06533: index beyond count.

    I understand that I need to say how many entries can have the table.
    But how do I do that without providing all the lines on boot?
    Y at - it something like my_table TT_my_table: = TT_my_table (p_max_row_count = > 407) ?

    Good bye
    DPT

    T.PD wrote:

    I understand that I need to say how many entries can have the table.
    But how do I do that without providing all the lines on boot?
    Y at - it something like my_table TT_my_table: = TT_my_table (p_max_row_count-online 407) ?

    Lol you can use the +. Extend() + method to add (null) objects to the collection.

    However, in the case of your example it's simpler allow PL/SQL to do all the work for you - which stretches from the collection and filling with the help of a big raise.

    For example
    Select T_My_Row (col1, col2) bulk collect into table my_table where...

    Of course, you should be aware of the size of the created collection. PGA memory is used - and as memory of the dedicated server (as opposed to shared server memory) it's expensive memory. And should not be wasted unnecessarily.

  • Select all the elements in VARRAY

    I am being selected in a table where all IDS are in a VARRAY I populated. I searched online and on the forums and cannot find an answer. Help is greatly appreciated.

    E.G.

    SELECT ID in BULK COLLECT INTO p_ID_1 FROM tbl_name WHERE contained_by = p_ID;
    v_id_1: = v_id_1();

    I'm IN p_id_1.first... p_id_1.Last LOOP
    v_id_1.extend ();
    v_id_1 (v_id_1.Last): = p_id_1 (i);
    END LOOP;

    -so far, my VARRAY is filled very well here's where I have a problem:

    SELECT the BULK COLLECT INTO p_id_2 FROM table_name_2 WHERE contained_by IN v_naid_1 ID (1);

    Everything works fine when I run the query. The problem is I want the query to select where the contained_by (all ELEMENTS in varray). Not only the first. How can I do this? I do "FIRST" thought "FINALLY" somehow? I can't list all the elements because there may be thousands.

    Thank you!

    jihuyao wrote:

    (not tested)

    And will not pass the test. First number uses the COUNT method in SQL:

    SQL> declare
      2      v_deptno sys.OdciNumberList := sys.OdciNumberList(10,20);
      3      v_empno sys.OdciNumberList;
      4  begin
      5      select empno
      6        bulk collect
      7        into v_empno
      8        from emp
      9        where deptno in (select v_deptno(level) from dual connect by level < v_deptno.count);
     10      for i in 1..v_empno.count loop
     11        dbms_output.put_line(v_empno(i));
     12      end loop;
     13  end;
     14  /
          where deptno in (select v_deptno(level) from dual connect by level < v_deptno.count);
                                                                               *
    ERROR at line 9:
    ORA-06550: line 9, column 76:
    PL/SQL: ORA-00904: "V_DEPTNO"."COUNT": invalid identifier
    ORA-06550: line 5, column 5:
    PL/SQL: SQL Statement ignored
    

    This one is easy to fix. But while you'll get:

    SQL> declare
      2      v_deptno sys.OdciNumberList := sys.OdciNumberList(10,20);
      3      v_empno sys.OdciNumberList;
      4      v_cnt number;
      5  begin
      6      v_cnt := v_deptno.count;
      7      select empno
      8        bulk collect
      9        into v_empno
     10        from emp
     11        where deptno in (select v_deptno(level) from dual connect by level < v_cnt);
     12      for i in 1..v_empno.count loop
     13        dbms_output.put_line(v_empno(i));
     14      end loop;
     15  end;
     16  /
    declare
    *
    ERROR at line 1:
    ORA-06532: Subscript outside of limit
    ORA-06512: at line 7
    

    Why? The binding occurs before execution. Mandatory if v_deptno (level) will try to assess the level BEFORE the time of execution and therefore level is not set. Currently (this may change in the next version) before executing Oracle treats level 0, then you could try level + 1. This will not throw an error, but you will get incorrect results:

    SQL> declare
      2      v_deptno sys.OdciNumberList := sys.OdciNumberList(10,20);
      3      v_empno sys.OdciNumberList;
      4      v_cnt number;
      5  begin
      6      v_cnt := v_deptno.count;
      7      select empno
      8        bulk collect
      9        into v_empno
     10        from emp
     11        where deptno in (select v_deptno(level + 1) from dual connect by level < v_cnt);
     12      for i in 1..v_empno.count loop
     13        dbms_output.put_line(v_empno(i));
     14      end loop;
     15  end;
     16  /
    7782
    7839
    7934
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    As you can see everything we returned is deptno = 10 employees. Why? Because it does not an affair occurs just before the execution, but is also a TIME. That is why the subquery:

    Select v_deptno from dual connect by level (level + 1)<>

    produces two rows with the same value of v_deptno (0 + 1).

    Hope you got the image.

    SY.

  • ORA-6533?

    Hello

    I'm having a problem with below:

    x_payment_q payments_Q % ROWTYPE; - payments_Q is of type cursor
    TYPE t_payments_q IS TABLE OF payments_q % ROWTYPE;
    x_payments_q t_payments_q: = t_payments_q ();

    Start

    OPEN payments_Q.

    LOOP
    SEEK payments_Q INTO x_payment_q;

    EXIT WHEN payments_Q % NOTFOUND;
    x_payments_q.extend;
    x_payments_q (payments_Q % ROWCOUNT): = x_payment_q;
    END LOOP;

    CLOSE Payments_Q;

    debug_info: = "LOOP_Q";

    IF x_payments_q.COUNT <>0
    THEN
    FOR j IN x_payments_q.FIRST... x_payments_q.Last
    LOOP
    ....


    I'm ORA-06533.
    I have red on this error but do not know how to fix it!

    HELP :)

    Yes, much much faster that copy them one by one.
    You must use in BULK.

  • Change the size of the array when running?

    Hi all

    I declared a variable of type varray.
    Declare
    Typ_int_array of type VARRAY (10) THE NUMBER IS;
    BEGIN
    NULL;
    END;
    /

    If we declare a varray with a fixed size and that my data source brings together 20 records, we can dynamically extend the varray expanding size.

    FYI: When I tried to extend in addition to 10, it does not.

    I want to know is - it possible for VARRAYS size increase those it is fixed while declaring.

    Receive your answer.

    Thank you
    Madhu K.

    Etbin wrote:
    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14261/Collections.htm#sthref1153

    ??? Yes, you can increase the size of a nested table or varray using EXTEND. But in the case of VARRAY you can only increase it up to the MAXIMUM number of elements the VARRAY type declaration:

    SQL> Declare
      2  Type typ_int_array IS VARRAY(10) OF NUMBER;
      3  v_typ_int_array typ_int_array := typ_int_array();
      4  BEGIN
      5  v_typ_int_array.extend(10);
      6  END;
      7  /
    
    PL/SQL procedure successfully completed.
    
    SQL> Declare
      2  Type typ_int_array IS VARRAY(10) OF NUMBER;
      3  v_typ_int_array typ_int_array := typ_int_array();
      4  BEGIN
      5  v_typ_int_array.extend(11);
      6  END;
      7  /
    Declare
    *
    ERROR at line 1:
    ORA-06532: Subscript outside of limit
    ORA-06512: at line 5
    
    SQL> 
    

    Bottom line - you cannot increase the size of the VARRAY beyond the MAXIMUM number of elements the VARRAY type declaration.

    SY.

  • Error: Index outside the element

    Oracle 10g

    Currently I'm running a proc but am getting an error "index outside the element.

    The error pounce on this line:
    varteam(team_rec.team_1032) := xArcDagAP||'(TEAM TNAME:'||team_rec.team_nickname||'; 
    TLOCALE:'||team_rec.team_name||'; 
    TCONF:'||team_rec.conf_name||'; TDIV:'||rtrim(team_rec.div_name, ' Division')||';';
    varteam is declared as:
       varteam  v_arr := v_arr('1','2','3','4','5','6','7','8','9','
    0','1','2','3','4','5','6','7','8','9',
    '0','1','2','3','4','5','6','7','8','9','0','-1','-2');
    r = the value for team_rec.team_1032
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    -1
    -2
    I believe the lies of the issue with the varteam variable, and I really have no idea what is the problem here.

    Published by: user652714 on February 17, 2009 12:57

    It seems that you use nested Tables... (or Varrays)

    Anyway, you can not control the index of one of those. They are awarded by Oracle starting with 1 and cannot be zero or negative.

    here a small example

    SQL> declare
      2     type ntt is table of number;
      3     nt ntt := ntt (1,2,3);
      4     idx pls_integer;
      5  begin
      6     idx := nt.first;
      7     while idx is not null
      8     loop
      9         dbms_output.put_line (nt(idx));
     10        idx := nt.next(idx);
     11     end loop;
     12     dbms_output.put_line (nt (-1));
     13  end;
     14  /
    1
    2
    3
    declare
    *
    ERROR at line 1:
    ORA-06532: Subscript outside of limit
    ORA-06512: at line 12
    

    So the problem is in team_rec.team_1032... It may not be negative

  • BlackBerry smartphone Storm2 SMS &amp; MMS issue

    Research in Motion/BlackBerry has a request to expand the number of characters with their SMS/MMS application? 160 characters is just not enough and that all have not access to BB Messenger... Thank you, Clarke

    There are any number of 3rd party applications that will allow the beyond County 160... If my memory is good, one is BeyondSMS. They are available at AppWorld or one of the sellers.

Maybe you are looking for