public static splitValidated( script as String, maxScriptSize as Long = 2000000, maxStatements as Long = 100 ) as ArrayList<String> throws ValueException
Validates and splits a multi-statement SQL script, raising ValueException when the script is empty, exceeds maxScriptSize or maxStatements, has an invalid DELIMITER directive, or contains an unterminated literal or block comment.
| Parameter | Description |
|---|---|
script | Complete SQL script text. |
maxScriptSize | Maximum allowed script character length. |
maxStatements | Maximum allowed executable statements. |
Non-empty ordered list of executable SQL statement strings.
import klyn.code.sql
stmts = SqlScriptSplitter.splitValidated("SELECT 1; SELECT 2;")
assert stmts.size == 2