Re: DBI && INSERT

Поиск
Список
Период
Сортировка
От Gianni Ceccarelli
Тема Re: DBI && INSERT
Дата
Msg-id 20200217161540.1a8d02e5@exelion
обсуждение исходный текст
Ответ на DBI && INSERT  (Matthias Apitz <guru@unixarea.de>)
Список pgsql-general
On Mon, 17 Feb 2020 16:49:27 +0100
Matthias Apitz <guru@unixarea.de> wrote:
> I spend today some hours to nail down and insert problem into our
> database with DBI like:
> 
>    my $rc = $my_dbh->do($my_sqlstatement);
> 
> which returns 1 in $rc (which the following flow in our script took
> as an error).

The DBI docs say::

  $rows = $dbh->do($statement) or die $dbh->errstr;

so when ``do`` returns 1, it means it worked, not that it failed.

In particular:

    Returns the number of rows affected or "undef" on error. A return
    value of "-1" means the number of rows is not known, not
    applicable, or not available.

-- 
    Dakkar - <Mobilis in mobile>
    GPG public key fingerprint = A071 E618 DD2C 5901 9574
                                 6FE2 40EA 9883 7519 3F88
                        key id = 0x75193F88




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

Предыдущее
От: Matthias Apitz
Дата:
Сообщение: DBI && INSERT
Следующее
От: Jeremy Schneider
Дата:
Сообщение: Re: PL/pgSQL question about EXCEPTION clause & corrupt records