Subject: | dbd-anydata / dbi-dbd-sqlengine issue |
Date: | Tue, 21 May 2013 09:41:30 +1000 |
To: | bug-DBD-AnyData [...] rt.cpan.org |
From: | John McMahon <john [...] jspect.fastmail.fm> |
Hi
Several years ago I dabbled with DBD::AnyData to read and merge a
variety of csv data files. Recently I updated my DBI module to version
1.625 (and yesterday to 1.627). Since updating DBI my program has failed
with an error message similar to that below (I have included a test
script below that produces the error message).
I have provided my current software version info below.
I also have an older perl installation (v5.10) on my computer with DBI
v1.616 and DBI-DBD-SqlEngine v0.03 that do not fail as reported here.
Thanks
John
#[version]###########################
Windows Version:
Microsoft Windows XP [Version 5.1.2600]
I am currently using ActiveState ActivePerl V5.14.
12:26>perl -v
This is perl 5, version 14, subversion 2 (v5.14.2) built for
MSWin32-x86-multi-thread (with 1 registered patch, see perl -V for more
detail)
Modules:
DBI version 1.627
DBI-DBD-SqlEngine version 0.06
SQL-Statement version 1.402
AnyData version 0.11
DBD-AnyData version 0.110
#[/version]###########################
#[err msg]#################################
DBD::AnyData::db do failed:
Execution ERROR: Can't call method "complete_table_name" on an undefined
value at
C:/bin/Perl/Perl514/site/lib/DBI/DBD/SqlEngine.pm line 1503.
called from tst_mkAP.pl at 10.
at C:/bin/Perl/Perl514/site/lib/DBI/DBD/SqlEngine.pm line 1239
[for Statement "CREATE TABLE AP_mem (
date_index INTEGER,
amount VARCHAR(15),
acc1 VARCHAR(8),
acc2 VARCHAR(8),
description VARCHAR(30),
voucher VARCHAR(5),
costctr VARCHAR(5),
date VARCHAR(12)
)"] at tst_mkAP.pl line 10.
#[/err msg]#################################
#[test script]#########################
#! perl -w
use strict;
use warnings;
use DBI;
# define transient storage table
sub mk_APmem {
my $dbh = shift @_;
$dbh->do(
qq{CREATE TABLE AP_mem (
date_index INTEGER,
amount VARCHAR(15),
acc1 VARCHAR(8),
acc2 VARCHAR(8),
description VARCHAR(30),
voucher VARCHAR(5),
costctr VARCHAR(5),
date VARCHAR(12)
)}
);
my $insert = qq{
INSERT INTO AP_mem
(date_index, amount, acc1, acc2, description, voucher,
costctr, date) VALUES
( ?, ?, ?, ?, ?, ?,
?, ?)
};
# and return insert statement
return $insert;
}
my $dbh = DBI->connect('dbi:AnyData(RaiseError=>1):');
my $flags = {
col_names => 'Date,Description,AccNum,Debit,Credit'
};
my $file = "C:\\Documents and Settings\\John\\My
Documents\\dnload\\10457109_20130514.dat";
# my ($file, $flags, $dbh) = @_;
# define data source
# $dbh->func('CRU_in', 'CSV', $file, $flags, 'ad_catalog');
$dbh->func('CRU_in', 'Pipe', $file, $flags, 'ad_catalog');
# define transient storage table and return insert SQL Statement
my $putAP = mk_APmem($dbh);
print "$putAP\n";
#[/test script]#########################
--
Regards
John McMahon
john@jspect.fastmail.com.au
04 2933 4203