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

Diff for scripts/perl/oracle/oracledump.pl between version 1.19 and 1.20

version 1.19, 2007/03/27 18:10:07 version 1.20, 2008/08/20 13:44:51
Line 1 
Line 1 
 #!/usr/bin/perl  #!/usr/bin/perl
   
 # $Platon: scripts/perl/oracle/oracledump.pl,v 1.18 2007-03-27 16:57:32 nepto Exp $  # $Platon: scripts/perl/oracle/oracledump.pl,v 1.19 2007-03-27 18:10:07 nepto Exp $
   
 use strict;  use strict;
   
Line 323  if ($table eq "V\$INSTANCE")
Line 323  if ($table eq "V\$INSTANCE")
   
     $sth = $dbh->prepare("SELECT HOST_NAME      $sth = $dbh->prepare("SELECT HOST_NAME
                             FROM V\$INSTANCE");                              FROM V\$INSTANCE");
     $sth->execute() || die $DBI::errstr;          if (defined $sth) {
     ($ORA_HOSTNAME) = $sth->fetchrow_array();                  $sth->execute() || die $DBI::errstr;
     $sth->finish();          ($ORA_HOSTNAME) = $sth->fetchrow_array();
           $sth->finish();
           }
 }  }
 else  
   if (not defined $ORA_HOSTNAME)
 {  {
     $ORA_HOSTNAME = '<V$INSTANCE.HOST_NAME inaccessible>';      $ORA_HOSTNAME = '<V$INSTANCE.HOST_NAME inaccessible>';
 }  }
Line 582  MARK
Line 585  MARK
   
         ## Query for data then output SQL          ## Query for data then output SQL
   
     $query = sprintf( 'SELECT %s FROM %s',          $query = sprintf( 'SELECT %s FROM %s',
         join ( ',', @column_names ), $table );                  join ( ',', @column_names ), defined $opt_owner ? "$opt_owner.$table" : $table );
     $query .= ' WHERE ' . join ( ' AND ', @opt_where ) if ( scalar @opt_where > 0 );      $query .= ' WHERE ' . join ( ' AND ', @opt_where ) if ( scalar @opt_where > 0 );
   
         $sth = $dbh->prepare($query);          $sth = $dbh->prepare($query);
Line 640  sub escape_data($$)
Line 643  sub escape_data($$)
   
     if ( $type eq 'NUMBER' ) {      if ( $type eq 'NUMBER' ) {
         return length $value > 0 ? $value : "''";          return length $value > 0 ? $value : "''";
     } elsif ( $type eq 'VARCHAR2' or $type eq 'CHAR' or $type eq 'CLOB') {      } elsif ( $type eq 'NVARCHAR2' or $type eq 'VARCHAR2' or $type eq 'CHAR' or $type eq 'CLOB') {
         if ( !defined $value ) {          if ( !defined $value ) {
             return "NULL";              return "NULL";
         } else {          } else {
               $value =~ s/\\/\\\\/g;
             $value =~ s/'/\\'/g;              $value =~ s/'/\\'/g;
             return "'$value'";              return "'$value'";
         }          }

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

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