parse a multi-line SQL programs to get the single-line SQL statements

Please help to write a program to parse a multi-line SQL programs to get the single-line SQL statements enclosed inside "jdbcTemplate.update".
Input is:
[code]jdbcTemplate.update("CREATE TABLE assets ( " +
"ID int not NULL auto_increment primary key, " +
"Name varchar(50) default NULL, " +
"Description varchar(150) default NULL, " +
"isEnabled smallint default NULL, " +
"ID varchar(30) default NULL, " +
"AssetCategoryName varchar(50) default NULL " +
")");

jdbcTemplate.update("DROP TABLE assets");[/code]

Output is:
[code]CREATE TABLE assets ID int not NULL auto_increment primary key Name varchar(50) default NULL Description varchar(150) default NULL isEnabled smallint default NULL ID varchar(30) default NULL AssetCategoryName varchar(50) default NULL

DROP TABLE assets[/code]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories