Package org.pentaho.di.core.database
Class SqlScriptParser
java.lang.Object
org.pentaho.di.core.database.SqlScriptParser
This class represents a splitter of SQL script into separate statements. It respects the notion of a string
literal and comments, such that if a separator appears in a string literal or comment, it is treated as
part of the string or comment instead of a separator.
- Author:
- Alexander Buloichik
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
SqlScriptParser
public SqlScriptParser(boolean usingBackslashAsEscapeCharForQuotation) - Parameters:
usingBackslashAsEscapeCharForQuotation
- use backslash as escape char for quotation (\')
-
-
Method Details
-
split
This method splits script into separate statements.- Parameters:
script
- a string representing the SQL script to parse- Returns:
- the list of statements
-
removeComments
This method removes comments from one statement.- Parameters:
script
- a string representing the SQL script to parse- Returns:
- script without comments
-