in reply to Re^4: in, ands, ors in query (qq)
in thread in, ands, ors in query
Print out your statement. It isn't what you expect. Then reread what I wrote to see why.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: in, ands, ors in query (qq)
by Anonymous Monk on Dec 13, 2006 at 04:21 UTC | |
I took your suggestion and printed the statement and recieved I've reread it quite a few times now and I don't see anything misplaced or missing. Of course that's assuming you meant for me to do I carefully counted the open and close parens around the JOIN and all of them were there, including the last paren after public"). I also went ahead and tried again after creating the array and something looks weird about it printing out every element at once, I sort of expected it to only print one.
| [reply] [d/l] [select] |
by tye (Sage) on Dec 13, 2006 at 04:57 UTC | |
What you printed is what the DB is seeing. The DB doesn't know Perl so this query will return records where special_fields is either the string ".join(" or is the string ",map(->quote(), red blue orange green)).". You aren't getting any records returned because you don't have any records with either of those two strings in that column (not surprisingly). You need to have that Perl code executed, so you have to take that code outside of the quotes, that is, outside of the qq( ... ). The quote (") in this code:
you appear to think is ending the quoted string such that Perl executes the concatenation operator (.) and calls the join function. But, as I said way up there, a quote (") doesn't end a quoted string that was started with qq(. I'm going to stop right there because I think you can figure out the rest. You appear to just have had a hard time seeing this. No, I'll give you one more hint. You might want to change from qq( ... ) to something like qq{ ... }, qq< ... >, or qq[ ... ], because ending a qq( ... ) string having unmatched parens (which is what the first part of your statement needs to be) is a bit tricky. Though you might want to experiment with the trickier syntax after you get it working just for your own enlightenment. Good luck. - tye | [reply] [d/l] [select] |