Bill Wood

Douglas Wilson dgwilson1 at
Thu Apr 24 21:42:52 CDT 2003

----- Original Message ----- 
From: "Bill Wood" <wwood at>
> 1 my $date_diff=0;
> 2 my $diff_test = 0;
> 3 my $sql = qq/
> 4 select datediff(dd,"$last_used_date{$card_key}","$trans_date")/;
> 5 @ret = $dbh->sql("$sql",sub {($date_diff)=@_;});

Are you using Win32::ODBC? I see a sql method in the docs,
but I don't see that it takes a second argument, let alone a
subroutine. You have to call $dbh->FetchRow in order to
fetch any values after the sql method. And I would print
both $date_diff and $diff_test as Bob suggests.

Win32::ODBC was the only option before DBD::ODBC came
along, but these days, in order to more fully be compatible with
the rest of the world and have other people be able to help you,
I'd switch to DBI and DBD::ODBC if at all possible. You then
also get the benefit of placeholders/bind_values. Though you're
still stuck with the ODBC limitation of only one active statement
handle at a time.



The posting address is: san-diego-pm-list at

List requests should be sent to: majordomo at

If you ever want to remove yourself from this mailing list,
you can send mail to <majordomo at> with the following
command in the body of your email message:

    unsubscribe san-diego-pm-list

If you ever need to get in contact with the owner of the list,
(if you have trouble unsubscribing, or have questions about the
list itself) send email to <owner-san-diego-pm-list at> .
This is the general rule for most mailing lists when you need
to contact a human.

More information about the San-Diego-pm mailing list