Hi David, In this example node is just a table with an ID :NUMBER(38) and a position: SDO_GEOMETRT column as opposed to the the Node type in oracle. It actually does this on any coordinate transformation done from JDBC.
I'm going to see what happens if I add in the dimension parameter to the transform calls as I'm seeing when I run the SQL tuning advisor ORA-06553: PLS-306: wrong number or types of arguments in call to 'TRANSFORM' I'd rather not resort to stored procs as I have a large number of tables and would prefer to use regular SQL. Paul David Zwiers wrote: > Paul, > > We've typically used a stored procedure to interact with Oracle Spatial. > This allowed us to use bind variables, simplifying the SQL. You may wish > to look into JTSIO for passing sdo_geometry across JDBC binds. > > Also, I think we may be missing some information as 'node' is undefined > in 10GR2 and you do not retrieve the data from the executed statement > (need to do this explicitly). > > David > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Paul Austin > Sent: July 23, 2007 12:17 PM > To: List for discussion of JPP development and use. > Subject: [JPP-Devel] Oracle sdo_cs.transform > > Does anyone have any experience with Oracle spatial using JDBC and > sdo_cs.transform? > > If I execute the following SQL statement using a tool such as TOAD then > I get a correct value for the point in the oracle column. > > INSERT INTO node (id, position) VALUES (53, > SDO_CS.TRANSFORM(SDO_GEOMETRY(2001, 26910, SDO_POINT_TYPE(489535.0, > 5457841.0, NULL), NULL, NULL), 4269)) > > Point geometry: > (2001, 4269, (-123.143865452971, 49.2732377100255, ), , ) > > If I execute the same statement using JDBC in a Statement or > PreparedStatement the Point in the oracle column has 0,0 for the > coordinates. > > Point: geometry > (2001, 4269, (0, 0, ), , ) > > In both cases the SQL is exactly the same. > > my JDBC code is > > String insertSql = "INSERT INTO node (id, position) VALUES (" + id > + ", SDO_CS.TRANSFORM(SDO_GEOMETRY(2001, " + geometrySrid ", > + SDO_POINT_TYPE(" + coordinate2d.x + ", " + coordinate2d.y ", NULL), > + NULL, NULL), " + srid + "))"; > Statement insertStatement = connection.createStatement(); try { > insertStatement.execute(insertSql); > } finally { > JdbcUtils.closeStatement(insertStatement); > connection.commit(); > } > > Any ideas why this is happening? > > I've tried to do the coordinate transformation in a separate call and > pass in the STRUCT returned from that, using JGeometry to create a > STRUCT for the value, using a WKT geometry and none of these approaches > seem to work > > ------------------------------------------------------------------------ > - > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel