Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Mixed-case column names breaking under Class::DBIby sintadil (Pilgrim) |
on Sep 20, 2004 at 20:04 UTC ( [id://392477]=perlquestion: print w/replies, xml ) | Need Help?? |
sintadil has asked for the wisdom of the Perl Monks concerning the following question: So, I've been investigating Class::DBI as one possible tool that I'd like to use as part of a project that I'm developing. In order to try to learn it, I've been trying to let it work on a very simple existing PostgreSQL database that I have -- in this case, it holds authentication information for my PureFTPd FTP daemon. Now, all of my columns in this database contain an initial capital letter. I set this up long ago when I was a wee newbie with databases (well, okay -- more of a newbie than I am now) and I see that The Real World (not to be confused with the TV show by the same name) uses column names which are all lower-case. This'd be fine if C::D didn't choke on these input fields. I've tried quoting the fields in every single way possible -- '' surrounded by "", "" surrounded by '', `` surorunded by '', and `` surrounded by ''. Obviously, I can't do `` surrounding anything (well, I could, but it'd be ugly, and gives the errors given below). With every quoting method, I get a different error. Here's some sample code 1 and the error that it generates:
This returns the following when run: Removing the double quotes around the column names yields this: Quoting User gives a column not found error for ulbandwidth as seen above. I'm really quite confused about what the issue could be. Note that, with lowercase column names, it all works nicely. I'd like to be able to use C::D in my work, but I don't want to have to limit myself or change my existing configuration just to appease an API which is supposed to make my work easier. Perl's about making things easier, not harder. :) As a side note, I think that it's interesting that this is a known problem at least for Sybase databases. I wonder if what's breaking it under Sybase is also at work here. ---- 1: I've just shoved everything in package main for the purpose of brevity. I don't see how this could affect it in such a way that it fails to find a column name because of a missed capital letter.
Back to
Seekers of Perl Wisdom
|
|