Re: Class::DBI and DBD::ODBC

[prev] [thread] [next] [Date index for 2004/09/29]

From: Peter Speltz
Subject: Re: Class::DBI and DBD::ODBC
Date: 20:31 on 29 Sep 2004
YOu probably thought of this but my first thought is
to export the mdb access database to a text file and
with editor or a simple script delete the spaces in
the table name or replace them with _.  Then you could
import it back to mdp or whatever.  That would only
take 10 or 15 minutes probably but won't be fun.


--- Veljko Vidovic
<veljko.vidovic@xxxx.xxxxxxxxxx.xxx> wrote:

> Hi, all
> 
> I am trying to transfer mdb (access) data to oracle.
> So, I was thinking of using DBD::ODBC and
> DBD::Oracle
> together with CDBI.
> Problem is that table names in mdb are space
> separated, eg. "THIS IS TABLE
> NAME",
> so I am getting:
> DBD::ODBC::db prepare_cached failed:
> [Microsoft][ODBC Microsoft Access
> Driver]
> Syntax error in FROM clause. (SQL-42000)(DBD:
> st_prepare/SQLPrepare err=-1)
> [for Statement "SELECT ata FROM   ATA CODES AND
> DESCRIPTIONS"] at
> C:/Perl/site/lib/Ima/DBI.pm line 391.
> 
> Thanks in advance,
> Veljko
> 
> package ReoMDB::ReoDB;
> use strict;
> use warnings;
> use base 'Class::DBI';
> 
> my ($dsn, $username, $password) = getConfig();
> ReoMDB::ReoDB->set_db('Main',
>                              $dsn,
>                              $username,
>                              $password,
>                              { AutoCommit=>1 },
>                             );
> 
> sub getConfig {
>        return ('dbi:ODBC:REO_Back_End','', '');
> }
> 
> 1;
> 
> package ReoMDB::Ata;
> use strict;
> use base 'ReoMDB::ReoDB';
> 
> __PACKAGE__->table('ATA CODES AND DESCRIPTIONS',
> 'ATA CODES AND
> DESCRIPTIONS');
> __PACKAGE__->columns(All => ('ATA', 'ATA DESC'));
> 
> 1;
> 
> use strict;
> use ReoMDB::ReoDB;
> use ReoMDB::Ata;
> 
> my @objs = ReoMDB::Ata->retrieve_all;
> 
> 


=====
pjs


		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

Class::DBI::Loader can generate files?
Peter Speltz 17:06 on 29 Sep 2004

Class::DBI and DBD::ODBC
Veljko Vidovic 17:52 on 29 Sep 2004

Re: Class::DBI and DBD::ODBC
Peter Speltz 20:31 on 29 Sep 2004

Re: Class::DBI and DBD::ODBC
Rhesa Rozendaal 22:24 on 29 Sep 2004

Re: Class::DBI and DBD::ODBC
Veljko Vidovic 21:41 on 30 Sep 2004

Generated at 11:35 on 01 Dec 2004 by mariachi v0.52