Search Postgresql Archives

Re: DBI && INSERT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 17 Feb 2020 16:49:27 +0100
Matthias Apitz <guru@xxxxxxxxxxx> 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






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux