$row->{city} ||= '?'; # not null
+ my $jmbg = delete $row->{jmbg};
+
insert 'borrowers' => $row;
+ insert 'borrower_attributes' => {
+ borrowernumber => $k->{mysql_insertid},
+ code => 'JMBG',
+ attribute => $jmbg,
+ } if $jmbg;
+
}
}
-$k->do(qq{
-delete from borrowers where borrowernumber > 57
-});
+$k->do(qq{ delete from borrowers where borrowernumber > 57 });
+$k->do(qq{ delete from borrower_attributes where borrowernumber > 57 });
borrowers qq{
select
post_ozn_stan as B_city,
adr_stan as B_address,
tel_stud as phone,
- dat_prava_do as dateexpiry
+ dat_prava_do as dateexpiry,
-- aktivan as ??,
+ jmbg_stud as jmbg
from studk
};
post_ozn as zipcode,
post_ozn as city,
adr_stan as address,
- tel_stan as phone
+ tel_stan as phone,
+ jmbg_djel as jmbg
from djelat
};
post_ozn as zipcode,
post_ozn as city,
adr_stan as address,
- tel_stan as phone
+ tel_stan as phone,
-- aktivan as ??,
+ jmbg_clan as jmbg
from clost
};