From: Ken Youens-Clark Date: Thu, 6 Nov 2003 16:55:30 +0000 (+0000) Subject: Some of the same changes to Excel. X-Git-Tag: v0.04~11 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6808d3e9429cc49d520dff3d088e03b82c1a6efc;p=dbsrgits%2FSQL-Translator.git Some of the same changes to Excel. --- diff --git a/lib/SQL/Translator/Parser/xSV.pm b/lib/SQL/Translator/Parser/xSV.pm index d3d28a0..9bc4dcf 100644 --- a/lib/SQL/Translator/Parser/xSV.pm +++ b/lib/SQL/Translator/Parser/xSV.pm @@ -1,7 +1,7 @@ package SQL::Translator::Parser::xSV; # ------------------------------------------------------------------- -# $Id: xSV.pm,v 1.14 2003-11-05 22:26:02 kycl4rk Exp $ +# $Id: xSV.pm,v 1.15 2003-11-06 16:55:30 kycl4rk Exp $ # ------------------------------------------------------------------- # Copyright (C) 2003 Ken Y. Clark , # darren chamberlain @@ -68,7 +68,7 @@ C. use strict; use vars qw($VERSION @EXPORT); -$VERSION = sprintf "%d.%02d", q$Revision: 1.14 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.15 $ =~ /(\d+)\.(\d+)/; use Exporter; use Text::ParseWords qw(quotewords); @@ -165,12 +165,16 @@ sub parse { } for my $field ( keys %field_info ) { - my $size = $field_info{ $field }{'size'}; + my $size = $field_info{ $field }{'size'} || [ 1 ]; my $data_type = $field_info{ $field }{'char'} ? 'char' : $field_info{ $field }{'float'} ? 'float' : $field_info{ $field }{'integer'} ? 'integer' : 'char'; + if ( $data_type eq 'char' && scalar @$size == 2 ) { + $size = [ $size->[0] + $size->[1] ]; + } + my $field = $table->get_field( $field ); $field->size( $size ); $field->data_type( $data_type );