Spatial data schema query

I need to interact with spatial data, but I'm getting errors when tables have a SDO field in them. Is this supposed to work now?
I'm using an OracleDataAdapter, and calling adapter.FillSchema to retrieve the table's schema. I get an exception saying that a Custom type mapping for the SDO field is not specified or invalid. Do I need to manually map something to get SDO fields to work?
Thanks

Yes you have.
See here for an example:
http://www.orafaq.com/forum/t/27794/0/

Similar Messages

  • Cache spatial data or query

    I have an application where, as expected, the first spatial query is taking longer for users then when they submit the same or similar query layer on in the session. Is there a way to cache that first query before our users even start the application so that they won't have to wait for the first hard parse? Or would trying to keep the table itself in the cache be a way to go?
    Thanks
    -mcslain

    Ok, there's two types of 'cache' in play here. The first is the shared SQL. The first time a query is run it will be hard parsed. The explain plan will be stored in the shared pool thereafter until it is aged out (shouldn't happen often normally). Any subsequent queries using the same SQL (assuming you're using bind variables) will reuse the shared SQL. You could force that SQL into the shared pool to avoid users having to experience a hard parse (setup a procedure and dbms_schedule it), but you shouldn't need to do so. If you're getting a lot of hard parses, then either you're not using bind variables, or something is aging the SQL out of the shared pool - that could be too many DB shutdown/startups, shared pool too small, etc.
    I'd address that problem first.
    The other 'cache' is the buffer cache. If the data to be read by the query doesn't yet exist in the buffer cache, then it'll have to go to disk to get it. That'll take longer than reading from the buffer cache. So the first query will probably take longer than subsequent ones. You could look at pinning a table in the KEEP pool, but I'd only do that for small tables which are accessed very often.

  • Retrieving spatial and non spatial data in one query

    Hello. I am having slight difficulties using JDBC to retrieve both spatial and non spatial data in the same query. The following is code from a sample program of mine that retrives spatial data from spatial tables.
    (In spatialquery geom is a geometry column and city is simply the name of the city):
    try
    Geometry geom = null;
    String database = "jdbc:oracle:thin:@" + m_host + ":" + m_port + ":" + m_sid;
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    con = (OracleConnection)DriverManager.getConnection(database, sUsername, sPassword);
    GeometryAdapter sdoAdapter =
    OraSpatialManager.getGeometryAdapter("SDO", "8.1.7", STRUCT.class, null, null, con);
    String spatialquery = "SELECT a1.geom, a1.city \n" +
    "FROM cities a1";
    Statement stmt = con.createStatement();
    OracleResultSet rs = (OracleResultSet) stmt.executeQuery(spatialquery);
    int i = 0;
    int noOfFeatures = 2;
    while (rs.next())
    for(i = 1; i <= noOfFeatures; i++)
    STRUCT dbObject = (STRUCT)rs.getObject(i);
    try
    geom = sdoAdapter.importGeometry(dbObject);
    catch(GeometryInputTypeNotSupportedException e)
    System.out.println("Input Type not supported");
    catch(InvalidGeometryException e)
    System.out.println("Invalid geometry");
    System.out.println(geom);
    }//end while loop
    This retrieves the sptial data fine, however when I attempt to retreive the non-spatial data I keep getting a "ClassCastException" error. I understand it is something to do with "STRUCT dbObject = (STRUCT)rs.getObject(i);" line. Can anyone tell me how to retrieve both spatial and non-spatial data in the one query using JDBC. I have tried nearly everything at this stage. Cheers joe

    Theresa A Radke
    Posts: 20
    OTN Member Since: Jul, 2001
    retrieving spatial and non spatial in same query. May 23, 2003 12:02 AM
    retrieving spatial and non spatial in same query.

  • MDSYS Schema in the Database for spatial data

    Hi
    As MDSYS Schema is required in the oracle database to hold the spatial data, The client database server has no MDSYS schema installed.
    So, when i import the mvdemo.dmp file in the database it is erroring out since there is no spatial data, Please let me know how to get the MDSYS schema in the database.
    Thank You

    Hi thanks for your response, i found this out in the oracle site, DBA ran this script for creation of MDSYS..but there was no data in some of the tables which are needed for development.
    --- COMPATIBLE init.ora parameter is set to 9.0.0.0.0 or higher
    show parameter compat
    NAME TYPE VALUE
    compatible string 10.2.0.3.0
    If you create an Oracle database using the Database Configuration Assistant (DBCA), Spatial is installed by default and you do not need to perform the installation steps described in this section.
    Steps to create the MDSYS schema and objects
    1) Connect to the database instance specifying AS SYSDBA.
    2) Create the MDSYS user with a command in the following format:
    SQL> CREATE USER MDSYS IDENTIFIED BY <password>;
    3) Grant the required privileges to the MDSYS user by running the following procedure:
    SQL> @ORACLE_HOME/md/admin/mdprivs.sql
    4) Connect as MDSYS.
    5) Install Spatial by running the following procedure:
    SQL> @ORACLE_HOME/md/admin/catmd.sql
    SQL> ALTER USER MDSYS ACCOUNT LOCK;
    So this solution dint work out.......

  • Query for spatial data with a GeometryCollection fails

    There are exact 538 CurvePolygons (only exterior rings at this
    sample). All of them are valid geometries and equal in dimension
    and so on. Now I connect them to a GeometryCollection and query
    for other relating spatial data in some tables. It seems that
    the use of around (not exact!) 200 CurvePolygon in one
    GeometryCollection works fine but the adding of more
    CurvePolygon result in an error with the Spatial Index (I could
    add the ORA- error numbers if I have some data in my test tables
    again next days).
    Is there anybody else having trouble with these mysterious
    problem? Maybe there is a border by the number of points in
    GeometryCollection?
    (More details, programming code could be delivered)
    (working with Java 1.3.1, oracle.sdoapi.*, Oracle 8.1.7.)

    Hi Lutz,
    Could you provide more info or samples of what is going wrong?
    Also, could you try making sure the geometry you are passing in
    as the query window is valid (i.e. instead of passing it in as a
    query window, pass it into sdo_geom.validate_geometry).
    Thanks,
    Dan

  • Oracle date parameter query not working?

    http://stackoverflow.com/questions/14539489/oracle-date-parameter-query-not-working
    Trying to run the below query, but always fails even though the parameter values matches. I'm thinking there is a precision issue for :xRowVersion_prev parameter. I want too keep as much precision as possible.
    Delete
    from CONCURRENCYTESTITEMS
    where ITEMID = :xItemId
    and ROWVERSION = :xRowVersion_prev
    The Oracle Rowversion is a TimestampLTZ and so is the oracle parameter type.
    The same code & query works in Sql Server, but not Oracle.
    Public Function CreateConnection() As IDbConnection
    Dim sl As New SettingsLoader
    Dim cs As String = sl.ObtainConnectionString
    Dim cn As OracleConnection = New OracleConnection(cs)
    cn.Open()
    Return cn
    End Function
    Public Function CreateCommand(connection As IDbConnection) As IDbCommand
    Dim cmd As OracleCommand = DirectCast(connection.CreateCommand, OracleCommand)
    cmd.BindByName = True
    Return cmd
    End Function
    <TestMethod()>
    <TestCategory("Oracle")> _
    Public Sub Test_POC_Delete()
    Dim connection As IDbConnection = CreateConnection()
    Dim rowver As DateTime = DateTime.Now
    Dim id As Decimal
    Using cmd As IDbCommand = CreateCommand(connection)
    cmd.CommandText = "insert into CONCURRENCYTESTITEMS values(SEQ_CONCURRENCYTESTITEMS.nextval,'bla bla bla',:xRowVersion) returning ITEMID into :myOutputParameter"
    Dim p As OracleParameter = New OracleParameter
    p.Direction = ParameterDirection.ReturnValue
    p.DbType = DbType.Decimal
    p.ParameterName = "myOutputParameter"
    cmd.Parameters.Add(p)
    Dim v As OracleParameter = New OracleParameter
    v.Direction = ParameterDirection.Input
    v.OracleDbType = OracleDbType.TimeStampLTZ
    v.ParameterName = "xRowVersion"
    v.Value = rowver
    cmd.Parameters.Add(v)
    cmd.ExecuteNonQuery()
    id = CType(p.Value, Decimal)
    End Using
    Using cmd As IDbCommand = m_DBTypesFactory.CreateCommand(connection)
    cmd.CommandText = " Delete from CONCURRENCYTESTITEMS where ITEMID = :xItemId and ROWVERSION = :xRowVersion_prev"
    Dim p As OracleParameter = New OracleParameter
    p.Direction = ParameterDirection.Input
    p.DbType = DbType.Decimal
    p.ParameterName = "xItemId"
    p.Value = id
    cmd.Parameters.Add(p)
    Dim v As OracleParameter = New OracleParameter
    v.Direction = ParameterDirection.Input
    v.OracleDbType = OracleDbType.TimeStampLTZ
    v.ParameterName = "xRowVersion_prev"
    v.Value = rowver
    v.Precision = 6 '????
    cmd.Parameters.Add(v)
    Dim cnt As Integer = cmd.ExecuteNonQuery()
    If cnt = 0 Then Assert.Fail() 'should delete
    End Using
    connection.Close()
    End Sub
    Schema:
    -- ****** Object: Table SYSTEM.CONCURRENCYTESTITEMS Script Date: 1/26/2013 11:56:50 AM ******
    CREATE TABLE "CONCURRENCYTESTITEMS" (
    "ITEMID" NUMBER(19,0) NOT NULL,
    "NOTES" NCHAR(200) NOT NULL,
    "ROWVERSION" TIMESTAMP(6) WITH LOCAL TIME ZONE NOT NULL)
    STORAGE (
    NEXT 1048576 )
    Sequence:
    -- ****** Object: Sequence SYSTEM.SEQ_CONCURRENCYTESTITEMS Script Date: 1/26/2013 12:12:48 PM ******
    CREATE SEQUENCE "SEQ_CONCURRENCYTESTITEMS"
    START WITH 1
    CACHE 20
    MAXVALUE 9999999999999999999999999999

    still not comming...
    i have one table each entry is having only one fromdata and one todate only
    i am running below in sql it is showing two rows. ok.
      select t1.U_frmdate,t1.U_todate  ,ISNULL(t2.firstName,'')+ ',' +ISNULL(t2.middleName ,'')+','+ISNULL(t2.lastName,'') AS NAME, T2.empID  AS EMPID, T2.U_emp AS Empticket,t2.U_PFAcc,t0.U_pf 
       from  [@PR_PRCSAL1] t0 inner join [@PR_OPRCSAL] t1
       on t0.DocEntry = t1.DocEntry
       inner join ohem t2
       on t2.empID = t0.U_empid  where  t0.U_empid between  '830' and  '850'  and t1.U_frmdate ='20160801'  and  t1.u_todate='20160830'
    in commond promt
      select t1.U_frmdate,t1.U_todate  ,ISNULL(t2.firstName,'')+ ',' +ISNULL(t2.middleName ,'')+','+ISNULL(t2.lastName,'') AS NAME, T2.empID  AS EMPID, T2.U_emp AS Empticket,t2.U_PFAcc,t0.U_pf 
       from  [@PR_PRCSAL1] t0 inner join [@PR_OPRCSAL] t1
       on t0.DocEntry = t1.DocEntry
       inner join ohem t2
       on t2.empID = t0.U_empid  where  t0.U_empid between  {?FromEmid} and  {?ToEmid} and t1.U_frmdate ={?FDate} and  t1.u_todate={?TDate}
    still not showing any results..

  • Cannot edit Oracle Spatial data

    Hello,
    I am running into some problems with my Oracle Spatial data. Maybe somebody has some insight. Here's what is going on:
    1) I am able to connect to and view the data in uDig but I cannot edit the data and also the data shows up in the table of contents with a line symbol even though it is polygon data (it renders correctly in the map as polygons). I try using the 'Create Polygon Geometries' tool and it errors saying 'Create Polygon Tool' cannot operate on current layer.
    2) When I try testing edits through WFS-T it errors and tells me that the table is read only.
    The table is in the USERS tablespace and I have verified that it is read/write. I also set object permissions on the user: ALTER, DELETE, INSERT, SELECT, UPDATE
    Am I missing something obvious? Anyone else have this problem? Thanks a lot for any ideas anyone has.

    My apologies for the confusion. My insert statement DID work just fine. I just wasn't seeing it...probably because I was querying the table in Enterprise Manager DB Control and it looks like it takes some time to refresh. So it appears that user permissions are not the issue.
    I have used two data loading methods:
    Before loading data, I needed to create a user defined coordinate reference system:
    1 create projection operation for my custom projection
    2 configure projection parameters
    3 create the projected CRS in mdsys.sdo_coord_ref_system
    First data load steps
    1 shp2sdo.exe my_shapefile my_table -g geom -s 1000002 -v
    2 execute my_table.sql
    3 execute sqlldr.exe
    4 EXECUTE SDO_MIGRATE.TO_CURRENT('my_table','GEOM');
    5 CREATE INDEX my_table_index ON my_table(geom) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    Second data load steps:
    1 open up MapBuilder, make a connection, and go through the Import Shapefile wizard. MapBuilder automatically creates a spatial index.
    Does it appear that I am missing any steps or doing anything obviously wrong that would be causing me to not be able to edit the data through clients such as uDig or WFS-T?

  • Spatial Data in distributed environment

    Hi,
    I have some question regarding holding spatial data:
    1- Is any interchange possible between spatial data via DB Links
    2- is it possible to hold spatial data in distributed environments/different instances for several purposes so that a general application has an access via DB Links to each instance (different spatial data)

    You can fetch data via dblink. You cannot put data across a dblink.
    You cannot use spatial operators with data across a dblink (for instance, find all the geometries on a remote system that have some interaction with a user-specified query window).

  • Exporting non spatial data

    Hi,
    We are migrating our geodatabase from oracle 9i to 11g R2, in our current 9i DB we have same schema for spatial and non spatial data,we want to seperate the spatial and non spatial data during migration to 11gR2 DB.Is there any way through which we can extract only non spatial data and can import it to new schema without loosing any relationships/data.
    Regards,

    Hi
    Do you wants to separate the spatial data and non spatial data into two different table spaces or two different schema ?. if you're trying to move non spatial data to a different schema then definitely you need to do some changes . at least create some synonyms with appropriate grants to work normal.
    if you wants to move it to a different table space then it's easy .
    *1. Create the tables definition for non spatial data related table using new tablespace*
    *2. grant the realted user the quota on the new tablespace*
    *3. start the import using ignore=Y*
    Cheers
    Kanchana.

  • Need Help about Spatial Data Load - Mapviewer

    Hello everybody,
    I need an immediate help about spatial data load. I installed Oracle mapviwer quick start and try to work on it. However, I could not pass the load step. My questions are;
    1- Where can I find and download my country's data set (spatial data)
    2- With mapviwer, how can I load spatial data to my tables on database (Oracle). Those tables have sdo_geometry columns and I want to query location data, but could not load
    Regards,
    Dilek

    For Mapviewer questions, please post in the following forum:
    MapViewer
    Thanks

  • Why could not Oracle replicates tables which includes Spatial Data to Logical Standby?

    Hi all,
    Nowadays, i am working on Oracle Logical Standby Databases which includes Spatial Data? But i could not achieve to transport a table with multimedia data (with spatial data types ). But Logical Standby Databases can not support this type of tables? Is this a restriction of modelling Spatial and Geometry in data blocks? And how do i achieve this because i should use this secondary for query-only?
    Kind Regards,

    Some data types are simply not supported by logical standby replication. Depending on the version, this might or might not include Spatial.
    11.2: https://docs.oracle.com/cd/E11882_01/server.112/e41134/data_support.htm#SBYDB4936
    12.1: https://docs.oracle.com/database/121/SBYDB/data_support.htm#SBYDB4936
    If you need to replicate Spatial data, you need to look at other mechanisms. E.g., physical standby, materialized views, or GoldenGate.

  • Spatial Data and XML metadata

    My project involves storing various types of spatial data in Oracle 8i. There is also going to be metadata collected for each project. The purpose of the metadata will be for discovery and retrieval of the spatial data. I would like to store the metadata entries (using WebDB to create entry form) as XML documents. What is the best way to create XML metadata from a HTML form? It appears that the new Xforms from W3C may accomplish this, although it's not really a standard yet. Also, it there a way to send the spatial data from a form created by WebDB? Would the XML metadata be stored in the spatial DB with the data or in a separate "metadata repository"? How would the metadata be attached to the data for query and discovery/retrieval? I appreciate any feedback. Thanks.

    Jonrka1,
    Spatial already uses a metadata table called user_sdo_geom_metadata where you need to store metadata for all of your spatial tables. Oracle spatial currently does not support metadata in XML format although it is being actively investigated in conjunction with Oracle 8i Spatial XML server. With the XML server you will be able to retrive spatial (and attribute) data as well as update the spatial table using XML.
    Check OTN often for announcemnets on the XML server and related products.
    For your customized XML spatial metadata you can store it anywhere (with a spatial db or in a separate repository), and you will have to maintain the link between the metadat and the real data yourself.
    LJ
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by jonrka1 ():
    My project involves storing various types of spatial data in Oracle 8i. There is also going to be metadata collected for each project. The purpose of the metadata will be for discovery and retrieval of the spatial data. I would like to store the metadata entries (using WebDB to create entry form) as XML documents. What is the best way to create XML metadata from a HTML form? It appears that the new Xforms from W3C may accomplish this, although it's not really a standard yet. Also, it there a way to send the spatial data from a form created by WebDB? Would the XML metadata be stored in the spatial DB with the data or in a separate "metadata repository"? How would the metadata be attached to the data for query and discovery/retrieval? I appreciate any feedback. Thanks.<HR></BLOCKQUOTE>
    null

  • Spatial Data Types in ASE

    Do you plan to support "Spatial Data Types" in ASE?

    Spatial datatypes are supported through a third-party Specialty Data Store module, in this case the Spatial Query Server from Boeing.  See Boeing&amp;nbsp;Intelligence Systems Group (ISG)&lt;/title&gt; &lt;style type=&quot;text/css&quot; media=&quot;scre…
    If that doesn't fit your needs, please describe in more detail what you are looking for.
    cheers,
    -bret

  • Migrate Spatial data to another instance

    i intend to port Oracle Spatial to another instance and get stucked.
    1. can not export/transfer sdo_geom_metadata_table from mdsys
    Try exp on mdsys, Oracle complains invalid username....
    Try database link, Oracle complains about remote access of user-defined datatype...
    2. when import Oracle Spatial data to another instance, most of the indexes failed to be created.
    Not just spatial indexes, even some indexes on attributes are not created.
    Is it caused by (1) ?
    jc

    James,
    If you export the schema with the spatial data in it the export file contains also the registration for the metadata .
    The failing of the creation of the indexes most likely occurs by the fact the tablespace name of the original database is different from the target database.
    You can with the import utility create a indexfile. This file contains all the index create commands. In this file you can correct the tablespace name.
    Jurgen

  • Search  Encrypt Methods Of  Spatial Data !!!

    Hi&#65306;
    Hello&#65292;Everybody&#65281;
    I trying to search encrypt methods of spatial data(vector data),whether some also made a study of this aspect ,Can anyone guide to me ?
    Li in China

    Yes have read it that's why my query looks a lot like that sample...
    Turns out the objects are transferring but that the Oracle provider for OLE DB
    converts the VARBINARY(MAX) from SQL Server to LONG and given this has
    a length limit some of the spatial records are being truncated...
    Anybody know if a different provider would work or of a way of overridding the
    mapping to LONG with a different and longer Oracle datatype?

Maybe you are looking for

  • Print directly to the printer from Oracle 9I

    Please it is possible to print directly to the printer from Oracle 9i without having to show the report on the web.

  • Open items list with

    HI Experts,                     want to open items list with customer id,fiscal year,posdting date,document date,currency reference,amount and Gl accounts.. where i can find and download this.. i tried through fbl5n but not worked.. please anyone giv

  • How to replace the desktop case tower

    I recently bought a refurbished ENVY 700 series desktop computer, it's in great condition. Unfortunately, I accidently dropped it and cracked the front cover of the case tower. I love the case design, but I don't want to have a cracked case in the re

  • Erased Firmware can't update since PC won't recognize pla

    I have a Zen Micro. My PC wasn't recognizing the device. I searched forums and found out about a problem with the firmware and the need for an update. The old firmware was deleted, but now I can't install the new firmware because the PC doesn't recog

  • In Windows Server 2008 : Powershell can't import-module ActiveDirectory

    Hi, Thank you in advance for any possible help. I am using Windows Server 2008 with a x64 machine and I have Powershell 3.0. After searching for similar problems, I found that I have to install the patches KB969166, KB968934, KB967574, KB968930. This