On Tue, Feb 16, 2010 at 8:52 AM, Alex Rufon <[email protected]> wrote:
> Which I then process again to be converted into SQL DML
> commands for either INSERT or UPDATE. This processing
> normally involves enclosing all string columns with single
> quotes like so:
>   [data=.4 5 $ ;:'aa bb cc dd'
...

Perhaps something like this?

insert=:2 :0
  m insertRaw (commas n) @ commaquotes
)

insertRaw=:2 :0
  'insert into ',"1 m,"1 ' (',"1 n,"1') values (',"1 ],"1')'"_
)

commas=: }:@;@,.&(<',')"1

QUOT=: ''''"_
quotes=: QUOT, (#~ 1+QUOT=]), QUOT

commaquotes=: commas@:(quotes each)


(sorry for posting programming stuff in chat)

But, yes, the big time eater there looks like that
commaquotes verb with (quotes each)
probably consuming the bulk of its time.

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to