On Wed, 12 Mar 2003, Jay G. Scott wrote:
> Greetings,
>
> My code follows. Should be enough for some bright person to figure
> out what I'm doing wrong. To me, it all looks fine.
>
>
> #!/usr/bin/perl
>
> use DBI;
> use Pg;
You don't need Pg methinks.
> use Getopt::Std;
>
> $DBSERVER="tor
]
Sent: Wednesday, March 12, 2003 4:16 PM
To: Jay G. Scott
Cc: [EMAIL PROTECTED]
Subject: Re: newbie can't see what he's doing wrong.
I suspect it's in the way you're setting up your query, but you didn't
show that part? Try this:
my $sql = 'SELECT m_id FROM machines
:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 4:16 PM
To: Jay G. Scott
Cc: [EMAIL PROTECTED]
Subject: Re: newbie can't see what he's doing wrong.
I suspect it's in the way you're setting up your query, but you didn't
show that part? Try this:
my $sql = 'SELECT m_i
I suspect it's in the way you're setting up your query, but you didn't
show that part? Try this:
my $sql = 'SELECT m_id FROM machines WHERE hostname = ?';
my $host = 'torn.arlut.utexas.edu';
my $sth = $dbh->prepare($sql);
$sth->execute($host);
while (my $m_id = $sth->fetchrow_array()) {
For one:
$command = "SELECT m_id FROM machines WHERE hostname = '$hostname';";
remove the ; within the sql string -- its not needed...
i.e. '$hostname'; <---
-Joe
--- "Jay G. Scott" <[EMAIL PROTECTED]> wrote:
>
> Greetings,
>
> My code follows. Should be enough for some bright person to fig
Greetings,
My code follows. Should be enough for some bright person to figure
out what I'm doing wrong. To me, it all looks fine.
#!/usr/bin/perl
use DBI;
use Pg;
use Getopt::Std;
$DBSERVER="torn.arlut.utexas.edu";
$USERNAME="postgres";
$PASSWORD="";
$dbh = DBI->connect("DBI:PgPP:database=t