you can obtain the sql statement using substring method like
String str = "PSAPPSRV.21201 1-42 13.35.54 238.360 Cur#1.HDEV RC=0 Dur=0.000 COM Stmt=SELECT VERSION FROM PSVERSION WHERE OBJECTTYPENAME = \'SYS\'";
Again I assume there is no word SELECT preceding and the word SELECT is all caps.
String result = str.substring(str.indexOf("SELECT"));
Phani532 wrote:What was wrong with reply #2 ?
Output must be like this.
SELECT VERSION FROM PSVERSION WHERE OBJECTTYPENAME = 'SYS'
SELECT STYLESHEETNAME FROM PSOPTIONS
In place of select we may have any DML statements..like..UPDATE..etc..
Can you please suggest a method.......
and here I posted only two statements but the original file has some thousands of linesUse a loop!