Parsing query SELECT results

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
massung
Posts: 93
Joined: Thu Mar 19, 2009 5:34 pm

Parsing query SELECT results

Post by massung » 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:

Code: Select all

get revDataFromQuery(comma, return, tDB, "SELECT * FROM ...;")
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.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Parsing query SELECT results

Post by Mark » Wed Jan 06, 2010 9:33 am

Jeff,

You can use tab, numtoChar(11), numToChar(14), etc.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply

Return to “Databases”