Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Simple Java SQL Parser for Oracle??
Hi,
does anyone know where I could get something like a minimal "SQL Parser", that can break up *.sql files into single sql statements (ignoring comments)?
For example following file:
insert into tmp_test (nr) values (18)
/
/* some comment starts here
insert into tmp_test (nr) values (19)
/
insert into tmp_test (nr) values (20)
/ */ -- and end here
insert into tmp_test (nr) values (21)
/
should result in 2 single statements (the first one and the last one)
Until now I split up the file by myself using the regular expressions "\\r?\\n\\s*/\\s*[\\r?\\n]" but this simple expression does not take into account comments and inline comments (like Oracle's "--")
A simple Java SQL Parser with Oracle Syntax would be perfect.
Thanks in advance for any help,
Christian
Received on Wed Mar 03 2004 - 14:42:45 CST
![]() |
![]() |