How to the SQL string out of a Statement Node.

45 views
Skip to first unread message

redwood

unread,
Jun 30, 2013, 7:40:31 PM6/30/13
to akiba...@akiban.com
New to Akiban Sql Parser.

String sqlString = "select * from foo";
SQLParser parser = new SQLParser();
StatementNode stmt = parser.parseStatement(sqlString);


How can I get the sql statement out?

String sqlOut = stmt.????()

thanks,
newbie.

Nathan Williams

unread,
Jul 1, 2013, 9:50:35 AM7/1/13
to akiba...@akiban.com
On Sunday, June 30, 2013 at 7:40 PM, redwood wrote:
> String sqlString = "select * from foo";
> SQLParser parser = new SQLParser();
> StatementNode stmt = parser.parseStatement(sqlString);
>
> How can I get the sql statement out?
It is available from the SQLParser instance through the getSQLText() method

The StatementNode doesn't provide it because each node type is generally only concerned with a fraction of the whole statement.

-Nathan



bob.jen...@gmail.com

unread,
Jul 1, 2013, 1:20:18 PM7/1/13
to akiba...@akiban.com, bob.jen...@gmail.com
Thanks, makes perfect sense.

Reply all
Reply to author
Forward
0 new messages