Hi!

I have started a little project (GLPed) for the purpose to migrate 
Datatables and users from one DBI::Database into an other one.
This time it's designed to Read from an Adabas D server and write to a 
SapDB server.

It should work online and should be able also to work with interim 
gz-compressed files also.
At this point the dumping out the users of the source database to a 
user.sql file works.

This features are on the Roadmap:
- online table copy from source to destination RDBMS
- gz-compressed /uncompressed Table export to file, using a file 
structure which conatins the SQL-Structure to re-create the table also, 
the dataformat should be portable, mail-able encoded.
- loading those files into each wanted RDBMS, even in batch run

I got struck with a little problem on dumping out a Table to a file.
For this point I would be happy for any hint.

My work reached a point, were I could need some help:
a) for a actual error, see below
b) anyone interested is invited to contribute and use this tool.
c) message translation from german into english
d) providing more DBI:: aware Databases for import-export

I setup a anonymous CVS Repository for this little project, see here 
more: http://sapdb.automatix.de
The whole script is in
cvs -z3 -d :pserver:[EMAIL PROTECTED]/home/fileserver/cvs lo
Password: cvs
cvs -z3 -d :pserver:[EMAIL PROTECTED]/home/fileserver/cvs co 
dbi-migration

Tarballs will be released, if somthing really works.


Feel free to use and contribute.
Mail me to get write-access to this Repository.

This is my actual problem in Perl-Source:
Before this there were successfully selected and worked out the 
tablestructure using the "COLUMNS" table. I did the same procedure, using 
an other $query String.
The error is $sth->rows contains very time the same wron #count for 
tatarows, "-1". although ther are rows. This sniplet does not select and 
receive the really existing data rows. The source DBD Driver is 
DBI::Adabas.

Any ideas ? A hint to me to make this better working ?
----------x---------------x----------------x----------------x-----------x-- 
   # Data select

    $query="select * from $tabelle";
    print "$query\n";
    $sth=$db->prepare($query);
    $sth->execute()
        or return;

    my $zeilen=$sth->rows;
    if($zeilen <=0)
        {
            print "$tabelle contains no ($zeilen) Data Rows.\n";
            if(defined($compressed))
            {
                $gz->gzclose;
                return;
            }
            else
            {
                close (OUT);
                return;
            }
        }
    else
    {
        print "$tabelle enth�lt $zeilen\n";
    }

    my $datastr="";
    while(@dr = $sth->fetchrow_array)
    {
        foreach(@dr)
        {

----------x---------------x----------------x----------------x-----------x--

TIA 
Yours,
        J. Sauer

-- 
J�rgen Sauer - AutomatiX GmbH, +49-4209-4699, [EMAIL PROTECTED] **
** Das Linux Systemhaus - Service - Support - Server - L�sungen **
http://www.automatix.de to Mail me: remove: -not-for-spawm-     **

Reply via email to