From: | Nic Ferrier <nferrier(at)tapsellferrier(dot)co(dot)uk> |
---|---|
To: | Barry Lind <blind(at)xythos(dot)com> |
Cc: | snpe <snpe(at)snpe(dot)co(dot)yu>, pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: streaming result sets: progress |
Date: | 2002-11-14 19:31:21 |
Message-ID: | 87n0oclzhy.fsf@pooh-sticks-bridge.tapsellferrier.co.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
Barry Lind <blind(at)xythos(dot)com> writes:
> nferrier(at)tapsellferrier(dot)co(dot)uk wrote:
> > snpe <snpe(at)snpe(dot)co(dot)yu> writes:
> >
> > Yes. But the reason I send:
> >
> > DECLARE JDBC_CURS_1 CURSOR FOR select * from tab FETCH FORWARD 100 FROM JDBC_CURS_1;
> >
> > is because the SQL statement you supply is _supposed_ to end with a
> > ";". The code for the above is actually doing:
> >
> > DECLARE JDBC_CURS_1 CURSOR FOR $userquery FETCH FORWARD 100 FROM JDBC_CURS_1;
> >
> > where $userquery is what comes in from the client code, eg:
> >
> > Statement st = con.createStatement();
> > ResultSet rs = con.executeQuery("select * from tab;");
> >
> > then "select * from tab;" is inserted as $userquery. It must always
> > end with ";" because that's how PGSQL's normal query processing works.
> >
>
> The the ; is not required for the rest of the jdbc driver. In fact in
> other areas of the code (like server prepared statements, batch updates)
> the requirement is that the user supplied sql statement does *not* end
> in a ;.
>
> This is also consistent with other jdbc drivers. In fact oracle gives
> you an error if a sql statement ends with a ;.
Apologies to everyone paying attention to this thread... in my
experience postgres has always complained when I haven't supplied the
";".
I will investigate and fix the patch.
Nic
From | Date | Subject | |
---|---|---|---|
Next Message | David Hooker | 2002-11-14 19:42:00 | PostgreSQL/Oracle/MSSQL differences (was: streaming result sets: progress) |
Previous Message | Barry Lind | 2002-11-14 18:32:18 | Re: streaming result sets: progress |