Subject: | Strange problem with set_up_table |
Date: | Thu, 19 Jul 2007 17:01:34 -0400 |
To: | <bug-Class-DBI-mysql [...] rt.cpan.org> |
From: | "Mark Rorabaugh" <mark [...] mark.org> |
Hello, I love Class::DBI::mysql and use it all the time. Unfortunately, on
one particular table, set_up_table seems to get a column wrong (or Im an
idiot, which is much more likely).
My package:
{
package DAO::ATA::Organization;
use base 'Class::DBI::mysql';
use base 'DAO::ATA::DB';
__PACKAGE__->set_up_table("Organizations");
}
In mysql:
CREATE TABLE `Organizations` (
`Org_Id` int(11) NOT NULL default '0',
`Dues_Category` smallint(6) default NULL,
`Dues_Sub_Category` smallint(6) default NULL,
`Org_Sort_Name` varchar(100) default NULL,
`Org_Name_1` varchar(100) NOT NULL default '',
`Org_Name_2` varchar(50) default NULL,
`Org_Name_3` varchar(50) default NULL,
`Address_Id` int(11) default NULL,
`Org_Address_Id_2` int(11) default NULL,
`Org Address_Id_3` int(11) default NULL,
`online_address_id` int(11) default NULL,
`Org_Member_Since` datetime default NULL,
`Phone_Number` varchar(40) default NULL,
`Org_Secondary_Phone` varchar(40) default NULL,
`Fax_Number` varchar(40) default NULL,
`Voice_Mail` varchar(14) default NULL,
`Org_User_Added` varchar(10) default NULL,
`Org_Date_Added` datetime default NULL,
`Org_User_Changed` varchar(10) default NULL,
`Org_Date_Changed` datetime default NULL,
`Org_Status_Date` datetime default NULL,
`Email` varchar(100) default NULL,
`website` varchar(65) default NULL,
`member` bit(1) default NULL,
`attention` varchar(50) default NULL,
`att_title` varchar(50) default NULL,
`last_mod_date` datetime default NULL,
`last_paid_date` datetime default NULL,
`expiration_date` datetime default NULL,
`next_bill_date` datetime default NULL,
`affiliate_code` varchar(50) default NULL,
`enroll_date` datetime default NULL,
`Org_Extension` varchar(20) default NULL,
`Altertive_email_org` varchar(60) default NULL,
`No_Junk_mail_org` tinyint(4) default NULL,
`renewal_id` int(11) default NULL,
`only_one_copy` bit(1) default NULL,
`additional_copy_needed` bit(1) default NULL,
`How_many_in_main_office` int(11) default NULL,
`how_many_in_branch1` int(11) default NULL,
`How_many_in_branch2` int(11) default NULL,
`Another_ID` int(11) default NULL,
`do_not_list_in_MD_Org` bit(1) default NULL,
`no_junk_org` bit(1) default NULL,
`no_email_org` bit(1) default NULL,
`institution_website_listing` bit(1) default NULL,
`Secondary_ext` int(11) default NULL,
`no_chronicals_org` bit(1) default NULL,
`breakout_detail` varchar(50) default NULL,
PRIMARY KEY (`Org_Id`),
KEY `org_name_idc` (`Org_Name_1`),
KEY `index2` (`expiration_date`),
KEY `index3` (`Dues_Category`),
KEY `index4` (`Org_Member_Since`),
KEY `index5` (`last_paid_date`),
KEY `index6` (`Email`),
KEY `index7` (`Address_Id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
The error I get:
Unknown column 'org' in 'field list' [for Statement "SELECT org_date_added,
no_junk_mail_org, last_mod_date, website, only_one_copy, another_id,
org_user_added, next_bill_date, email, org_address_id_2, address_id,
fax_number, org_name_2, additional_copy_needed, dues_sub_category,
breakout_detail, secondary_ext, org, member, altertive_email_org,
phone_number, org_member_since, att_title, dues_category, last_paid_date,
org_status_date, org_sort_name, how_many_in_main_office,
do_not_list_in_md_org, enroll_date, affiliate_code, how_many_in_branch2,
org_name_3, institution_website_listing, no_email_org, org_user_changed,
renewal_id, voice_mail, org_name_1, online_address_id, attention,
expiration_date, org_extension, no_chronicals_org, org_date_changed,
no_junk_org, org_secondary_phone, how_many_in_branch1
FROM Organizations
WHERE org_id=?
The column org is buried in between secondary_ext and member. I think
it _means_ to be grabbing org_id, but tries to get "org" instead.
And no, I didn't design this asinine table ;)
Class::DBI::mysql claims to be version '1.00'
Any help would be most appreciated.
Best Regards,
-Mark
ContractDesk, Inc.
P: 1.877.TRY.DESK x322