Did you read the replies you already have? I advised that you look at tracing, which you've not done in this example.
In reply to Re^3: SQL in perl/tk by marto in thread SQL in perl/tk by vsurend