Update query for managing an Oracle spatial database

Hi,
i'm trying to manage a spatial network i have created in Oracle 11g. One of the tables i have created named "DE_OSM_RT_LINK$", contains data for links which exist between nodes. The link table contains a column named "Cost". All the values of this column are equal to "0". I need to UPDATE these values with the length of each link. I have made a query which finds the length (using data from the geometry column) but i can't make a query that finds the length and simultaneously updates the "cost" column. The query i have tried to make in order to update the "cost" column with the length is:
UPDATE DE_OSM_RT_LINK$
SET COST = (SELECT SDO_GEOM.SDO_LENGTH (d.geometry, m.diminfo)
FROM DE_OSM_RT_LINK$ d, user_sdo_geom_metadata m
WHERE m.table_name = 'DE_OSM_RT_LINK$' AND m.column_name = 'GEOMETRY');
It doesn't run. I can't find what else is needed in this query in order to update the "cost" column. Could you please help me because i don't have much experience?
Thank you

Try connecting as SCOTT/TIGER, then do this:
select * from user_sdo_geom_metadata;
if the table does not exist, then spatial hasn't been installed
if it does exist, then spatial (or locator) has been installed.
If the table didn't exist, rerun the installer, choose a custom
installation, and check the Spatial box, then install.
If the table did exist, or after you install spatial, you'll want to
use the user's guide, or take the spatial course to get started.

