How to fetch geometry of values

How to fetch geometry of values,
I wanted to fetch the 4th positioned n 5th positioned values from the
SDO_ORDINATE_ARRAY and one unique Column ID,
sample data for the same follows
SQL> desc TEST
Name Null? Type
GEOMETRY MDSYS.SDO_GEOMETRY
ID NUMBER
SQL> select id, geometry from test
where rownum<7
TEST GEOMETRY(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
1 SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(0, 1, 0, 408551.27, 2925997.25))
2 SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(.011493516, -.99993395, 0, 408442.69, 2925997.45))
3 SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(-.02636329, .999652428, 0, 408551.45, 2926096.46))
4 SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(0, 1, 0, 408551.77, 2926212.98))
5 SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(0, 1, 0, 408552.01, 2926314.81))
6 SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(1, 0, 0, 408470.67, 2926137.08))
6 rows selected.
SQL>
another table TESTZ is created to insert the fetched values from TEST
table
SQL> desc TESTZ
Name Null? Type
TEST NUMBER
ES NUMBER
NR NUMBER
The following pl/sql program is used for fetching the required data
DECLARE
CURSOR p_cur
IS
select id,geometry from test order by rownum ;
es number;
nr number;
locus mdsys.sdo_geometry;
BEGIN
for i in p_cur
loop
locus := i.geometry ;
es:=locus.sdo_ordinates(4);
nr:=locus.sdo_ordinates(5);
insert into testz values(i.idz,es,nr);
end loop;
END;
ERROR at line 1:
ORA-06533: Subscript beyond count
ORA-06512: at line 20
the same Script is working well for other data sets But its giving the
following Errror for the ABOVE
data set, the test table got 90,000 records
please Suggest me the required Solution to fecth the 4th and 5th
postioned values from SDO_ORDINATE_ARRAY ;
Many thanks
ZameeR

As I said in another posting (this is a cross-post):
drop table test;
create table test (id integer, geometry mdsys.sdo_geometry);
insert into test ( id, geometry ) values (
1,SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(0, 1, 0, 408551.27, 2925997.25)));
insert into test ( id, geometry ) values (
2,SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(.011493516, -.99993395, 0, 408442.69, 2925997.45)));
insert into test ( id, geometry ) values (
3,SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(-.02636329, .999652428, 0, 408551.45, 2926096.46)));
insert into test ( id, geometry ) values (
4,SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(0, 1, 0, 408551.77, 2926212.98)));
insert into test ( id, geometry ) values (
5,SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(0, 1, 0, 408552.01, 2926314.81)));
insert into test ( id, geometry ) values (
6,SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(1, 0, 0, 408470.67, 2926137.08)));
commit;
select a0.id, c.column_value, e.column_value
from test a0,
      (select b1.id, mod(rownum,5) rown, b2.*
         from test b1,
              table(b1.geometry.sdo_ordinates) b2
      ) c,
      (select d1.id, mod(rownum,5) rown, d2.*
         from test d1,
              table(d1.geometry.sdo_ordinates) d2
      ) e
where ( c.id = a0.id and c.rown = 4 )
  and ( e.id = a0.id and e.rown = 0 )
/Requires no external functions or packages.
regards
Simon

