I have this problem where I think DBD::Oracle truncated tailing whitespace
from some input so I searched the archives and I ran accross this thread,
where someone states that DBD::Oracle trims trailing whitespace by default.
http://www.xray.mpe.mpg.de/cgi-bin/w3glimpse2html/dbi/2001-06/msg00451.html?
71#mfs
It was the only refernce I could find but if it is true then I suspect this
is a DBD::Sybase and DBD::Oracle inconsistency in behaviour because I don't
think DBD::Sybase is doing it that way. I wrote a test script (below) but
it seems to show DBD::Oracle as not trimming whitespace.
Does anyone know what the expected behaviour is?
#!/usr/local/bin/perl
######### INCLUDES ###########
use strict;
use DBI;
############################ B E G I N M A I N
############################
# connect to database
my $hDB = DBI->connect( "dbi:Oracle:img.llnl.gov", 'scott', 'tiger', {
RaiseError => 1, PrintError => 1, AutoCommit => 0 } ) or die $DBI::errstr;
# create table t
# ( t_id int not null,
# t varchar(255) not null )
my $id = 1;
while( <> ) {
my $insval = $_;
$hDB->do( "insert into t values ( ?, ? )", {}, ( $id, $_ ) );
my @a = $hDB->selectrow_array( "select t_id, t from t where t_id = ?", {},
$id );
print "insert differs from select for t_id: '#$insval#' inserted, '#$a[1]#
read'" unless $a[1] == $insval;
$id++;
} # end
############################## E N D M A I N
##############################
1; # Ancient Druid Custom