Re: Moving from PHP to Java: A result was returned when none was expected.

Поиск
Список
Период
Сортировка
От Jan de Visser
Тема Re: Moving from PHP to Java: A result was returned when none was expected.
Дата
Msg-id 1481634.LjI3kEln4R@coyote
обсуждение исходный текст
Ответ на Re: Moving from PHP to Java: A result was returned when none was expected.  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: Moving from PHP to Java: A result was returned when none was expected.  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
On Wednesday, June 15, 2016 10:43:13 AM EDT David G. Johnston wrote:
> On Wed, Jun 15, 2016 at 10:30 AM, Jan de Visser <jan@de-visser.net> wrote:
> > Point is that you're doing a SELECT. A SELECT returns a result, which can
> > be
> > empty. I would use executeQuery and ignore the result.
> >
> > There is a bit of a mismatch between the JDBC stored procedure model and
> > the
> > pgsql function model, because pgsql doesn't have true stored procedures.
>
> Can you point to docs, JDBC and/or PG, that describe what it means to
> "RETURN void"?
>
> At a high-level SQL returns SETs and the empty set is a valid SET.  I take
> it from your comment that JDBC considers the empty set "a result", whose
> record count is zero.

Hrm...

jan=# create or replace function foo() returns void as $$
begin
raise notice 'foo() called';
end
$$ language plpgsql;
CREATE FUNCTION
jan=# select foo();
NOTICE:  foo() called
 foo
-----

(1 row)

So there's a row. Don't know what that row would contain, and how it would map
to JDBC.



В списке pgsql-general по дате отправления:

Предыдущее
От: Jan de Visser
Дата:
Сообщение: Re: Moving from PHP to Java: A result was returned when none was expected.
Следующее
От: Durgamahesh Manne
Дата:
Сообщение: Fwd: regarding schema only migration from sqlserver to postgres with runmtk.sh