If you know the table names already, this Perl script will dump the tables
into CSV format for you.  From there you can build SQL*Loader scripts
to load the data.

For anyone wondering why I didn't just suggest using the Oracle utilities
for migrating from SQL Server to Oracle, it doesn't always work, 
especially
when the SQL Server database has not been managed properly.

Jared

------------

use DBI;

my $dbh =  DBI->connect("dbi:ADO:SERVER NAME HERE","sa",SA PASSWORD 
HERE');

die "could not connect to rsysweb\n" unless $dbh;

my @tables = qw{
        dtproperties EVENTS AdminLevel CATEGORIES CONTACTS ...
};

foreach my $table ( @tables ) {
        print "Table: $table\n";
        my $filename = lc($table) . '.dmp';
        open(FILE, ">$filename") || die "could not create $filename - 
$!\n";
        my $sql = "select * from $table";
        my $sth = $dbh->prepare($sql);
        $sth->execute;
        print FILE join('|', @{$sth->{NAME_uc}}), "\n";
        while ( my $ary = $sth->fetchrow_arrayref ) {
                print FILE '<<<' , join('|', @{$ary} ),">>>\n";
        }
 
        close FILE;
}

$dbh->disconnect;






"Ferry Situmorang" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
02/13/02 08:58 PM
Please respond to ORACLE-L

 
        To:     Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
        cc: 
        Subject:        Importing SQL 7.0 tables


I need to import into Oracle my SQL 7.0 tables.
How could I complete this?

Thanks,

Ferry Situmorang: 
Using Oracle 8.1.7 Designer 6i R4
PT Perkebunan Nusantara XIII (Persero)
Pontianak-Indonesia
http://www.ptpn13.com

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Ferry Situmorang
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to