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;

Tags: Database

Similar Questions

  • 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;
    /
    
  • 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".

  • 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

  • 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 space problem ORA-29902 ORA-13200 ORA-13220 ORA-06512

    I have problems by running the following query. If I change the values of the SDO_ORDINATE_ARRAY, some of the values of work, some values are not. Here is an example of when it fails. I managed queries using SDO_NN, if something needs work...

    How can I get for appearing on this (very new to space) question? Work on operating system Windows 7 Prof

    Select p.building_polygon
    spat.building p, spat.firebuilding f
    where p.building_name = f.building_on_fire and
    SDO_RELATE (p.building_polygon,
    SDO_GEOMETRY (2003, NULL, NULL, SDO_ELEM_INFO_ARRAY (1,1003,1))
    SDO_ORDINATE_ARRAY (768,278,477,504,155,115)), 'mask = ANYINTERACT') = 'TRUE '.
    *
    Error on line 0
    ORA-29902: error in executing ODCIIndexStart() routine
    ORA-13200: internal error [WINDOW_OBJECT] in spatial indexing.
    ORA-13220: failed to compare the tile with the geometry
    ORA-06512: at the 'MDSYS. SDO_INDEX_METHOD_10I', line 333

    The script that is used to create objects:
    create user spat identified by spat;
    grant all privileges to spit;

    Conn spat/spat;
    ALTER session set current_schema = seed;
    TOGETHER TO DEFINE

    CREATE TABLE spit. BUILDING
    (
    BUILDING_ID VARCHAR2 (3),
    BUILDING_NAME VARCHAR2 (50).
    VERTICES_COUNT INT,
    MDSYS BUILDING_POLYGON. SDO_GEOMETRY,
    CONSTRAINT BUILDING_PK PRIMARY KEY (BUILDING_ID)
    );

    CREATE TABLE spit. FIREHYDRANT
    (
    FIREHYDRANT_ID VARCHAR2 (3),
    MDSYS HYDRANT_POINT. SDO_GEOMETRY,
    CONSTRAINT FIREHYDRANT_PK PRIMARY KEY (FIREHYDRANT_ID)
    );

    CREATE TABLE spit. FIREBUILDING
    (
    BUILDING_ON_FIRE VARCHAR (50),
    CONSTRAINT FIREBUILDING_PK PRIMARY KEY (BUILDING_ON_FIRE)
    );

    INSERT IN USER_SDO_GEOM_METADATA
    VALUES ('CONSTRUCTION', 'BUILDING_POLYGON',
    SDO_DIM_ARRAY (SDO_DIM_ELEMENT ('X', 0, 820, 0.005),
    SDO_DIM_ELEMENT ('Y', 0, 580, 0.005)), NULL);

    INSERT IN USER_SDO_GEOM_METADATA
    VALUES ('FIREHYDRANT', 'HYDRANT_POINT',
    SDO_DIM_ARRAY (SDO_DIM_ELEMENT ('X', 0, 820, 0.005),
    SDO_DIM_ELEMENT ('Y', 0, 580, 0.005)), NULL);

    COMMIT;

    CREATE classic INDEX. BUILDING_SPATIAL_IDX
    THE spat. BUILDING (BUILDING_POLYGON)
    INDEXTYPE IS MDSYS. SPATIAL_INDEX;

    CREATE classic INDEX. FIREHYDRANT_SPATIAL_IDX
    THE spat. FIREHYDRANT (HYDRANT_POINT)
    INDEXTYPE IS MDSYS. SPATIAL_INDEX;

    COMMIT;

    ==================UPDATE==========================
    OK, I noticed something interesting. If I have 3 points in my table ordered, errors are thrown. If I have more than 3 points in my table ordered, it works. Could someone explain why this is and if there is a way around it?

    Select p.building_polygon
    spat.building p, elkordy.firebuilding f
    where p.building_name = f.building_on_fire
    and SDO_ANYINTERACT (p.building_polygon
    , SDO_GEOMETRY (2003, NULL, NULL, SDO_ELEM_INFO_ARRAY (1,1003,1))
    ((, - SDO_ORDINATE_ARRAY (232,91,149,226,277,198))) = "TRUE"; -USE ONLY ONE
    ((, - SDO_ORDINATE_ARRAY (165,84,168,484,769,534,743,108))) = "TRUE"; -USE ONLY ONE

    Published by: AmeerE on March 17, 2013 12:19 AM

    Ameer,

    You say that you are new to the space.

    The issue that you are facing is that the 3 vertices are not enough for a polygon. For Oracle Spatial, an outside edge of the polygon (1003) must have 4 peaks with the first being the last.

    So:

    select sdo_geom.validate_geometry(SDO_GEOMETRY(2003,NULL,NULL,SDO_ELEM_INFO_ARRAY(1,1003,1),SDO_ORDINATE_ARRAY(232,91,149,226,277,198)),0.05) as  from dual;
    VGEOM
    -----
    13343
    

    The Oracle error documentation;

    ORA-13343: less than four coordinates polygon geometry
    Cause: Specified geometry as a polygon, less than four coordinates in its definition.
    Action: A polygon must have at least four distinct coordinates. Correct the geometric definition or set the appropriate for this geometry SDO_GTYPE or SDO_ETYPE attribute.

    So, the solution is to repeat the first vertex:

    select sdo_geom.validate_geometry(SDO_GEOMETRY(2003,NULL,NULL,SDO_ELEM_INFO_ARRAY(1,1003,1),SDO_ORDINATE_ARRAY(232,91,149,226,277,198,232,91)),0.05) as geom from dual;
    VGEOM
    -----
    13367
    

    13357 is another error...

    ORA-13367: misdirection of the rings interiors/exteriors
    Cause: In an Oracle Spatial geometry, the outer and/or inner rings are not geared properly.
    Action: Make sure that the outer rings are oriented to the left and the inner rings are oriented in a clockwise direction.

    Note that Action tells you exactly the right command for the rings.

    This has been solved by reversing the coordinates as follows:

    select sdo_geom.validate_geometry(SDO_GEOMETRY(2003,NULL,NULL,SDO_ELEM_INFO_ARRAY(1,1003,1),SDO_ORDINATE_ARRAY(232,91,277,198,149,226,232,91)),0.05) as vgeom from dual;
    VGEOM
    -----
    TRUE
    

    It is now a geometry valid and will work in your sdo_anyinteract etc requests.

    Always make sure that your geometries times stored in the column of a table and provided to a request otherwise, are VALID.

    If this answers your query, please grant me the points that you think I deserve.

    concerning
    SImon

  • ERROR / T_ITEMS in the TABLE is changing, function of triggering/can not see ORA-06512... ?

    Hi all

    I CREATED THE TRIGGER TO CHECK NOM_ELEMENT BEFORE UPDATE ON THE T_ITEMS TABLE IF AN ANOTHER NOM_ELEMENT LIKE NOM_ELEMENT CURRENT OR NOT, IF AS AN ANOTHER NOM_ELEMENT DON'T SAVE UPDATED CURRENT NOM_ELEMENT.

    MY NO IS:

    1 - I CREATED the FUNCTION CALL CH_UNIQUE_ITEM_NAME

    CREATE OR REPLACE FUNCTION CH_UNIQUE_ITEM_NAME
    (NUMBER OF P_ID, P_ITEM_NAME IN VARCHAR2)
    RETURN NUMBER
    AS
    NUMBER OF X_COUNT;
    -FUNCTION "CH_UNIQUE_ITEM_NAME" TO CHECK NOM_ELEMENT LIKE OTHER NOM_ELEMENT OR NOT.
    BEGIN
    SELECT COUNT (ITEM_NAME)
    IN X_COUNT
    OF T_ITEMS
    WHERE ID! P_ID =
    AND UPPER (ITEM_NAME) AS UPPER (P_ITEM_NAME);
    RETURN X_COUNT;
    END CH_UNIQUE_ITEM_NAME;

    2. I CREATED TRIGGER CALL TRG_CH_UNIQUE_T_ITEMS

    CREATE OR REPLACE 'TRG_CH_UNIQUE_T_ITEMS' before FIRING
    UPDATE
    ON T_ITEMS FOR EACH LINE
    DECLARE
    NUMBER OF X_CHECK;
    BEGIN
    SELECT CH_UNIQUE_ITEM_NAME (: OLD.ID,: NEW.) NOM_ELEMENT) IN DOUBLE X_CHECK;
    IF (: NEW.) NOM_ELEMENT DISLIKES: OLD. Nom_element AND X_CHECK > 0)
    THEN RAISE_APPLICATION_ERROR (-20007, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
    END IF;
    END;

    NOW WHEN I UPDATE ANY ITEMS FOUND ERROR "ERROR / T_ITEMS in the TABLE is changing, function of triggering/can not see ORA-06512.

    Form on T_ITEMS22222.png

    Please help me TO RESOLVE THIS ERROR. I TIRED TO SOLVE...

    Thank you

    You don't realize that you have just set a UNIQUE INDEX of several columns?

    create unique index index_name_uq on table_name( user#, upper(item_name) );
    

    In addition, a GUI Design point, (using the terms of the APEX) that you want to validate the data before submit you.

    (use a Page-level Validation)

    MK

  • Invalid operation UTL_SMTP, ORA-06512: at "SYS." UTL_SMTP", LINE 161

    Hello

    I have a requirement to send the data in the table (retrieved via a select clause) through an email.

    Here is the procedure that uses to send email that includes data from the table through trigger.

    I don't find any problem during execution of the procedure and the relaxation.

    but when inserting the data in table 1 (present to SCHEMA1 please refer to line 37 and 55) I get the following error and the message will not be delivered

    ERRORS

    ORA-29277: invalid SMTP Operation

    ORA-06512: at "SYS." UTL_SMTP", LINE 55

    ORA-06512: AT "SYS." UTL_SMTP", LINE 161

    ORA-06512: AT "SYS." UTL_SMTP", LINE 452

    ORA-06512: AT "SYS." UTL_SMTP", LINE 463

    But when I remove the code from line 33 to 44

    am able to send mail.

    That is to say

    / * IMMEDIATE EXECUTION

    "SELECT."

    A.BATCHNO, B.PCSBOX, B.AMOUNT

    Of

    SCHEMA1. Table1: A, SChEMA2.TABLE2 B

    WHERE

    A.BATCHID = B.BATCHNO AND B.PRODOAID =' | PRODOAID

    BULK COLLECT INTO BATCHNO, PCSBOX, AMOUNT;

    FOR indx IN 1.BATCHNO. COUNTY

    LOOP

    UTL_SMTP. WRITE_DATA (A, BATCHNO (indx) |) ' -- '|| PCSBOX (indx) |' --' || Amount (indx) | UTL_TCP. CRLF);

    END LOOP; */

    I checked the sender and recipient addresses that they are fine.

    so, this is my code

    1 CREATE OR REPLACE PROCEDURE SEND_TABLE_DATA (FROMAD IN VARCHAR2: =' <[email protected]> ', )

    TOAD 2 IN VARCHAR2: = ' < [email protected] > ',

    3 under RESERVE IN VARCHAR2: = 'Data Table ',.

    4 MESSAGE IN VARCHAR2: = "Dear all,

    5                                    Docid :    ' ,

    DOCID 6 IN VARCHAR2,

    DOCDT DATE 7.

    8 PRODOAID IN NUMBER)

    9, ACCORDING TO

    10 TYPE NumList IS TABLE OF NUMBER;

    11 TYPE NameList IS TABLE OF THE VARCHAR2 (32767).

    12 BATCHNO NameList;

    13 PCSBOX NumList;

    AMOUNT 14 NumList;

    15 SMTPHOST VARCHAR2 (255): = ' XX. XX. XX. XX ";

    16. A UTL_SMTP. CONNECTION;

    BEGIN 17

    18 A: = UTL_SMTP. OPEN_CONNECTION(SMTPHOST,25);

    19 UTL_SMTP. HELO (A, SMTPHOST);

    20 UTL_SMTP. MAIL (A, FROMAD);

    21 UTL_SMTP. RCPT (A, TOAD);

    22 UTL_SMTP. OPEN_DATA (A);

    UTL_SMTP 23. WRITE_DATA (A, UTL_TCP. CRLF);

    24 UTL_SMTP. WRITE_DATA (A, UTL_TCP. CRLF. UTL_TCP. CRLF. UTL_TCP. CRLF);

    25 UTL_SMTP. WRITE_DATA (, ' Date: ' |) TO_CHAR (SYSDATE, ' DD/MM/YYYY HH24:MI:SS'). UTL_TCP. CRLF);

    26 UTL_SMTP. WRITE_DATA (, ' from: ' |) FROMAD | UTL_TCP. CRLF);

    UTL_SMTP 27. WRITE_DATA (, ' from: ' |) TOAD | UTL_TCP. CRLF);

    28 UTL_SMTP. WRITE_DATA (, ' subject: ' |) TOPIC | UTL_TCP. CRLF);

    UTL_SMTP 29. WRITE_DATA (ONE, MESSAGE |) DOCID | "Documented on ' | DOCDT | UTL_TCP. CRLF);

    30 UTL_SMTP. WRITE_DATA (A, UTL_TCP. CRLF. UTL_TCP. CRLF. UTL_TCP. CRLF);

    UTL_SMTP 31. WRITE_DATA (A, "it's for your information" |) UTL_TCP. CRLF);

    UTL_SMTP 32. WRITE_DATA (, ' BATCHNO ' |) ' -- '||' PCSBOX ' |' --' ||' AMOUNT '. UTL_TCP. CRLF);

    33 IMMEDIATE EXECUTION

    34 ' SELECT

    35 A.BATCHNO, B.PCSBOX, B.AMOUNT

    36 FROM

    37 SCHEMA1. Table1: A, SChEMA2.TABLE2 B

    38. WHERE THE

    39 A.BATCHID = B.BATCHNO AND B.PRODOAID =' | PRODOAID

    40 BULK COLLECT INTO BATCHNO PCSBOX, AMOUNT;

    41 FOR indx IN 1.BATCHNO. COUNTY

    42 LOOP

    UTL_SMTP 43. WRITE_DATA (A, BATCHNO (indx) |) ' -- '|| PCSBOX (indx) |' --' || Amount (indx) | UTL_TCP. CRLF);

    44 END OF LOOP;

    UTL_SMTP 45. WRITE_DATA (A, CHR (13) |) CHR (13) | CHR (13));

    UTL_SMTP 46. CLOSE_DATA (A);

    UTL_SMTP 47. QUIT (A);

    EXCEPTION OF 48

    49 THEN THAN OTHERS THEN

    50 UTL_SMTP. QUIT (A);

    RAISE 51;

    END 52;

    53.

    54, create or replace trigger trg_table_mail_sricity_prodoa

    55 after insertion on SCHEMA1. TABLE1:

    56 for each line

    start at 57

    (58) SENd_table_data

    59 DOCID = >: new.docid,.

    DOCDT 60 = >: new.docdt,.

    PRODOAID 61 = >: new.prodoaid

    (62);

    end 63;

    Can what changes I make to the code to meet my needs?

    Please correct me if am wrong anywhere,

    in the case where if a bad method used to send data (retrieved using a select clause)

    Show me another method to achieve my requirement.

    Thanks in advance,

    Pradeep cordially.

    Line 19 is not going. The HELO command is used to identify the SMTP client. The SMTP server knows its IP address and the host name. No need to tell him that via the HELO command. He wants to know who is the appellant. The order is intended to say "Hello, I am a customer ". "" See the SMTP RFC for more details. (and Yes, examples of the Oracle are wrong)

    Run immediately? Why? There is no true used dynamic SQL.

    Collect in bulk? Why? There is not analysis or the treatment performed. Use a cursor loop FOR and call write data from the inside of the loop.

    Also consider a fall 80's standard mainframe coding style (and abusing capital letters) and use modern standards that are common in Java. .NET, C/C++, etc. Specifically, as PL/SQL is derived and an implementation of the Ada language, look at Ada 95 quality and Style Guide for standards, and good logic.

  • ORA-06512 online

    Hello
    im getting the following error:


    ORA-20000: Oracle text error:
    DRG-10599: the column is not indexed
    ORA-06512: at "JOBSDEV. CC_PKG_RESUME_RANK_REF', line 1332
    ORA-06512: at line 1

    If anyone can suggest me what that means? and what exactly I need to change?


    Thank you
    MaheshM

    Hello

    you try to use the CONTAINS (or maybe another feature of Oracle Text), but this requires an Oracle text index and not a normal type of index. Therefore, first to create an Oracle text index to get this successfully. Take a look at the documentation: http://download.oracle.com/docs/cd/E11882_01/text.112/e24435/toc.htm

    For more questions about the Oracle text, you can use the forum for Oracle Text: text

    If you think that you have done nothing qrong, then please post requests and the creation of the index.

    Herald tiomela
    http://htendam.WordPress.com

  • ORA-13033 ORA-06512 at 11.1.0.7

    I have a single shape that seems to cause of ORA-13033 11.1.0.7 but not 11.1.0.6. Wondering if I am missing something stupid, or if someone else has experienced this problem. I did a quick search of positions, but found nothing. It could also be that space has a problem on the 11.1.0.7 server...

    Thank you

    -on 11.1.0.7

    SQL > drop index foo_spatial_index;

    The index is deleted.

    SQL > drop table foo;

    Deleted table.

    SQL > delete from user_sdo_geom_metadata where table_name = 'FOO ';

    1 line removal.

    SQL >
    SQL > create table foo (shape sdo_geometry);

    Table created.

    SQL > insert into foo values (SDO_GEOMETRY (3002, NULL, NULL, SDO_ELEM_INFO_ARRAY (1, 4, 1, 1, 2, 2), SDO_ORDINATE_ARRAY (484893.192, 1845442.68))
    0, 484881.786, 1845444.7,.5, 484871.639, 1845450.28, 1)));

    1 line of creation.

    SQL > insert into user_sdo_geom_metadata values ("FOO", "SHAPE", SDO_DIM_ARRAY (SDO_DIM_ELEMENT(, 484719.102, 484904.266,.0000005), SDO_DI
    (M_ELEMENT(null, 1845366.11, 1845513.86,.0000005), SDO_DIM_ELEMENT (NULL, 0, 5368.70912,.0000005)), null);

    1 line of creation.

    SQL > create index foo_spatial_index on foo (shape) indextype is mdsys.spatial_index;
    create index foo_spatial_index on foo (shape) indextype is mdsys.spatial_index
    *
    ERROR on line 1:
    ORA-29855: an error has occurred in the execution of routine ODCIINDEXCREATE
    ORA-13249: internal error in the Spatial index: [mdidxrbd]
    ORA-13249: error in the Spatial index: index build failed
    ORA-13249: error in the spatial index: [mdrcrtxfergm]
    ORA-13249: error in the spatial index: [mdpridxtxfergm]
    ORA-13200: internal error [ROWID:AAFV8VAAHAAAGUtAAA] in spatial indexing.
    ORA-13206: [] internal error creating the spatial index
    ORA-13033: invalid data in the SDO_ELEM_INFO_ARRAY in the SDO_GEOMETRY object
    ORA-06512: at the 'MDSYS. SDO_INDEX_METHOD_10I', line 10

    -on a different 11.1.0.6

    SQL > drop index foo_spatial_index;
    Drop index foo_spatial_index
    *
    ERROR on line 1:
    ORA-01418: specified index does not exist


    SQL > drop table foo;
    drop table foo
    *
    ERROR on line 1:
    ORA-00942: table or view does not exist


    SQL > delete from user_sdo_geom_metadata where table_name = 'FOO ';

    0 rows deleted.

    SQL >
    SQL > create table foo (shape sdo_geometry);

    Table created.

    SQL > insert into foo values (SDO_GEOMETRY (3002, NULL, NULL, SDO_ELEM_INFO_ARRAY (1, 4, 1, 1, 2, 2), SDO_ORDINATE_ARRAY (484893.192, 1845442.68))
    0, 484881.786, 1845444.7,.5, 484871.639, 1845450.28, 1)));

    1 line of creation.

    SQL > insert into user_sdo_geom_metadata values ("FOO", "SHAPE", SDO_DIM_ARRAY (SDO_DIM_ELEMENT(, 484719.102, 484904.266,.0000005), SDO_DI
    (M_ELEMENT(null, 1845366.11, 1845513.86,.0000005), SDO_DIM_ELEMENT (NULL, 0, 5368.70912,.0000005)), null);

    1 line of creation.

    SQL > create index foo_spatial_index on foo (shape) indextype is mdsys.spatial_index;

    The index is created.

    There are a number of things wrong with your geometry.

    The record says that for compound geometries (sdo_etype = 4) SDO_INTERPRETATION (in this case with sdo_etype = 4) gives the number of subitems. This should be more then 1 large:

    http://download.Oracle.com/docs/CD/B28359_01/AppDev.111/b28400/sdo_objrelschema.htm#BGHDGCCE

    4

    n > 1

    Compound line string with some vertices connected by straight segments and some by circular arcs. The value n in the interpretation column specifies the number of contiguous subelements that make up the line string.

    The triplets following n in the Ansdo_elem_info table describe each of these sub-elements. Subitems cannot SDO_ETYPE 2. The last point of a subelement is the first point of the next subelement, and should not be repeated.

    In your case, you will either need a string of single line that makes the first triplet even unnecessary or incorrect in the Ansdo_elem_info, or you are missing a third triplet in the Ansdo_elem_info.

    You should always validate your geometry first, if you do this also on your 11.1.0.6 version you will get:

    SDO_GEOM. VALIDATE_GEOMETRY_WITH_CONTEXT

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

    54506 point: 0, Edge: 2,.

    ORA-54506: compound curve not supported for 3D geometries
    Cause: The 3D geometry contained one or more compound curves, which are not
    support for 3D geometries.
    Action: Remove all the curves of geometry.

    As you can see also compound curveare not supported in 3D geometries.

    IF it is not a compound (with SDO_ELEM_INFO_ARRAY = (1,2,2), you will see that this geometry will validate.

    Looks like the validation could be integrated now in creating indexes in 11.1.0.7.

    Published by: lucvanlinden on March 20, 2009 09:07

  • dmp Impdp file error: ORA-29283: operation invalid file ORA-06512: at "SYS." UTL_FILE", line 536

    Hi all.

    Sorry to ask this error again, I read a lot of topic in this forum on this subject, but I can't fix it.

    So I create this topic.

    My computer is running oracle database 11 g 2 express edition on ubuntu LTS 14.04.

    I'm trying to import the database of dmp file. That's what I do:


    > sqplus

    opening session with sys as sysdba, then run:

    Hoangnv CREATE USER IDENTIFIED BY hoangnv;

    GRANT CONNECT TO hoangnv;

    GRANT RESOURCE, s/n hoangnv;

    CREATE OR REPLACE DIRECTORY dmpdir AS ' / home/hoangnv/downloads/db ";

    GRANT read, write the DIRECTORY ON dmpdir TO hoangnv;


    my_project.dmp file is stored on /home/hoangnv/Downloads/db folder.

    Finally, I ran the command below in terminal:

    impdp hoangnv/hoangnv@xe directory = dmpdir dumpfile = my_project.dmp logfile = my_project.log


    That's what see the Terminal:

    ORA-39002: invalid operation

    ORA-39070: unable to open the log file.

    ORA-29283: invalid file operation

    ORA-06512: at "SYS." UTL_FILE", line 536

    ORA-29283: invalid file operation

    Any ideas? I run these commands on window and import the database successfully.

    Hello

    Please try the suggestions below:

    1. make sure that the roles granted to the user are 'default' for him.

    SQL > change the user hoangnv the role by default all;

    then try to re-import.

    Note: the DBA role contains the IMP_FULL_DATABASE with it.

    2. try import with the use of the 'System' this time, which is the result then? don't forget to give the system read, write on directory dmpdir.

    3. is the permission to/home/hoangnv/Downloads/db fine OS?

  • ORA-06512: at "RQSYS. RQEVALIMPL', line 77

    Hello

    I test our add-on R Oracle and I get errors when I try a use of the ore.lm function using the example in the "User Guide". Here's the example and errors:

    Example 4-2 using ore.lm

    longley_of <- ore.push(longley) # Fit full model oreFit1 <- ore.lm(Employed ~ ., data = longley_of) class(oreFit1) summary(oreFit1)

    > longley_of <-ore .push (longley)

    > oreFit1 <-ore.lm (employees ~., data = longley_of)

    Error in .oci. GetQuery (Conn., instruction, data = data = prefetch prefetch,):

    ORA-20000: RQuery error internal [rqerExec, 3, 0, 0]

    ORA-06512: at "RQSYS. RQEVALIMPL', line 77

    ORA-06512: at "RQSYS. RQEVALIMPL', line 74

    Thanks Sherry for your quick response on this issue.

    We have uninstalled company Oracle R and reinstalled and everything works now. Thanks again for your support! RA

  • ORA-12012: error on auto work 754461 ORA-29279: SMTP permanent error: ORA-29279: SMTP permanent error: 501 Syntax error, command parameters "RCPT TO:" ORA-06512 unrecognized or missing: at "SYS." UTL_SMTP", line 20 ORA-06512: at"SYS." UTL_SMTP.

    Hello


    I get below error frequently in the log database alerts.


    ORA-12012: error on auto work 754461

    ORA-29279: SMTP permanent error: ORA-29279: SMTP permanent error: 501 Syntax error, command parameters ' RCPT TO: ' unrecognized or missing

    ORA-06512: at "SYS." UTL_SMTP", line 20

    ORA-06512: at "SYS." UTL_SMTP", line 98

    ORA-06512: at "SYS." UTL_SMTP", line 240

    ORA-06512: at the 'APPS '. EIS_UTIL_PKG', line 94

    ORA-06512: at the 'APPS '. HKD_PO_ADDON_PKG', line 110

    ORA-06512: at line 1

    The syntax error comes from the SMTP server, not to the job itself, so I disagree with your solution.

  • I get the error message like "error - ORA-29273 report: failure of the HTTP ORA-06512: at"SYS. " UTL_HTTP", line 1130 ORA-12535: TNS:operation expired ORA-06512: 37 29273 line. 00000 - "HTTP request failed" * Cause: package UTL_HTTP The Impossible to run

    I have tried the code

    DECLARE

    lv_url VARCHAR2 (1000): = ' http://shenzhoufellowship.org/main2/files/old/SpecialTopics/TheLoveDare.pdf';

    lc_return BLOB;

    lhttp_url httpuritype.

    Varriables - declared to have written the LOB to pdf file-

    l_file UTL_FILE. TYPE_DE_FICHIER;

    l_buffer RAW (32767).

    l_amount directory: = 32767;

    l_pos INTEGER: = 1;

    l_blob BLOB;

    l_blob_len INTEGER.

    BEGIN

    -create URIs

    lhttp_url: = httpuritype.createuri (lv_url);

    -get the PDF document

    lc_return: = lhttp_url.getblob ();

    -Open the destination file.

    l_file: = UTL_FILE. FOPEN ('MBO_INPUT_DIR', 'MBD.zip', 'wb');

    -Get the total length of the BLOB

    l_blob_len: = DBMS_LOB.getlength (lc_return);

    -Pieces of the BLOB to read and write to the file

    -full up.

    While l_pos < l_blob_len LOOP

    DBMS_LOB. READ (lc_return, l_amount, l_pos, l_buffer);

    UTL_FILE.put_raw (l_file, l_buffer, FALSE);

    l_pos: = l_pos + l_amount;

    END LOOP;

    -Closes the file.

    UTL_FILE. FCLOSE (l_file);

    EXCEPTION

    WHILE OTHERS THEN

    -Close the file if something goes wrong.

    IF UTL_FILE.IS_OPEN (l_file) THEN

    UTL_FILE. FCLOSE (l_file);

    END IF;

    LIFT;

    END;

    But make a mistake like:

    Error report-

    ORA-29273: HTTP request failed

    ORA-06512: at "SYS." UTL_HTTP", line 1130

    ORA-12535: TNS:operation expired

    ORA-06512: at line 37 level

    29273 00000 - "the HTTP request failed.

    * Cause: The UTL_HTTP package cannot run the HTTP request.

    * Action: Use get_detailed_sqlerrm to check the detailed error message.

    Correct the error and restart the HTTP request.

    Please suggest a solution. Is it possible to download a zip file with the same code?

    [oracle@localhost ~]$ sqlplus scott/tiger
    
    SQL*Plus: Release 11.2.0.1.0 Production on Mon Apr 6 13:59:09 2015
    
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> --My Database version
    SQL> ----------------------
    SQL> SELECT * FROM v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  DECLARE
      2        lv_url    VARCHAR2(500) := 'http://shenzhoufellowship.org/main2/files/old/SpecialTopics/TheLoveDare.pdf';
      3        lc_return BLOB;
      4        lhttp_url httpuritype;
      5        ---Varriables declared for writing the LOB to pdf file --
      6        l_file     UTL_FILE.FILE_TYPE;
      7        l_buffer   RAW(32767);
      8        l_amount   BINARY_INTEGER := 32767;
      9        l_pos      INTEGER := 1;
    10       l_blob     BLOB;
    11       l_blob_len INTEGER;
    12     BEGIN
    13       --create uri
    14       lhttp_url := httpuritype.createuri(lv_url);
    15       --get the PDF document
    16       lc_return := lhttp_url.getblob();
    17       -- Open the destination file.
    18       l_file := UTL_FILE.FOPEN('SAUBHIK', 'TheLoveDare.pdf', 'wb');
    19       --Get the total length of the BLOB
    20       l_blob_len := DBMS_LOB.getlength(lc_return);
    21       -- Read chunks of the BLOB and write them to the file
    22       -- until complete.
    23       WHILE l_pos < l_blob_len LOOP
    24         DBMS_LOB.READ(lc_return, l_amount, l_pos, l_buffer);
    25         UTL_FILE.put_raw(l_file, l_buffer, FALSE);
    26         l_pos := l_pos + l_amount;
    27       END LOOP;
    28       -- Close the file.
    29       UTL_FILE.FCLOSE(l_file);
    30     EXCEPTION
    31       WHEN OTHERS THEN
    32         -- Close the file if something goes wrong.
    33         IF UTL_FILE.IS_OPEN(l_file) THEN
    34           UTL_FILE.FCLOSE(l_file);
    35         END IF;
    36         RAISE;
    37*    END;
    38  /
    DECLARE
    *
    ERROR at line 1:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1130
    ORA-24247: network access denied by access control list (ACL)
    ORA-06512: at line 36
    
    SQL> conn sys as sysdba
    Enter password:
    Connected.
    SQL> ed
    Wrote file afiedt.buf
    
      1  BEGIN
      2    DBMS_NETWORK_ACL_ADMIN.CREATE_ACL(acl         => 'love.xml',
      3                                      description => 'Love ACL',
      4                                      principal   => 'SCOTT',
      5                                      is_grant    => true,
      6                                      privilege   => 'connect');
      7    DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl       => 'love.xml',
      8                                         principal => 'SCOTT',
      9                                         is_grant  => true,
    10                                         privilege => 'resolve');
    11    DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL(acl  => 'love.xml',
    12                                      host => 'shenzhoufellowship.org');
    13  commit;
    14* END;
    15  /
    
    PL/SQL procedure successfully completed.
    
    SQL> conn scott/tiger
    Connected.
    SQL> ed
    Wrote file afiedt.buf
    
      1  DECLARE
      2        lv_url    VARCHAR2(500) := 'http://shenzhoufellowship.org/main2/files/old/SpecialTopics/TheLoveDare.pdf';
      3        lc_return BLOB;
      4        lhttp_url httpuritype;
      5        ---Varriables declared for writing the LOB to pdf file --
      6        l_file     UTL_FILE.FILE_TYPE;
      7        l_buffer   RAW(32767);
      8        l_amount   BINARY_INTEGER := 32767;
      9        l_pos      INTEGER := 1;
    10       l_blob     BLOB;
    11       l_blob_len INTEGER;
    12     BEGIN
    13       --create uri
    14       lhttp_url := httpuritype.createuri(lv_url);
    15       --get the PDF document
    16       lc_return := lhttp_url.getblob();
    17       -- Open the destination file.
    18       l_file := UTL_FILE.FOPEN('SAUBHIK', 'TheLoveDare.pdf', 'wb');
    19       --Get the total length of the BLOB
    20       l_blob_len := DBMS_LOB.getlength(lc_return);
    21       -- Read chunks of the BLOB and write them to the file
    22       -- until complete.
    23       WHILE l_pos < l_blob_len LOOP
    24         DBMS_LOB.READ(lc_return, l_amount, l_pos, l_buffer);
    25         UTL_FILE.put_raw(l_file, l_buffer, FALSE);
    26         l_pos := l_pos + l_amount;
    27       END LOOP;
    28       -- Close the file.
    29       UTL_FILE.FCLOSE(l_file);
    30     EXCEPTION
    31       WHEN OTHERS THEN
    32         -- Close the file if something goes wrong.
    33         IF UTL_FILE.IS_OPEN(l_file) THEN
    34           UTL_FILE.FCLOSE(l_file);
    35         END IF;
    36         RAISE;
    37*    END;
    38  /
    
    PL/SQL procedure successfully completed.
    
    SQL> exit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    [oracle@localhost ~]$ cd saubhik/
    [oracle@localhost saubhik]$ pwd
    /home/oracle/saubhik
    [oracle@localhost saubhik]$ ls -l *.pdf
    -rw-r--r-- 1 oracle oinstall 60055 Apr  6 14:03 TheLoveDare.pdf
    [oracle@localhost saubhik]$
    

    I love this pdf file. I would like to read this and mean while if you get an error then please post in its entirety and also think that it is an Oracle error or network.

  • ORA-06512: at "SYS." UTL_HTTP"ORA-29259: end-of-entry available on UTL_HTTP. GET_RESPONSE

    Hi all

    I call using UTL_HTTP and SOAP_API Web services, mentioned below, similarly

    FUNCTION to CREATE or REPLACE add_numbers (p_int_1 in NUMBER, p_int_2 number)

    RETURN NUMBER

    AS

    l_request soap_api.t_request;

    l_response soap_api.t_response;

    l_return VARCHAR2 (32767).

    l_url VARCHAR2 (32767).

    l_namespace VARCHAR2 (32767).

    l_method VARCHAR2 (32767).

    l_soap_action VARCHAR2 (32767).

    l_result_name VARCHAR2 (32767).

    BEGIN

              l_url := ' http://oracle-base.com/webservices/server.php';

    " l_namespace: = ' xmlns =" http://Oracle-base.com/webservices/ "';

    l_method: = 'ws_add ';

    l_soap_action: = ' http://oracle-base.com/webservices/server.php/ws_add';

    l_result_name: = 'back ';

    l_request: = soap_api.new_request (p_method = > l_method,)

    p_namespace = > l_namespace);

    soap_api.add_parameter (p_request = > l_request,)

    p_name = > 'int1 ',.

    p_type = > ' xsd: Integer.

    p_value = > p_int_1);

    soap_api.add_parameter (p_request = > l_request,)

    p_name = > "int2"

    p_type = > ' xsd: Integer.

    p_value = > p_int_2);

    l_response: = soap_api.invoke (p_request = > l_request,)

    p_url = > l_url,

    p_action = > l_soap_action);

    l_return: = soap_api.get_return_value (p_response = > l_response,)

    p_name = > l_result_name,

    p_namespace = > NULL);

    RETURN l_return;

    END;

    It works very well when the number of records is less (the XML output is small), but when the number of records in the source database is passed then I'm not able to get the output XML file.

    I get the error message,

    error code:-29273, msg error: ORA-29273: HTTP request failed

    ORA-06512: at "SYS." UTL_HTTP", line 1369

    ORA-29259: end-of-input reached

    I am gettting error on line,

    L_HTTP_RESPONSE: = UTL_HTTP. GET_RESPONSE (L_HTTP_REQUEST);

    Can someone help me with this problem? Is it possible to increase the size HTTP_RESPONSE?

    Thank you

    Abbas Qureshi

    Hello

    have you checked the end of your XML data? You wrote:

    > Looped it returns two values XML we have a length 32767 and other is 122.
    Perhaps you can see which part of your HTTP response is missing.

    Kind regards

    WoG

