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


In reply to Re: making a spinner by perlisfun
in thread making a spinner by archen

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.