Re: Class::DBI and DBD::ODBC
[prev]
[thread]
[next]
[Date index for 2004/09/29]
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