$sth->execute($foo,$bar)
or die "Couldn't execute query:" . $sth->errstr;
####
LEVEL | EFFECT
--------------------------------------------
0 Disable trace
1 Execution trace (values and errors)
2 L1 + method and params
3 L2 + driver level (very detailed)
4 An insane amount of information
####
# The main Select
$sth_main = $dbh->prepare(<<'__EOSQL__');
SELECT DISTINCT t.account_no,
t.telephony_id,
n.sim,
n.mobile_number,
s.user_name,
s.contract_status,
s.dealer,
to_char(t.eff_start_date,'DD.MM.YYYY'),
to_char(s.signed_date,'DD.MM.YYYY'),
to_char(s.subscr_change_upd,'DD.MM.YYYY'),
lpad(s.s_id,7,'0'),
to_char(t.eff_start_date,'HH24:MI:SS')
FROM new_sim n, subscription s, tele_period t
WHERE (t.account_no = n.account_no) AND
(t.telephony_id = n.mobile_number) AND
(t.account_no = s.account_no) AND
(t.telephony_id = s.mobile_number)
ORDER BY t.account_no, t.telephony_id
__EOSQL__
####
# using an array ref instead
$rec = $sth_main->fetchrow_arrayref('NAME_lc')
$sth_imei->execute( $rec->[1], $rec->[0] )
or die $sth_imei->errstr;
# using a hash ref
$rec = $sth_main->fetchrow_hashref('NAME_lc');
$sth_imei->execute( $rec->{telephony_id}, $rec->{account_no})
or die $sth_imei->errstr;