Re: &main::execute undefined?

From: dev(at)archonet(dot)com
To: "Andrew Magnus" <xanadian99(at)yahoo(dot)com>
Cc: "PostgreSQL" <pgsql-general(at)postgresql(dot)org>
Subject: Re: &main::execute undefined?
Date: 2002-11-21 19:35:41
Message-ID: 49201.192.168.1.32.1037907341.squirrel@mainbox.archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> Thanks, but it still doesn't work. :-(
>
> For everyone else, the error I'm getting is:
>
> Undefined subroutine &main::execute called at ./test.pl line 10.
>
> where line 10 is:
>
> $statementH = execute() || warn $statementH->errstr ;

Read Oliver's message again. The execute() is a method not a function in
main's namespace.

$statementH->execute() is the way to call it. Read the DBI documentation
for examples.

- Richard Huxton

>
> Oliver Elphick <olly(at)lfix(dot)co(dot)uk> wrote:On Thu, 2002-11-21 at 05:37,
> Andrew Magnus wrote:
>>
>> Ok, I'm running Postgres and RH8 right out-of-the-box. DBD::Pg is
> installed, and I'm using Perl 5.8 -- all right out-of-the-box. When my
> ...
>> Undefined subroutine &main::execute called at ./test.pl line 10.
> ...
>> ========
>>
>> #! /usr/bin/perl -w
>>
>> use DBI ;
>>
>>
>> $dbH =
>> (DBI->connect("DBI:Pg:dbname=lanparty-reservations","andrew","shrp1234"))
>> ;
>> $sql = "select c.relname as table from pg_class c where c.relkind = 'r'
>> and c.relname !~ '^pga_' and c.relname !~ '^pg_'" ;
>>
>> $statementH = $dbH->prepare($sql) ;
>> $statementH = execute() || warn $statementH->errstr ;
>
> $statementH->execute() || warn $statementH->errstr ;
> $relname = $statementH->fetchrow_array();
> $statementH->finish();
>
> --
> Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk

In response to

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2002-11-21 20:09:50 Re: [HACKERS] [GENERAL] Bug with sequence
Previous Message Tom Lane 2002-11-21 19:30:14 Re: [HACKERS] [GENERAL] Bug with sequence