Maybe you are looking for

  • 5200-903-this satellite that is possible to equip it with 2 GB of RAM

    I have a question about RAM fitted to a Toshiba Satellite 5200 903.Is it possible to equip with 2 GB of RAM? I already tried, but Windows XP Pro not more start telling me that the BIOS (1.40) is not ACPI compliant. (with blue screen)but with 1 GB of

  • Can I use with my Satellite L500 - 1XC SSD?

    I have a Toshiba Satellite L500-1XC. need a drive to solid state to replace the hard drive inside of her now?I was looking at the Toshiba 120 gb stor. E comes with caddy, cables and software for clone you old hard drive, its SATA III. IS MY LAPTOP SA

  • Need to backup data before restoring my computer with the dell factory restore?

    I experienced some problems with windows so I thought to use the system to dell factory restore.I have actually three drives 1 is for the n other operating system is for my personal data n the last of them is the recovery partition. And now if I want

  • STOP: 0X0000007E

    Help! I tried updating to Windows 10. After the 'upgrade' I lived intermittent crashes, so I tried to go back to Windows 7 (there is an option to go back within 30 days of the upgrade). Now that I have, my system won't boot, I get the dreaded BSOD. I

  • Power failure during windows 7 install

    during the installation of windows 7, the power went out.  now all I get is 'the program installation starts services' and then it restarts, again and again.  Help! What can I do to pass also to finish installing