SqlSupport is a helper module I wrote to make db queries easier, and I've been using it for years on my Windows 10 machine. connectpgdb initiates a connection and returns the handle. getsqlvalue returns a single value from a query that should just return one value.#!/usr/bin/perl -w use lib qw(/home/****/permodules); use SqlSupport; my $dbh = connectpgdb('****','****','****','Pg','localhost'); my $n = getsqlvalue($dbh,"select count(*) from blog"); print $n;
When I run the script it returns without any errors but doesn't print anything. When I run the query from the psql command line client, I get a value. When I run the same script remotely from my windows machine, it prints the same value as returned by the command line client. Just to be sure there's nothing odd going on with the library, I copied the connectpgdb and getsqlvalue subs into the script on the linux machine and it still prints nothing.
I'm kind of flummoxed here. I know the script works and the query produces a result. I don't get how it prints nothing yet there is no connection error or query error.
In reply to DBD::Pg no errors but empty result? by cormanaz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |