package AXRecord;
# Our libraries
use lib 'C:\Users\Jay\Desktop\SBS DEV\CODE\perl\Utilities';
use AXControl;
use AXSQL;
use Moose;
use DBI;
# Attributes
has 'Keys' => (is => 'rw', isa=>'ArrayRef');
# Contains a single record
sub BUILD
# Constructor
{
}
sub Select
{
#Get the primary key fields
$self->Keys (());
$sql = AXSQL->new(ControlObject => $self->ControlObject, SQLString => "SELECT column_name FROM information_schema.`key_column_usage` WHERE table_name = '" . $self->Name . "' order by ordinal_position");
$i = 1;
while (($Col) = $sql->Fetch())
{
$self->Keys()->[$i] = $Col;
$i++;
}
$Cnt = scalar $self->Fields;
$self->FieldCount = $Cnt;
$self->Changed = -1;
}
1;
####
$self->Keys()->[$i] = $Col;
####
Can't use an undefined value as an ARRAY reference at C:\Users\Jay\Desktop\SBS DEV\CODE\perl\Utilities/AXRecord.pm line 106.
C:\Users\Jay\Desktop\SBS DEV\CODE\perl>