[EMAIL PROTECTED] wrote:

I am storing dates in the form "20030218" (as it seems that there is no
DATE format for Tables).  If I do "SELECT * FROM table ORDER BY datefield",
my program just hangs

I haven't heard any reports of this kind of behaviour and it sorts fine on numeric fields for me. Please run the following script and send me the results:

#!/usr/local/bin/perl -w
use strict;
use DBI;
# This part is only for testing, isn't usually needed
use SQL::Statement;
use DBD::CSV;
print "$^O\n";
print "$DBI::VERSION\n";
print "$DBD::CSV::VERSION\n";
print "$SQL::Statement::VERSION\n";
#
my $dbh = DBI->connect('dbi:CSV(RaiseError=>1):');
my $table = 'tmp';
unlink $table if -e $table;
$dbh->do("CREATE TABLE $table (id INTEGER,phrase CHAR(40))");
$dbh->do("INSERT INTO $table VALUES (3,'Ooops')");
$dbh->do("INSERT INTO $table VALUES (2,'JAPH')");
$dbh->do("INSERT INTO $table VALUES (1,'TIMTOWTDI')");
my $sth=$dbh->prepare("SELECT * FROM $table ORDER BY id");
$sth->execute();
while (my $r=$sth->fetch) {
print "@$r\n";
}
__END__

--
Jeff


Reply via email to