See if you can solve this problem..

See if you can solve this problem..

Post by Wojciech T. Gromczynsk » Thu, 06 Apr 2000 04:00:00

I posted description of my question with the code on the web:

1. Problem solved, yet another problem

Hello again,

your advises really did help me, thanks to all. But now there is another

We tried to implement an "Object in area"- Range Query with the help of
the functions of the DB2 spatial extender. To get a better performance,
we decided to do these queries as prepared statements. But if we execute
our queries we get the following error: [IBM][JDBC-Treiber] CLI0612E  Ungltige
Parameterazahl. SQLSTATE=S1093

Our prepared statement goes like this:

Connection con;

objInArea = con.prepareStatement("select oid from HAESSLER.LINFO where
      "CAST(? AS double) CAST(? AS double),"+
      "CAST(? AS double) CAST(? AS double),"+
      "CAST(? AS double) CAST(? AS double),"+
      "CAST(? AS double) CAST(? AS double),"+
      "CAST(? AS double) CAST(? AS double)))',"+
      "db2gse.coordref()..srid(50)) , p) = 1");

These are 10 parameter markers in total.

Our prepared statement objInArea is executed with the following lines of

        objInArea.setDouble(1, nowe.getX());
        objInArea.setDouble(2, nowe.getY());
        objInArea.setDouble(3, noes.getX());
        objInArea.setDouble(4, noes.getY());
        objInArea.setDouble(5, soes.getX());
        objInArea.setDouble(6, soes.getY());
        objInArea.setDouble(7, sowe.getX());
        objInArea.setDouble(8, sowe.getY());
        objInArea.setDouble(9, nowe.getX());
        objInArea.setDouble(10, nowe.getY());

        ResultSet rs = objInArea.executeQuery();

          while ( {
             ObjectId oid = ObjectId.valueOf(rs.getString(1));
          return vec;

(As you may have noticed this method returns the Ids of all Points that
are residing in a rectangle in a vector).
To fit on the prepared statement, 10 values for the parameter markers of
the objInArea prepared statement are given.

So we wonder, what causes the error given above?

Many thanks in advance and many greets,


2. DYNAMICS'97 Call for Participation

3. bcp canned app


5. Cans access2.0 engine access btrieve files?

6. Need help designing database

7. Anyone know of some canned (cheap or free) DB performance testing software

8. Access ADP and SS7: Identical tables, db owner role, can insert on one, not other.

9. Canned PARADOX scripts?

10. canned code to get db on web quickly via perl or

11. Switching from inhouse to canned package.

12. MDX : Canned Report or OLAP

13. if you will promise Allahdad's swamp against cans, it will angrily depart the unit