Re: DBI::Anydata - Can't call method "func"
- From: boyd <tbmoore9@xxxxxxxxxxx>
- Date: Wed, 15 Nov 2006 23:13:31 GMT
I'm not sure about your questions. I created a similar script, but
without the evals, and it worked ( after I found out that the module
"AnyData" was missing, even though DBD::AnyData was installed on my
system! ). My script is:
#!/usr/bin/perl
use strict;
use warnings;
use Carp;
$|++;
use DBI;
my $dbh=DBI->connect('dbi:AnyData(RaiseError=>1):');
$dbh->func( 'test', 'ARRAY',
[
['id','phrase'],
[1,'foo'],
[2,'bar']
],
'ad_import')
;
my $ref = $dbh->selectcol_arrayref( qq{SELECT phrase FROM test WHERE id
= 2} );
for my $value(@{$ref}) {
print "value = $value\n";
}
Hope this helps.
Boyd
In article <1163452176.324225.227220@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"jpolache" <jonpol@xxxxxxxxxxxxx> wrote:
Code is more or less right out of the POD. Running ActivePerl on an XP.
system. Tried using [<DATA>] and __END__ with the same result.
use DBI;
eval {
my $dbh=DBI->connect('dbi:AnyData(RaiseError=>1):')
};
1;
print "line 7 value of \@: $@\n";
eval {
$dbh->func( 'test', 'ARRAY',
[
['id','phrase'],
[1,'foo'],
[2,'bar']
],
'ad_import')
};
1;
print "line 19 value of \@: $@\n";
eval {
print $dbh->selectcol_arrayref(qq{
SELECT phrase FROM test WHERE id = 2
})->[0]
};
1;
print "line 28 value of \@: $@\n";
1;
**************************************
line 7 value of @:
line 19 value of @: Can't call method "func" on an undefined value at
C:\scripts\printers\rt.pl line 9.
line 28 value of @: Can't call method "selectcol_arrayref" on an
undefined value at C:\scripts\printers\rt.pl line 22.
- References:
- DBI::Anydata - Can't call method "func"
- From: jpolache
- DBI::Anydata - Can't call method "func"
- Prev by Date: Re: Possible Problem with bind_param
- Next by Date: DBD Oracle module
- Previous by thread: DBI::Anydata - Can't call method "func"
- Next by thread: DBD Oracle module
- Index(es):
Relevant Pages
|