Similar Messages

  • Regarding  working with oracle spatial database connections

    sir/madem,
    i am an engg student, my final year project on inserting data into oracle spatial database through java /jsp , i am working with oracle spatial database 10g/11g,
    i want know how to insert/retrive/ manuplute the spatial data into oracle spatial databse for 10g/11g, through java programing,
    the syntax for connection of oracle spatial database 10g/11g, needed,
    i have less time to finish my project
    i hope u  help me
    thank u
    kasim
    ([[email protected]|mailto:[email protected]])

    For database access from Java, you will use JDBC.
    For the specifics of the oracle spatial database, you'll have to check the documentation/forum of Oracle.
    * [How To Ask Questions The Smart Way|http://www.catb.org/~esr/faqs/smart-questions.html]
    * [JDBC Tutorial|http://java.sun.com/docs/books/tutorial/jdbc/index.html]

  • Regarding working  oracle spatial database programing

    sir/madem,
    i am an engg student, my final year project on inserting data into oracle spatial database through java /jsp , i am working with oracle spatial database 10g/11g,
    i want know how to insert/retrive/ manuplute the spatial data into oracle spatial databse for 10g/11g, through java programing,
    the syntax for connection of oracle spatial database 10g/11g, needed,
    i have less time to finish my project
    i hope u help me
    thank u
    kasim
    ([email protected])

    For database access from Java, you will use JDBC.
    For the specifics of the oracle spatial database, you'll have to check the documentation/forum of Oracle.
    * [How To Ask Questions The Smart Way|http://www.catb.org/~esr/faqs/smart-questions.html]
    * [JDBC Tutorial|http://java.sun.com/docs/books/tutorial/jdbc/index.html]

  • A simple query in My SQL what is the similer query for that in Oracle ???

    hello friends
    In My Sql if i have 1000 records in a table and i want to get the records from 400 to 550 then it is posible by giving the following query
    Select * from Table a , table b where condition "List 400,550" gives the records from 400 to 550
    what is the coresponding query for this in oracle database
    any one help me pls
    mail me to [email protected]

    Genericly, if you want records N through M from a SELECT statement, there's a wonderful article on asktom.oracle.com
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:127412348064
    Justin

  • New query for 'Manage Database' option in SQL Developer

    Dear all,
    I want to suggest a changed query for the 'Manage Database' option in SQL Developer (right-click on the connection), see the query below.
    This query has the following changes;
    - extra column with the Maximum disk space based on the datafiles (considering autoextend of datafiles); MAX_DATAFILES
    - the PERCENT_USED and PCT_USED are based on the MAX_DATAFILES, as this is really important (and not the difference between ALLOCATED and USED)
    - the results are shown in GB, as that is in my opinion more relevant in this time of data explosion
    - rename of the column FREE to UNUSED_ALLOCATED, as this column identifies how much of the Allocated space is not used
    I hope the query can replace the current one, to improve SQL Developer even more.
    Thanks for the nice tool SQL Developer!
    Kind regards,
    Siebe
    -- Manage Database - Changed Oracle SQL Developer query with regard to Usage of Tablespaces in GB (considering autoextend of datafiles)
    SELECT "TABLESPACE_NAME", "PERCENT_USED", "PCT_USED", "MAX_DATAFILES", "ALLOCATED", "USED", "UNUSED_ALLOCATED", "DATAFILES" FROM(
    select * from (
    SELECT a.tablespace_name,
    --'SQLDEV:GAUGE:0:100:0:0:'||nvl(ROUND(((c.bytes-nvl(b.bytes,0))/c.bytes)*100,2),0) percent_used,
    --ROUND(((c.bytes-nvl(b.bytes,0))/c.bytes)*100,2) PCT_USED,
    'SQLDEV:GAUGE:0:100:0:0:'||nvl(ROUND(((c.bytes-nvl(b.bytes,0))/c.maxbytes)*100,2),0) percent_used,
    ROUND(((c.bytes-nvl(b.bytes,0))/c.maxbytes)*100,2) PCT_USED,
    round(c.bytes/1024/1024/1024,2) allocated,
    round(c.bytes/1024/1024/1024-nvl(b.bytes,0)/1024/1024/1024,2) used,
    round(c.maxbytes/1024/1024/1024,2) max_datafiles,
    round(nvl(b.bytes,0)/1024/1024/1024,2) unused_allocated,
    c.datafiles
    FROM dba_tablespaces a,
    ( SELECT tablespace_name, SUM(bytes) bytes FROM dba_free_space GROUP BY tablespace_name ) b,
    ( select count(1) datafiles, SUM(bytes) bytes, SUM(DECODE(autoextensible, 'YES', maxbytes, bytes)) maxbytes, tablespace_name from dba_data_files GROUP BY tablespace_name ) c
    --( select count(1) datafiles, SUM(bytes) bytes, SUM(c.maxbytes) maxbytes, tablespace_name from dba_data_files GROUP BY tablespace_name ) c
    WHERE b.tablespace_name (+) = a.tablespace_name
    AND c.tablespace_name (+) = a.tablespace_name
    ORDER BY nvl(((c.bytes-nvl(b.bytes,0))/c.maxbytes),0) DESC
    ) --sub1 order by 1 asc
    )

    Very little technical information provided about the error.
    "+IO error.+" - this likely refers to the client attempting to use a socket handle and the call to the handle failing.
    +"The network adapter could not establish the connection.+" - this likely means that the IP address to connect to, could not be reached, or that the connection was not accepted on that port on the remote IP address. (typically hostname resolution errors would give a different error)
    The easiest way to test connectivity is using the ping command to bounce an ICMP echo off the remote IP.
    If that works, test access to remote port on that remote IP using the telnet command - this will check whether there is a service accepting connections on that port, and whether access to that port is allowed in case of firewalls en-route.

  • How to Query Sdo_Geometry Object of ORACLE SPATIAL in PHP?

    Hi,
    I am trying to Query the Oracle Spatial's Geometry object in the PHP page but its giving me the ADT Error. How can i see the GEOMETRY object information on the web using PHP. Thanking you in advance and waiting for ur prompt reply.
    Adnan!

    Hi Ana,
    In the Query below its returning the result as each value of one row in diffrent rows i wanna ask from u is:
    1- May i get all these values in one row ?
    2- Second, i want to query more than one row values from the table? as this is a single row subquery.
    Thanks for your help and i m looking forward for a positive reply from you.
    Regards,
    Adnan!
    The following select lists all ordinate-values from ONE object in the table:
    select *
    from table(select a.<column_name>.sdo_ordinates
    from <table_name> a
    where ID = xxxx
    *******************************************************************

  • Can we load generic binary image in Oracle spatial database

    hi i am new to this topic. so kindly help me out.
    can we store generic binary image in Oracle 10g spatial database?
    generic i mean there is no header information.

    hi everybody,
    thanks in advance. i am in little bit confusion. actually i am new to oracle 10g spatial db concept and image processing. i have to decide whether to store DEM & ORTHO image in Oracle 10g spatial database. or using BLOB to store these images. i have to design physical as well as logical database to store both above mentioned images.
    i don't have much knowledge about DEM & ORTHO image.
    i don't know what to do. even though i have started some of the Oracle 10g spatial concepts. i would like to know can i also use oracle intermedia for storing these images (ORTHO & DEM images).
    looking for help
    thanks
    Ajay

  • Oracle Spatial Database option

    hello all,
    I downloaded Oracle 9i Personal Edition for Windows 98 platform.
    It is a free download @ technet.oracle.com.I have successfully installed the database.
    Now i was looking for an "Oracle Spatial" option in the database.
    Can anybody tell me how can i store geospatial data in the Oracle database ?
    or how can i set the option "Oracle Spatial" in the database ?
    I m looking forward for ur help.
    Bikram.

    Try connecting as SCOTT/TIGER, then do this:
    select * from user_sdo_geom_metadata;
    if the table does not exist, then spatial hasn't been installed
    if it does exist, then spatial (or locator) has been installed.
    If the table didn't exist, rerun the installer, choose a custom
    installation, and check the Spatial box, then install.
    If the table did exist, or after you install spatial, you'll want to
    use the user's guide, or take the spatial course to get started.

  • Update values for additional (new) keyfield in database table

    Hi All,
    Here in our firm we have a Z table with data in it. As part of the new requirement I had to add a new key field in it.
    Now I have to maintain values for these key fields in the already existing data.
    I cannot maintain it though SM30 as the maintenance view grays that field in SM30.
    Is there any way of updating this new key field data in database.
    Thanks,
    Kajal

    Hello Rob,
    thank you for this information. Up to now, I thougth, that it is impossible to update the primary key. I've checked it in our system and it works. But it seems, that you have to use the "update set" to update a field of the primary key - am I correct?
    @Kajal,
    I've created a table:
    Field      Key Data element
    MANDT  X     MANDT
    MATNR  X     MATNR
    MAKTX         MAKTX
    Then I've tried the following coding:
    data: wa_test type zithtest.
    select single * from zithtest into wa_test.
    move: 'DE' to wa_test-spras.
    update zithtest from wa_test.
    write: sy-subrc.
    select * from zithtest into wa_test.
      write: / wa_test.
    endselect.
    result: sy-subrc = 4 and no update of the primary key
    Then I've tried the following:
    data: wa_test type zithtest.
    select single * from zithtest into wa_test.
    move: 'DE' to wa_test-spras.
    update zithtest set spras = wa_test-spras
                    where matnr eq wa_test-matnr.
    write: sy-subrc.
    select * from zithtest into wa_test.
      write: / wa_test.
    endselect.
    Result: sy-subrc = 0 and the primary key has been updated.
    By the way - reward points to Rob, as he has given the correct solution.
    Best regards
    Stephan
    Edited by: Stephan Theis on Jan 17, 2008 9:50 PM

  • Performance of update query for single column vs multiple column

    Hi All,
    I could not find any answer for this, does it ever matter in terms of performance updating single column versus multiple column in a single update query.
    For eg. table consisting of 15 columns, what would be the difference in performance when one column is update in the single query against another update query where 15 columns are updated.
    Please do keep in mind my table columns in actually could be around 150+.
    Thanks for any information provided.

    If updated columns aren´t on where clause , then the only impact of 15 columns will be a increase on redo generation, and a possible chainning row.
    So since the redo is one of the things that have a large impact, the answer is yes.
    The performance will be slower.
    Regards
    Helio Dias.
    http://heliodias.com
    OCE SQL, OCP 9i

  • Creating an Oracle Spatial database in 10g and connecting ArcGIS

    I have a set of shapefiles that I want to convert into Oracle Spatial 10g and then be able to view these with the capability of ArcGIS 9 (without using ArcSDE).
    From what I've read, I think this could be done by using ODBC. Once that connection is made, will I then be able to use the full functionality of ArcGIS especially read/write functions to edit the information in Oracle Spatial?
    What data formats does Oracle Spatial in 10g support. I am concerned about raster data, CAD data, Survey data etc

    The shape files can be loaded into Oracle spatial using shp2sdo.exe available on web.To view the GIS data in ArcGIS ,ArcGIS needs the layers to be registered.Therefore you need Arcsde for registering the layers.But for viewing the data in Arcgis we do not need arcsde ,we can view the data using direct connect.For editing the data we can use ODBC connection.
    About raster data,we can load tiff,jpeg,bmp,png,gif using georaster tools provided by oracle into georaster tables.
    Thanks
    PC Rao

  • Update query for 2 lakhs records

    I have 2 tables with 3 common columns (Col1, col2,Primary). One common column name is primary (oracle key word). No indexes are used on these tables. I need to write an update query as shown below. 
    Emp table
    Col1       col2        primay
    100         101         y
    103         104         n
    201         105         y
    100         101         y
    Dept table
    Col1       col2        primay
    100         101         null
    103         104         null
    000         656         null
    Update query Result
    Col1       col2        primary
    100         101         y
    103         104         n
    Please help me.
    Thanks

    Update dept d
    set d.primay = (select distinct e.primay from emp e where e.col1 = d.col1 and e.col2 = d.col2);
    In emp table there are 100 and 101 with two entries but with same primay value. so to handle such scenarios I have taken distinct iniside select statement.
    if you have a case like where in emp table col1 and col2 are same and having different primay table, then obviously you should tell which value should go and update the dept table and based on what logic.

  • Accessing a legacy Oracle Spatial Database

    We have an Oracle 9i server with Spatial extensions. There are data tables with SDO_GEOMETRY columns. These tables contain information that is consumed by a legacy application that uses MapInfo MapX GIS control. MapInfo stores metadata info in a proprietary Oracle DB table. The standard Oracle Spatial metainfo tables are empty.
    What would be your recommendation for rescuing the geodata in the tables and generating the Oracle Spatial metainfo and being able to access the DB with Oracle Spatial-compatible tools like MapViewer?
    Can MapViewer access the data and generate what is missing in the DB?
    Thanks!
    Edited by: 921274 on Mar 15, 2012 5:52 PM

    Try connecting as SCOTT/TIGER, then do this:
    select * from user_sdo_geom_metadata;
    if the table does not exist, then spatial hasn't been installed
    if it does exist, then spatial (or locator) has been installed.
    If the table didn't exist, rerun the installer, choose a custom
    installation, and check the Spatial box, then install.
    If the table did exist, or after you install spatial, you'll want to
    use the user's guide, or take the spatial course to get started.

  • Update query for lumia 925

    Hi All,
    I'm using Lumia 925, recently got an update option for my phone and I updated it.
    Its now showing lumia black.
    But even after the update I'm not able to get the option for call+sms setting (for call block feature)
    Can someone help me with this??
    Thanks
    Aman Mehra

    Hi mehraaman,
    Kindly Update all System Apps on your phone. Follow the instruction here: WP8 System Apps.

  • Update query for a table

    Hi
    Can any body send valid update query like this:
    <sql:update var="XX">
    Update emp set name='yy', phone='1234' where id='abc'
    </sql:update>
    Thanks in Advance
    SP

    Hi
    Can any body send valid update query like this:
    <sql:update var="XX">
    Update emp set name='yy', phone='1234' where id='abc'
    </sql:update>
    Thanks in Advance
    SP

Maybe you are looking for