Hello Wolfram Forum,
I have data in list format (e.g. {{a},{b},{c}), with all entries being strings. How can I export this for SQL?
The output format looks like,
update <insert> set <insert>=<insert> where <insert>=<insert> and <insert>=<insert>;
The above {"a","b","c"} correspond to each row in the text file to be used for MySQL. "<insert>" is a variable/value, removed here to make this generic. I have the code that concatenates the variables into rows and makes it a string,
?ToString[
? "update tableName set fieldName= " <> ? ? ToString[variable] <>
? ? " where fieldName='" <> ToString[variable] <> "' and field='" <>
? ? ToString[variable <> "';" ? ?]
One problem is that the list format ends the line with a comma (i.e. ,). Also, it begins the list with {{ and end encapsulates each row with { }. I haven't been able to get the "SQL" option for Export to work in Mathematica version 10 and haven't come across an example online. Maybe I should export it in some other text format?
Thanks,
Greg