I wrote a sample Perl program to remove data from a database table.
This is the code I wrote,
use DBI; my $dbh = DBI->connect("DBI:Pg:host=192.168.12.23;port=5432;", "adhi"); if ( $dbh ) { print "Connected successfully\n"; my $exe = $dbh->prepare("delete from perl_test.test"); my $res = $exe->execute(); if ( $res ) { print "deleted the table successfully of rows: $res\n"; } }
If I did the above, it should print a successful message, and then the number of lines deleted.
If the table was empty, it printed 0E0 instead of 0 . I don't know how it returns a value like this?
Can someone explain to me how it works?
source share