Thread Perl Bug? (6 answers)
Opened by Kuerbis at 2014-06-04 16:08

Kuerbis
 2014-06-04 19:27
#175913 #175913
User since
2011-03-20
938 Artikel
BenutzerIn
[default_avatar]
Wenn ich die unten erzeugte Tabelle mit db-browser (CPAN:App::DBBrowser) mit

Code: (dl )
1
2
3
SELECT Rating, AVG(Downloads)
FROM Test_Table
GROUP BY Rating


abfrage, bekomme ich diese Fehlermeldung.

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env perl
use warnings;
use strict;
use 5.10.1;
use DBI;

my $db = 'TestDatabase';
my $dbh = DBI->connect( "dbi:SQLite:dbname=$db", "", "", { RaiseError => 1, PrintError => 0 } ) or die DBI->errstr;
my $table = 'Test_Table';
$dbh->do( "DROP TABLE IF EXISTS $table" );
$dbh->do( "CREATE TABLE $table ( Id INTEGER PRIMARY KEY, Rating TEXT, Downloads INTEGER )" );
my $sth = $dbh->prepare( "INSERT INTO $table ( Id, Rating, Downloads ) VALUES ( ?, ?, ? )" );

$sth->execute( undef, "2.0", 7449 );
$sth->execute( undef, "2.7", 7048 );
$sth->execute( undef, "2.4", 4877 );
$sth->execute( undef, "3.0", 10486 );
$sth->execute( undef, "3.1", 8119 );
$sth->execute( undef, "3.0", 10706 );
$sth->execute( undef, "2.8", 4795 );
$sth->execute( undef, "3.8", 5879 );
$sth->execute( undef, "4.1", 7252 );
$sth->execute( undef, "3.6", 6259 );
$sth->execute( undef, "2.8", 6615 );
$sth->execute( undef, "4.9", 5275 );
$sth->execute( undef, undef, 3638 );
$sth->execute( undef, undef, 3690 );
$sth->execute( undef, undef, 3283 );
$sth->execute( undef, undef, 2568 );
$sth->execute( undef, "3.2", 4950 );
$sth->execute( undef, undef, 3211 );
$sth->execute( undef, undef, 3876 );
$sth->execute( undef, undef, 2308 );
$sth->execute( undef, "3.2", 3864 );
$sth->execute( undef, "4.8", 18707 );
$sth->execute( undef, undef, 3395 );
$sth->execute( undef, undef, 2927 );
$sth->execute( undef, "1.8", 2291 );
$sth->execute( undef, "4.1", 7252 );
$sth->execute( undef, "3.6", 6259 );
$sth->execute( undef, "2.8", 6615 );
$sth->execute( undef, "4.9", 5275 );
$sth->execute( undef, undef, 3638 );
$sth->execute( undef, undef, 3690 );
$sth->execute( undef, undef, 3283 );
$sth->execute( undef, undef, 2568 );
$sth->execute( undef, "3.2", 4950 );
$sth->execute( undef, undef, 3211 );
$sth->execute( undef, undef, 3876 );

View full thread Perl Bug?