Similar Messages

  • How to fetch ABAP STACK value

    Dear all,
    In below snapshot, i want value in line number 23 (Current stack) from line number 12.
    There is some value in stack nunber 12 , i want to use it into current stack 23.
    How to fetch value from stack number 12??? Is it possible with the help of field symbol??
    Thanx,
    Satyen Trivedi

    Hi Satyen trivedi,
    You can use the Below method to fetch the non accessible value in your program using the Program Name.
    http://www.dataxstream.com/2009/08/use-abap-to-access-any-data-in-memory/
    Regards,
    Bhushan.

  • How to fetch the maximum values of 2 columns

    Hi All,
    I need to fetch the maximum value of 2 columns. For example I need to fetch the latest record for which i have to fetch the latest date and time. Date and time fields are 2 different columns. As of now am doing it the crude fetching the latest date records and then fetching the latest time record.
    Is there any other smarter way to do it. The one am doing rite now is turning out to be very performance intensive at the moment for me.  Also I could not apply max condition for two fields together.
    Please guide.
    Thanks,
    Nagraj

    Hi Jaspreet,
    Thanks for your response. But the problem am facing with this approach is I have to do this for n number of records in another internal table which is making it to cumbersome and affecting performance.
    Please suggest is there any better way to do it.
    Thanks,
    Nagraj

  • How to fetch future Delivery Value based on Sales Order

    Hi,
    I'm fetching the delivery data using the datasource 2LIS_12_VCITM.In my report I would also like to display the value of the delivery.How do I valuate these deliveries?Do I have to access the Sales order item for the net price or go to the pricing conditions data?
    Please suggest.
    Thanks,
    A Pothuneedi

    Hi
    You can search the samples....C:\-->Program files->SAP----->SDK->Samples->DiAPI----->OrderandInvoice...
    Here invoice is added for a particular sales order.....the same can be done for delivery.....
    Hope it helps

  • How to fetch the condition value per line item in PO o/p

    Dear Experts ,
    I need to fetch the value of the all valid condition types in the PO item , for its o/p .
    For this i should know
    1.what all are the  condition types involved in the item .
    2.what is the condition rate
    3. what is the condition value .
      Pleas etell me how do i fetch this data ??
    Thanks in advance
    Regards
    Anis

    Hi Anis,
    At first collect the doc.condition-KNUMV from EKKO table.
    Later enter the above doc.condition no in KONV and KONP to get the details.
    Regards
    Ramesh Ch

  • How to fetch last transactioned values for given period

    Hi,
    I'm working on a report, here I'm fetching data from j_2irg1bal table for some period. it has data to internal table like
    e.g. : given period 01-04.2009 to  30.04.2009
    date        mantr  opening balance closing balance
    04.04.2009  1007     100             130
    08.04.2009  1007     130              80
    here for given date two record are available,
    i need to capture last updated value i.e. for date 08.04.2009.
    Kindly suggest your ideas to move with this

    Hi,
    Assume that your values are in internal table ITAB.  Then,
    Sort ITAB by date DESCENDING.
    Doing so, your records gets sorted in Descending Order with respect to Date. And the Last updated record comes in the first position.
    And now,
    Read table ITAB index 1.
    The above code, fetches the last record into the Work-Area.
    That's it.
    Rgds,
    Ramani N

  • How to fetch the junk values of a column and the column name in oracle

    Hello,
    Can anyone help me in writing a procedure/dynamic SQL to fetch the column where the junk values appears and its value. Eg: If emp table contains ID and Name columns, and ID column contains junk values, the result should be the Id column and the junk value/s. It should be dynamic because next time if the other column contains junk values(like $,%...), the query should display the other column too..
    Thanks in advance..

    Try this, I'm not sure if it'll help... and get some idea...
    try to modify it as per your requirement -
    select * from junk_vals;
    1     ranit1
    2#     ranit2
    3     ranit3
    4$     ranit@4
    5     ranit5
    6     r^anit6
    select 'ID', id, val from junk_vals
        where regexp_like(id,'[^a-zA-Z0-9]')
    UNION
    select 'VALUE', id, val from junk_vals
        where regexp_like(val,'[^a-zA-Z0-9]');
    -- "Output :"
    ID     2#     ranit2
    ID     4$     ranit@4
    VALUE     4$     ranit@4
    VALUE     6     r^anit6
    NOTE - I've considered anything other than Alphabets and Numbers as a Junk Value
    Edited by: ranit B on Jan 4, 2013 5:07 PM
    -- o/p added

  • How to Fetch the Row value in SBO Formatted search

    Hi Experts,
    I have created a Sales order, in which i  have 4 UDF Fields(A,B,C,D) in the following:
    Example values:
    A  B  C  D 
    2   2   4  4
    3   2   6  10
    C=A*B
    D=1st value of D + 2nd col value of C
    i have written query for C, but how to write the Formatted search Query for generation of D values. plz reply as soon as possible.

    Magesh,
    I quite understand what you are trying to do.   If you look at the example below I added a third row to show how you want the D to be a running total of column C. RIGHT !!
    A B C D
    2 2 4 4
    3 2 6 10
    <b>4 2 8 18</b>
    Honestly, it is not going to be simple as you do not have a way in SBO to access a particular column from a row.  When you say $[$38.U_C] it refers to the context row OR the row which has the highlight OR the row which has the curson on it.
    It is not possible to say $[$38.U_C from row 2]  JUST  NOT POSSIBLE ...
    You have to write a tricky code by using a temp table referencing the value of column C.  Also you have to keep track if Rows gets deleted and a new row added. 
    I will test a sample code and will come back.
    Suda

  • How to fetch year till date value for earning for current ,last and year

    hi,
    how to fetch year till date value for earning for current ,last and year before that from payroll result
    plz reply soon,
    pratyush

    Dear Pratyush,
    Pick this from CRT.
    Use LDB PNPCE & Fire event GET PAYROLL &
    then you can pick from CRT.
    Hope this helps.
    Kindly reward in case useful.
    Regards & Thanks,
    Darshan Mulmule

  • How to fetch  old  and  new value  from of a   field(non-key)  from LOGDATA

    Hello SDNers,
    i  m fecthing LOgdata  from  dbtlog table[in  our  case  the  log  is  not  getting  Updated  in CDHDR  and CDPOS table]
    i  m  using  the  same  logic  as  it  is  used  in  RSVTPROT
    but  the  problem  is
    "  IT  is  fetching  OLD  and  NEW VALUE  after  Update from same  field LOGDATA  of  dbtlog  table BUT  when i  used  same  logic  it  is  FEtching  only  OLD  VALUEs,
    CAN  U  GUYS  PLS  TELL  ME  HOW TO FECTH  OLD  VALUE  and  NEW  VALUE  of a PArticular  field(non-key field, fecthing  key  field  is  not an  issue) From LOGDATA  field  of DBTLOG.
    thx  a  lot  in advance
    Regards
    Kuldeep

    Hi,
    May be this link is useful to you.

  • In Select query how to fetch values through multiple parameters  where conditon

    Dear Experts,
    I have one table(T) with 4 fields: f1, f2, f3, f4. In that based on f2, f3, f4 and parameter condition( f2 values) how to fetch f1 values. I have attached screen shot. What is the where condition in select query?
    DATA: it_T type standard table of ty_T,
              wa_T type ty_T.
    parameters: p_f2_1 type T-f3,
                      p_f2_2 type T-f3,
                      p_f2_3 type T-f3,
                      p_f2_4 type T-f4,
                      p_f2_5 type T-f4,
                      p_f2_6 type T-f4.
    select f1  f2  f3  f4 from T into table it_T where ?
    What is the where condition ?.
    Regards,
    Abbas.

    Hi Syed,
    Do all the parameters p_f2_1 ... p_f2_6 contain values for the same field f2? And do you need all the entries from the table T which contain f2 = any of the entered value? If yes, Then you can try the following where condition -
    select f1  f2  f3  f4 from T into table it_T
      where f2 =  p_f2_1  OR
                 f2 =  p_f2_2  OR
                 f2 =  p_f2_3  OR
                 f2 =  p_f2_4  OR
                 f2 =  p_f2_5  OR
                 f2 =  p_f2_6.
    P.S: If any of the above parameters are optional as per your requirement it will be better to build a dynamic query and use it in the where condition.
    Regards,
    Rachna.

  • How to edit the records value fetched by select statement query in sqldever

    How to edit the records value fetched by select statement query in sqldever 2.1.1.
    EX-
    SELECT * FROM emp WHERE ename like 'Jaga%'
    Edited by: user9372056 on Aug 31, 2010 2:16 AM

    Hi,
    Although some forum members may be using that tool, there is still a dedicated forum for SQL Developer.
    SQL Developer
    Maybe your chances are better there.
    Regards
    Peter

  • How to fetch data where reference with two values

    Hello Gurus,
    How to fetch data from database table with two values for reference. like
             SELECT  < FIELDS>
                              FROM <DB>
                              INTO TABLE TAB2
                              FOR ALL ENTRIES IN
                              TAB1
                              WHERE
                               FIELD1 = TAB1-FIELD1 AND
                               FIELD1 =  TAB1-FIELD2.

    Hi,
    If you want to get data for both fields then Instead of AND use OR
            SELECT  < FIELDS> 
                              FROM <DB>
                              INTO TABLE TAB2
                              FOR ALL ENTRIES IN
                              TAB1
                              WHERE
                               FIELD1 = TAB1-FIELD1 OR
                               FIELD1 =  TAB1-FIELD2.
    Or if you want that only common data for both fields should be fetched then create new internal table. Append data of both fields into that table. Sort new table and do delete adjust duplicate. Now use new internal table in your select query.
    Let me know if this helps.
    Regards,
    Jigar Thakkar.

  • How to fetch the Business area field value from MIRo into report

    Hi,
    I want to create a report for MIRO with payment details.
    How to fetch the business area field value in to report.
    What is the table name. I verified it is storing in structure. Which is the right table for fetching that value with reference to MIRO.
    After that, how to find the accounting document for payment and check details.
    What are the table names and field names. What we can get from PAYR table.
    With regards
    Lakki

    Dear,
    For Bussiness area
    RKPF-GSBER

  • Calling procedure in another procedure, how to fetch values

    I have couple of procedure in a package and I am trying to call procedurea in procedureb.
    TYPE T_CURSOR IS REF CURSOR;
    PROCEDURE ProcedureA (acct IN number, o_cur OUT T_CURSOR)
    AS
    BEGIN
          Open o_cur for
           SELECT A, B, C, D, E, F FROM DEMO;
    END ProcedureA
    PROCEDURE ProcedureB (param1 IN number, param2 IN number)
    AS
    get_cursor                 T_CURSOR;
    BEGIN
    ProcedureA(111, get_cursor);
    END;How to fetch ProcedureA values in ProcedureB? And also I want to get only columns A and B in ProcedureB.

    >
    How to fetch ProcedureA values in ProcedureB?
    >
    Try something like this
    TYPE rectype IS RECORD (colA  demo.a%TYPE, colB demo.b%TYPE    );
         rec1  rectype;
    LOOP
      FETCH get_cursor   INTO rec1;
      EXIT WHEN get_cursor%NOTFOUND;
            DBMS_OUTPUT.PUT_LINE(rec1.colA);
         END LOOP;
           DBMS_OUTPUT.PUT_LINE('end test');

Maybe you are looking for

  • Exporting specific columns from XLS file to a new XLS or XLSX file using powershell

    The scenario is that i have a file that our server is constantly dumping data to on a daily basis and out of all the data i only need 2 columns. I need to be a able to automate this because i need to generate a monthly report based on those two colum

  • Textinput issue from external file in AIR application (Is it bcz of mask?)

    Hi I tried to load external swf in TabNavigator. In this file, I have some input text. I can key in external file's text input after load. But i got  "Security Sandbox Violation" error. Here is the code <s:WindowedApplication xmlns:fx="http://ns.adob

  • Developer Mode Exception encountered for item.

    Hi, After running the page I am getting following error , 1. Developer Mode Exception encountered in item CitizenId Error: The item CitizenId has a maximum length (0) which is not equal to that of the corresponding VO attribute, CitizenId length (20)

  • Goods movement tab in production order confirmation

    Hi Gurus, please suggest me with the solution for my requirement. while performing production order confirmation, some user should be restricted to see goods movements and some can. how is can me done? Thanks in advance.

  • My macbook air shut down slow

    My air only bought for 2 months, and after I upgraded to the newest OX system, it took about 10s to shut down instead of 1-2s to shut down. Is any one know how to fix that problem?