Ima::DBI "Not an array reference" problem

From: Peter Eichman (peichman_at_wam.umd.edu)
Date: 07/06/04


Date: 6 Jul 2004 11:00:00 -0700

I'm working on a Class::DBI based application using a Postgres
database, and it is failing with this error:

CSP::Calendar::Appointment can't
    SELECT id, semester, person, class_number, room, start, appt_end,
series, canceled, comments, entered_by, entered_at
    FROM appointment
    WHERE date_trunc('day', ?) BETWEEN date_trunc('day', start) AND
date_trunc('day', appt_end)
: Not an array reference (DateTime=HASH(0x5a91354)) at
C:/Perl/site/lib/Ima/DBI.pm line 715, <DATA> line 164.
 at D:/Programs/CSPCalendar/GUI/CalendarView.pm line 618

Here are what I think are the relevant code excerpts:

CalendarView.pm - line 618 - the initial source of the call that is
causing the error:

my @all_appts = CSP::Calendar::Appointment->search_on_date($date);

in CSP::Calendar::Appointment, where I set up the search_on_date
method:

__PACKAGE__->set_sql(on_date => qq[
    SELECT __ESSENTIAL__
    FROM __TABLE__
    WHERE date_trunc('day', ?) BETWEEN date_trunc('day', start) AND
date_trunc('day', appt_end)
]);

start and appt_end are defined as:

__PACKAGE__->has_a(
    start => 'DateTime',
    inflate => sub { DateTime::Format::W3CDTF->parse_datetime(shift)
},
    deflate => 'datetime',
);

__PACKAGE__->has_a(
    appt_end => 'DateTime',
    inflate => sub { DateTime::Format::W3CDTF->parse_datetime(shift)
},
    deflate => 'datetime',
);

When I switch to a SQLite databse, this problem goes away. Can anyone
shed any light on this problem? (If there is a different, more
appropriate list to send this problem, let me know).

tia,
-Peter Eichman



Relevant Pages

  • Re: PostgreSQL setup and use
    ... So now I have it installed and I try to create a database using ... I'm logged in as bpepers and just do "createdb foo" on the ... The pg_hba.conf is using "ident ... run createuser as postgres. ...
    (Fedora)
  • Re: Appointment card - whats the point
    ... amend the details of those you have 'management' over. ... OK so the database is administered centrally, ... appointment reviews etc were the previous local ... CRB and Reviews are local responsibility, at best all hq can do is ...
    (uk.rec.scouting)
  • Re: Postgres PL/Python
    ... > I wonder if anyone on this list is using Python as Postgres ... It sounds like I have the whole Python ... code between database and clients when the clients are written in Python ...
    (comp.lang.python)
  • Re: Postrgres data restoration problem (which NG to post to?)
    ... I could not find a postgres group, nor a linux database group. ... what format is the backup in: is it a copy of the database ... Then, use psql to connect to template1, then restore the backup as ...
    (comp.os.linux.development.apps)
  • Re: PDO: Switch database user without reopening connection
    ... multiple users set up on my Postgres database with varying levels of ... the postgres user they are logged in as to one that can make ... modifications to the database as well (editors get update permission, ... Unless you are using persistent connections, there is not much use in changing. ...
    (comp.lang.php)