Hi.
I am using Perl 5.8.8 on SunOS pnc 5.8 with Informix (Server Version
9.30) and DBI 1.51 and DBD::Informix 2005.2.
I try to copy a list of tables using DBI. I have found that a certain
column declared as varchar(64) is copied incorrectly when it contains an
empty string. The value in the target location is a string containing
one space instead of being empty.
Here is a code fragment copied from the actual script:
foreach my $tb ( @$table_list )
{
my ( $sel ) = $from_dbh->prepare( "SELECT * FROM $tb" );
$sel->execute();
my ( $cols, $val_str ) = ( $sel->{NUM_OF_FIELDS}, "()" );
$val_str = "(" . ("?," x ($cols-1)) . "?)" if ( $cols>0 );
my ( $ins ) = $to_dbh->prepare( "INSERT INTO $tb VALUES" . $val_str
);
my ( $fetch_tuple_sub ) = sub { $sel->fetchrow_arrayref };
my @tuple_status;
my ( $rc ) = $ins->execute_for_fetch( $fetch_tuple_sub,
[EMAIL PROTECTED] );
my ( @errors ) = grep { ref $_ } @tuple_status;
$sel->finish();
$ins->finish();
}
Is this a known bug? Is there a way I can get this code to faithfully
reproduce the data including blank strings of type varchar(64)?
-Will
- - - - - Appended by Scientific Atlanta, a Cisco company - - - - -
This e-mail and any attachments may contain information which is confidential,
proprietary, privileged or otherwise protected by law. The information is solely
intended for the named addressee (or a person responsible for delivering it to
the addressee). If you are not the intended recipient of this message, you are
not authorized to read, print, retain, copy or disseminate this message or any
part of it. If you have received this e-mail in error, please notify the sender
immediately by return e-mail and delete it from your computer.