in reply to Need DBI/ODBC advice.

I answered you on the dbi-users mailing list. The most likely cause for this is that the "faulty" DSN you are using has the "use regional settings when outputting currency, numbers, dates and times" setting enabled. Don't use it, it is flawed in so many ways you would not believe it and can horribly break applications expecting ODBC calls to return data as per the spec.

Replies are listed 'Best First'.
Re^2: Need DBI/ODBC advice.
by Brak (Novice) on Aug 11, 2010 at 20:34 UTC

    Yes mje, you certainly did. For the future benefit of others, here's my response that adds some additional details.

    That's exactly what the problem was, sorta. I wasn't using a DSN, but I had specified the Regional=Yes; setting in my connection string.

    dbi:ODBC:Driver={SQL Server}; Server=%server; Database=%db; Regional=Yes;

    vs

    dbi:ODBC:Driver={SQL Server}; Server=%server; Database=%db; Regional=No;

    Knowing that the DSN had that option (I don't get to interact with our server, our server guy does) made me rethink the purpose of the Regional setting. Both Perl and PHP were using the same connection string which explains why both languages were doing that.

    I turned it off and thousands of queries went from completely broken and failing to 100% working.

    Thank you so much!

      Well... that's a little irritating. In the CB I asked you, and re-asked you, to try to do a brand new connection without cutting and pasting the connection info to see what happened. In the CB, and in this post, all you shared was "dbi:ODBC:Driver={SQL Server}." If you'd shown the whole string, I would have--and probably others too--said, "Try it without the Regional setting." :(

        Yes, I fully agree and understand where I went wrong. I'm quite embarrassed. I had -wrongly- thought that the Regional setting meant something else, something that made the connection work, since I tried it earlier and didn't have a negative effect. That attempt must have correlated with something else that made the connection work instead, coincidentally. Thinking it was necessary, but not relevant to the problem, I didn't include it, just like I did not include the name of my server. Honestly, when I did try your suggestion, I just retyped it exactly as it was, since I thought Regional was important. Lesson learned though. Always post more rather than less.