I see noone replied to you. I can't help you now but have a need to explore this 
module.  Maybe we can help each other.  I can't get it to "make test" on Winsows 2000. 
 Are you not on Windows?


I haven't used this module but got the idea to use it for somthing I'm doing that is a 
little weird.  Got all the specified and unspecified pre-requisites.  All got made and 
installd OK except DBD::RAM.  Make test gets me the following


Testing empty loop speed ...
100000 iterations in 0.1 cpu+sys seconds (1000000 per sec)

Testing connect/disconnect speed ...
2000 connections in 1.0 cpu+sys seconds (1921 per sec)

Testing CREATE/DROP TABLE speed ...
Test failed, message: Can't locate DBI object method "csv_cache_sql_parser_objec
t" via package "DBD::RAM::db" at C:/perl/site/5.6.0/lib/DBD/File.pm line 170.

Can't locate DBI object method "csv_cache_sql_parser_object" via package "DBD::R
AM::db" at C:/perl/site/5.6.0/lib/DBD/File.pm line 170.
NMAKE : fatal error U1077: 'C:\perl\5.6.0\bin\MSWin32-x86\perl.exe' : return code 
'0xff'
Stop.


I'm on Windows 2000.  


-----Original Message-----
From: Gabriel C Millerd [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 10, 2002 5:53 AM
To: [EMAIL PROTECTED]
Subject: DBD::RAM Woes


i am writing a little function (see hack below) that will allow me to
sort data for my CGI's easily (especially for multiple columns) ... ala
another function that works the CGI.pm aspect of things.

problem is that this function seems to (under mod_perl) duplicate the
rows that i pass to it (although it sorts all of them wonderfully). if i
castrate the function in order to see if the problem is elsewhere to
'sub sortcol {return shift}' it works just fine (although it doesnt sort
anything)

thanks for any help you guys can provide.



package Hacks;
use strict;
use DBI;

sub sortcol {
     my @body=@{$_[0]};
     my @ords=@{$_[1]};
     my $cols = @body;
     my $table="tmptable";
     my @alpha=('a' .. 'zz');
     my @col_names;
     my $dbh = DBI->connect('dbi:RAM:',,,{RaiseError => 0});

     for my $i (0 .. $cols-1) {
         push(@col_names, $alpha[$i]);
     }

     $dbh->func({table_name  => $table,
                 col_names   => join(',',@col_names),
                 data_type   => 'ARRAY',
                 data_source => \@body,
             }, 'import' );

     my $orderby;
     {
         my @tmp;
         for my $ord (@ords) {
             my $ao=abs($ord);
             push(@tmp,
                  join(' ',
                       $alpha[$ao],
                       $ao==$ord ? "ASC" : "DESC"));
         }
         $orderby=join(', ', @tmp);
     }

     # DBD::RAM 'export array' method broken?
     my $sth = $dbh->prepare("SELECT * FROM $table ORDER BY $orderby");
     $sth->execute();
     my @body;
     while( my (@cells) = $sth->fetchrow_array) {
         push(@body, \@cells);
     }
     $sth->finish();
     $dbh->disconnect();
     return(\@body);
}
1;


---
Gabriel C. Millerd |        Oh loneliness and cheeseburgers are a deadly
     Super Plumber |                combination. -Comic Book Guy
                   |

Reply via email to