我有一个日志条目,我只想用正则表达式提取 SQL 语句。SQL 语句可以是任何 DDL 或 DML 语句,并且可能有几行。参数部分可能会丢失,并且“在 xx 记号中获得 xx 结果”也可能会丢失。但是 ":SQLEnd:" 行总是存在的。这里有些例子
SELECT col1, col2 FROM table WHERE col1 = :id and col2= :num ORDER BY ORDERID ASC
Params:
:id -> 60081
:num-> 1
Got 2 Results in 0 Ticks
:SQLEnd:
或者:
SELECT col1, col2 FROM table WHERE col1 = :id and col2= :num ORDER BY ORDERID ASC
Got 2 Results in 0 Ticks
:SQLEnd:
或者:
SELECT col1, col2 FROM table WHERE col1 = :id and col2= :num ORDER BY ORDERID ASC
Params:
:id -> 60081
:num-> 1
:SQLEnd:
或者:
SELECT col1, col2 FROM table WHERE col1 = :id and col2= :num ORDER BY ORDERID ASC
:SQLEnd: