Gossamer Forum
Home : Products : Gossamer Links : Discussions :

problems with $table->delete

Quote Reply
problems with $table->delete
Hi,



I'm having a problem deleting a record. Whenever I try to delete a record I get the error 'Can't use an undefined value as a HASH reference at <path>/admin/GT/SQL/Table.pm line 2227'.



The code is here;

my $table = $DB->table('MEMBERS');

my $result = $table->delete( {member_key => $member_key} );

The contents of the MEMBERS def file is below:

{
'subclass' => {},
'index' => {},
'fk' => {
'MEMBER_ACCT_DETAILS' => {
'member_id' => 'acct_id'
}
},
'cols' => {
'member_key' => {
'type' => 'INT',
'pos' => '1',
'not_null' => '1',
'unsigned' => '0'
},
'member_id' => {
'type' => 'VARCHAR',
'pos' => '2',
'size' => '6',
'not_null' => '1'
},
'username' => {
'type' => 'VARCHAR',
'pos' => '3',
'size' => '64',
'not_null' => '1'
},
'rawpw' => {
'type' => 'VARCHAR',
'pos' => '4',
'size' => '64',
'not_null' => '1'
},
'password' => {
'type' => 'VARCHAR',
'pos' => '5',
'size' => '32',
'not_null' => '1'
},
'title' => {
'type' => 'VARCHAR',
'pos' => '6',
'size' => '16',
'not_null' => '1'
},
'initials' => {
'type' => 'VARCHAR',
'pos' => '7',
'size' => '8',
'not_null' => '0'
},
'firstname' => {
'type' => 'VARCHAR',
'pos' => '8',
'size' => '32',
'not_null' => '1'
},
'other_names' => {
'type' => 'VARCHAR',
'pos' => '9',
'size' => '32',
'default' => ''
},
'surname' => {
'type' => 'VARCHAR',
'pos' => '10',
'size' => '64',
'not_null' => '1',
'default' => ''
},
'honours' => {
'type' => 'VARCHAR',
'pos' => '11',
'size' => '64',
'default' => ''
},
'dob' => {
'type' => 'DATE',
'pos' => '12',
'not_null' => '1'
},
'membership_type' => {
'type' => 'VARCHAR',
'pos' => '13',
'size' => '8',
'default' => ''
},
'professional_pos' => {
'type' => 'VARCHAR',
'pos' => '14',
'size' => '255',
'default' => ''
},
'pocp' => {
'type' => 'VARCHAR',
'pos' => '15',
'size' => '255',
'default' => ''
},
'diploma_id' => {
'type' => 'VARCHAR',
'pos' => '16',
'size' => '16'
},
'educational_qualifications' => {
'type' => 'VARCHAR',
'pos' => '17',
'size' => '64',
'default' => ''
},
'addr1' => {
'type' => 'VARCHAR',
'pos' => '18',
'size' => '64',
'not_null' => '1',
'default' => ''
},
'addr2' => {
'type' => 'VARCHAR',
'pos' => '19',
'size' => '64',
'default' => ''
},
'addr3' => {
'type' => 'VARCHAR',
'pos' => '20',
'size' => '64',
'default' => ''
},
'town_city' => {
'type' => 'VARCHAR',
'pos' => '21',
'size' => '64',
'not_null' => '1'
},
'county' => {
'type' => 'VARCHAR',
'pos' => '22',
'size' => '64',
'default' => ''
},
'country' => {
'type' => 'VARCHAR',
'pos' => '23',
'size' => '64',
'default' => ''
},
'postcode' => {
'type' => 'VARCHAR',
'pos' => '24',
'size' => '64'
},
'home_phone_no' => {
'type' => 'VARCHAR',
'pos' => '25',
'size' => '24',
'default' => ''
},
'mobile_no' => {
'type' => 'VARCHAR',
'pos' => '26',
'size' => '24',
'default' => ''
},
'home_fax_no' => {
'type' => 'VARCHAR',
'pos' => '27',
'size' => '24'
},
'work_phone_no' => {
'type' => 'VARCHAR',
'pos' => '28',
'size' => '24',
'default' => ''
},
'work_fax_no' => {
'type' => 'VARCHAR',
'pos' => '29',
'size' => '24',
'default' => ''
},
'email_addr' => {
'type' => 'VARCHAR',
'pos' => '30',
'size' => '24',
'not_null' => '11',
},
'web_addr' => {
'type' => 'VARCHAR',
'pos' => '31',
'size' => '255'
},
'ever_logged_in' => {
'values' => [
'Y',
'N'
],
'type' => 'ENUM',
'pos' => '32',
'not_null' => '1',
'default' => 'N'
},
'search_optin' => {
'values' => [
'checked',
'NULL'
],
'type' => 'ENUM',
'pos' => '33',
'not_null' => '0',
'default' => 'NULL'
},
},
'ai' => 'member_key',
'fk_tables' => [
'SESSIONS',
'MEMBER_ACCT_DETAILS'
],
'pk' => [
'member_key'
],
'unique' => {}
};
Subject Author Views Date
Thread problems with $table->delete wobbly 1558 Jul 11, 2003, 7:03 AM
Post Re: [wobbly] problems with $table->delete
Alex 1505 Jul 11, 2003, 7:59 AM
Post Re: [wobbly] problems with $table->delete
wobbly 1515 Jul 11, 2003, 8:21 AM