v...@csiro ha scritto:
> I was thinking somewhere along the line of:
> 
> String sql = "select id, st_asbinary(shape) as shape from geology.table ";
>             ResultSet p = postgis.createStatement().executeQuery(sql);
>             PreparedStatement s = oracle.prepareStatement("update table set
> shape=SDO_GEOMETRY(?) where id=?");
>             while (p.next()) {                 
>                 s.setBytes(1, p.getBytes("shape"));
>                 s.setInt(2, p.getInt("id"));
>                 s.executeUpdate();
>             }
> 
> java.sql.SQLException: ORA-29532: Java call terminated by uncaught Java
> exception: java.lang.RuntimeException: -2 
> ORA-06512: at "MDSYS.SDO_UTIL", line 186
> ORA-06512: at "MDSYS.SDO_GEOMETRY", line 76
> 
> 
> So from the 2 solutions suggested, i would have to export to shapefile and
> reimport that into oracle?

If you follow my example you just have to recode the read bit to
connect directly to postgis. No need to do shapefile exports.
Of course using pg2shp and then the example I posted as is it's easier,
less programming involved. The downside is that shapefile will mangle
the structure of your original table, the attribute names might be
cut, simple polygons will become multipolygons, and so on.

Cheers
Andrea

-- 
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to