Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Saturday, October 17, 2026

Diff for scripts/perl/oracle/oracledump.pl between version 1.8 and 1.9

version 1.8, 2004/01/23 13:54:52 version 1.9, 2004/01/23 14:09:08
Line 1 
Line 1 
 #!/usr/bin/perl  #!/usr/bin/perl
   
 # $Platon: scripts/perl/oracle/oracledump.pl,v 1.7 2004/01/22 22:01:37 nepto Exp $  # $Platon: scripts/perl/oracle/oracledump.pl,v 1.8 2004/01/23 13:54:52 nepto Exp $
   
 use strict;  use strict;
   
Line 369  foreach $table (@opt_tables)
Line 369  foreach $table (@opt_tables)
 {  {
     my @column_types;      my @column_types;
     my @row;      my @row;
           my $table_out;
   
           $table_out = $table;
           $table_out = lc $table_out if defined $opt_mysql_compliant_dump;
           $table     = uc $table;
   
   
     ## Print table structure      ## Print table structure
   
Line 380  foreach $table (@opt_tables)
Line 386  foreach $table (@opt_tables)
         print <<MARK;          print <<MARK;
   
 $CM  $CM
 $CM Table structure for table '$table'  $CM Table structure for table '$table_out'
 $CM  $CM
 MARK  MARK
         ## Print drop table if requested          ## Print drop table if requested
   
         if (defined $opt_add_drop_table)      if ( defined $opt_add_drop_table )
         {      {
             print <<MARK;          if ( defined $opt_mysql_compliant_dump ) {
 DROP TABLE $table;              print <<MARK;
   DROP TABLE IF EXISTS $table_out;
 MARK  MARK
         }          } else {
               print <<MARK;
   DROP TABLE $table_out;
   MARK
           }
       }
   
         ## Print create table          ## Print create table
   
         print <<MARK;          print <<MARK;
 CREATE TABLE $table (  CREATE TABLE $table_out (
 MARK  MARK
   
     }      }
Line 412  MARK
Line 424  MARK
                             FROM user_tab_columns                              FROM user_tab_columns
                            WHERE table_name = ?");                             WHERE table_name = ?");
   
     $sth->execute(uc($table)) || die $DBI::errstr;      $sth->execute($table) || die $DBI::errstr;
   
     my $c = 0;      my $c = 0;
     while (@row = $sth->fetchrow_array())      while (@row = $sth->fetchrow_array())
Line 485  MARK
Line 497  MARK
         print <<MARK;          print <<MARK;
   
 $CM  $CM
 $CM Dumping data for table '$table'  $CM Dumping data for table '$table_out'
 @{[ (scalar @opt_where > 0)  @{[ (scalar @opt_where > 0)
     ? "$CM WHERE:  " . join(' AND ', @opt_where) . "\n$CM\n"      ? "$CM WHERE:  " . join(' AND ', @opt_where) . "\n$CM\n"
     : "$CM\n" ]}      : "$CM\n" ]}
Line 509  MARK
Line 521  MARK
                                 FROM user_tab_columns                                  FROM user_tab_columns
                                WHERE table_name = ?");                                 WHERE table_name = ?");
   
         $sth->execute(uc($table)) || die $DBI::errstr;          $sth->execute($table) || die $DBI::errstr;
   
         while (@row = $sth->fetchrow_array())          while (@row = $sth->fetchrow_array())
         {          {
Line 532  MARK
Line 544  MARK
         while (@row = $sth->fetchrow_array())          while (@row = $sth->fetchrow_array())
         {          {
             print <<MARK;              print <<MARK;
 INSERT INTO $table (@{[ join(', ', @column_names) ]})  INSERT INTO $table_out (@{[ join(', ', @column_names) ]})
      VALUES (@{[ join(',', map(escape_data($column_types[$_], $row[$_]), 0..$#column_names)) ]});       VALUES (@{[ join(',', map(escape_data($column_types[$_], $row[$_]), 0..$#column_names)) ]});
 MARK  MARK
         }          }

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top