| Store | Cart

help dbd-anydata / dbi-dbd-sqlengine issue

From: John <Lis...@jspect.fastmail.fm>
Sun, 19 May 2013 14:03:58 +1000
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 would like advise on how to raise this with the appropriate 
developers/maintainers.

Have I included enough info here for the developer/maintainer to track 
the problem? If not, what else should I include?

I have provided my current perl 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

#[perl version]###########################
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)

The DBI-DBD-SqlEngine module concerned is version 0.06.

#[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
       lis...@jspect.fastmail.fm


_______________________________________________
Perl-Win32-Users mailing list
Perl...@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Recent Messages in this Thread
John May 19, 2013 04:03 am
Brian Raven May 20, 2013 10:00 am
Messages in this thread