Parsing query SELECT results
Posted: Wed Jan 06, 2010 7:03 am
Just starting to use rev for db stuff, and while so far it's been ultra convenient, I have run into one problem that's hopefully solved easily. I do a standard query like so:
Now, the problem lies when one of the fields in the table is a text field that might contain commas in it. When that happens, of course, my parsing of the results is all messed up.
Currently, I'm resorting to putting those "special" text fields last in the SELECT results, so I can do item n to -1 of it to get the whole thing, but that's pretty hacky and breaks as soon as I have more than one text field.
I've thought about just using a different delimiter other than comma, but pretty much any delimiter will have the same end-problem.
Is there a way for me to quote items in a string so that item x will return the entire "item" and not just up to the next itemDelimiter?
Thanks!
Jeff M.
Code: Select all
get revDataFromQuery(comma, return, tDB, "SELECT * FROM ...;")
Currently, I'm resorting to putting those "special" text fields last in the SELECT results, so I can do item n to -1 of it to get the whole thing, but that's pretty hacky and breaks as soon as I have more than one text field.
I've thought about just using a different delimiter other than comma, but pretty much any delimiter will have the same end-problem.
Is there a way for me to quote items in a string so that item x will return the entire "item" and not just up to the next itemDelimiter?
Thanks!
Jeff M.