PerlIsFun
Long time ago, i wrote something to transfer database table from Informix to Oracle, i used a spinner. It may help you.
sub transfer_Data {
my $stn = shift;
my $dtn = shift;
$| = 1;
my @spinner = ('|','/','-','\\');
my $ifmx_stmt = "select count(*) from $stn" ;
my $sth_ifmx = $db_ifmx->prepare($ifmx_stmt);
$sth_ifmx->execute;
my $count = $sth_ifmx->fetchrow();
print "Total record number: $count \n\n";
$ifmx_stmt = "select * from $stn" ;
$sth_ifmx = $db_ifmx->prepare($ifmx_stmt);
$sth_ifmx->execute;
my $rn = 1;
while ( my @row = $sth_ifmx->fetchrow_array ) {
my $ds = '';
for ( my $i = 0; $i <@row; $i++ ) {
my $nd = trim($row[$i]);
$nd =~ s/'/''/g;
my $check = match_DateList($i);
if ( $check ) {
$ds .= "to_date('$nd', 'MM/DD/YYYY'),";
} else {
$ds .= "'$nd',";
}
}
$ds =~ s/,$/)/;
$ds =~ s/^/(/;
my $orac_stmt = "insert into $dtn values " . $ds ;
my $sth_orac = $db_orac->do($orac_stmt);
print "Record: $rn $spinner[$rn%4]\r";
$rn++;
}
$sth_ifmx->finish;
print "\nData Transfer is complete \n\n";
$| = 0;
}
It may be too much. That is what i have.
Edit by tye
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|