Created
July 22, 2013 19:16
-
-
Save nathanlws/6056726 to your computer and use it in GitHub Desktop.
Parser ORDER BY
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.akiban.sql.parser.*; | |
public class ParserOrderBy { | |
public static void main(String[] args) throws Exception { | |
String sql = "Select id, refName from refRepo where property='SQL' order by id asc"; | |
System.out.println("SQL: " + sql); | |
SQLParser parser = new SQLParser(); | |
StatementNode node = parser.parseStatement(sql); | |
System.out.println(node); | |
} | |
} | |
/* | |
Download and extract: | |
https://launchpad.net/akiban-sql-parser/trunk/1.0.15/+download/akiban-sql-parser-1.0.15.tar.gz | |
Compile: | |
$ javac -cp akiban-sql-parser-1.0.15/akiban-sql-parser-1.0.15.jar ParserOrderBy.java | |
Run: | |
$ java -cp akiban-sql-parser-1.0.15/akiban-sql-parser-1.0.15.jar:. ParserOrderBy | |
SQL: Select id, refName from refRepo where property='SQL' order by id asc | |
name: null | |
updateMode: UNSPECIFIED | |
statementType: SELECT | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment