Re: error when using move, any suggestions?

From: Dave Cramer <Dave(at)micro-automation(dot)net>
To: Noel Faux <Noel(dot)Faux(at)med(dot)monash(dot)edu(dot)au>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: error when using move, any suggestions?
Date: 2002-12-19 03:17:46
Message-ID: 1040267865.17038.347.camel@inspiron.cramers
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

Noel,

Well, your sql in the driver was fetch forward 2000 in test, does that
work?

It shouldn't be a driver error, the driver just passes sql through.

Dave
On Wed, 2002-12-18 at 20:51, Noel Faux wrote:
> Hi Dave,
>
> It works fine in psql:
> blast=# begin;
> BEGIN
> blast=# declare test cursor for select id from region where
> protein_database = 1;
> SELECT
> blast=# move forward 99 in test;
> MOVE
> blast=# fetch forward 2 in test;
> id
> --------
> 486175
> 481881
> (2 rows)
>
> Is this a driver error?
> Thanks for your reply
> Cheers
> Noel
>
> Noel Faux
> Department of Biochemistry and Molecluar Biology
> Monash University
> Clayton 3168
> Victoria
> Australia
>
> ----- Original Message -----
> From: Dave Cramer <Dave(at)micro-automation(dot)net>
> Date: Wednesday, December 18, 2002 9:43 pm
> Subject: Re: [JDBC] error when using move, any suggestions?
>
> > Noel,
> >
> > What do you get from the server when you try the same commands in
> > psql?
> > I just tried it and it works fine?
> >
> > test=# begin;
> > BEGIN
> > test=# declare test cursor for select id from address ;
> > DECLARE CURSOR
> > test=# move forward 99 in test;
> > MOVE 1
> > test=# fetch forward 2000 in test;
> > id
> > ----
> > (0 rows)
> >
> > Dave
> >
> > On Wed, 2002-12-18 at 00:30, Noel wrote:
> > > Hi all,
> > > I'm new to postgreSQL.
> > > I wrote a little test program to learn how to use fetch and move
> > in
> > > postgreSQL.
> > >
> > > import blastDb.*;
> > > import java.sql.*;
> > > import java.io.*;
> > > import java.util.*;
> > > import java.lang.*;
> > >
> > > public class TestFetchSize
> > > {
> > > public static void main(String[] args)
> > > {
> > > try
> > > {
> > > BlastDB db = new BlastDB();
> > >
> > > Statement stmt =db.connection.createStatement();
> > > int counte = 0;
> > > stmt.execute("begin work");
> > > stmt.execute("declare test cursor for select id
> > from region where
> > > protein_database = 1");
> > > ResultSet rs;
> > > stmt.execute("move forward 99 in test");
> > > while(stmt.execute("fetch forward 2000 in test"))
> > > {
> > > rs = stmt.getResultSet();
> > > if (rs.next())
> > > {
> > > ++counte;
> > > while (rs.next())
> > > {
> > > ++counte;
> > > }
> > > }
> > > else
> > > break;
> > >
> > > }
> > > System.out.println(counte);
> > > stmt.execute("end work");
> > > }
> > > catch (Exception e)
> > > {
> > > e.printStackTrace();
> > > System.out.println(e.getMessage());
> > > }
> > > }
> > > }
> > >
> > > It compiles ok, however when run i get this message:
> > > Unable to fathom update count MOVE
> > > at
> > >
> >
> org.postgresql.core.QueryExecutor.receiveCommandStatus(QueryExecutor.java:182)>
> at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:80)
> > > at org.postgresql.Connection.ExecSQL(Connection.java:398)
> > > at org.postgresql.jdbc2.Statement.execute(Statement.java:130)
> > > at TestFetchSize.main(TestFetchSize.java:25)
> > > Unable to fathom update count MOVE
> > >
> > > I've search the web and the archives, and the only thing close
> > is the
> > > thread about a sim problem with INSERT:
> > > "Basically the driver was storing the oid in an int. The value
> > you have
> > > is overflowing the value allowed for a signed int.
> > >
> > > thanks,
> > > --Barry "
> > >
> > > Is this the same problem ?
> > > Using 7.4 divers with JDBC3 support.
> > >
> > > Cheers
> > > Noel
> > >
> > >
> > > ---------------------------(end of broadcast)--------------------
> > -------
> > > TIP 4: Don't 'kill -9' the postmaster
> > --
> > Dave Cramer <Dave(at)micro-automation(dot)net>
> >
> >
> > ---------------------------(end of broadcast)----------------------
> > -----
> > TIP 2: you can get off all lists at once with the unregister command
> > (send "unregister YourEmailAddressHere" to
> > majordomo(at)postgresql(dot)org)
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
--
Dave Cramer <Dave(at)micro-automation(dot)net>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2002-12-19 03:21:03 Re: 7.3.1 stamped
Previous Message Joe Conway 2002-12-19 02:53:42 Re: [Fwd: SETOF input parameters (was Re: [HACKERS] proposal:

Browse pgsql-jdbc by date

  From Date Subject
Next Message Noel 2002-12-19 04:51:36 Re: error when using move, any suggestions?
Previous Message Noel Faux 2002-12-19 01:51:06 Re: error when using move, any suggestions?