There's more than one way to do things | |
PerlMonks |
DBI returns zero!by Bod (Parson) |
on Mar 12, 2022 at 19:04 UTC ( [id://11142041]=perlquestion: print w/replies, xml ) | Need Help?? |
Bod has asked for the wisdom of the Perl Monks concerning the following question: I have a relatively simple DB query that is giving very strange results. Have you seen anything like this before or do you have any ideas about how I might debug the problem?
I am getting a value of $usrn of zero. Despite the query excluding zero in the WHERE clause and there being no zero for idUSRN in the database table! This placeholder syntax works fine elsewhere for me. However, just in case this was the problem I have tried removing the placeholder and writing ST_Distance_Sphere( ST_GeomFromText( '$point', 4326 ), center ) and this also gives zero. But...when I copy the select statement which is printed and paste it into MySQL Query Browser connected to the same database schema, I get an eight-digit integer as expected. DBI is not displaying an error so no clues there! Swapping commenting out of the queries gives a sensible, non-zero, result. Any ideas on what I can try to get to the bottom of this would be very much appreciated. It seems weird that the same query works differently from Perl than it does when run directly against the database.
Back to
Seekers of Perl Wisdom
|
|