parsing SQL statement



Anyone having suggestion parsing SQL statement?

It should able to parse:

BLA BALA BALA...

VALUES(
'abcd efg',,999, 'some \"STRING\" and \'STR2\' STR3',,,, 'abcd, def, fghi'
)

I'm using tr and then split by "," but it will fall when seeing comma
inside the single quote.

Thanks.

--budhi
.